Triple.Stocks (triple v1.0.0)

Copy Markdown View Source

Brokerage product (stock/fund) lookups by ISIN.

Summary

Functions

Fetches a stock/fund by ISIN.

Same as fetch/3, but raises instead of returning {:error, _}.

Functions

fetch(config, isin, opts \\ [])

@spec fetch(Triple.Config.t(), String.t(), keyword()) ::
  {:ok, Triple.Types.Stock.t()} | {:error, Triple.Error.t()}

Fetches a stock/fund by ISIN.

Pass format: :svg_light (an atom or string) in opts to filter which single logo resource format comes back — per Triple's API, format is a single-value selector (png_512_512_dark, png_512_512_light, svg_dark, or svg_light), not a list. Omit it to get all available resource formats.

Examples

Triple.Stocks.fetch(client, "LU1778762911")
#=> {:ok, %Triple.Types.Stock{isin: "LU1778762911", ...}}

Triple.Stocks.fetch(client, "LU1778762911", format: :svg_light)
#=> {:ok, %Triple.Types.Stock{...}}

fetch!(config, isin, opts \\ [])

Same as fetch/3, but raises instead of returning {:error, _}.