Skip to content

list_instruments


function backtide.data.list_instruments(instrument_type, exchange=None, limit=100, verbose=True)

List available instruments for a given instrument type.

When exchanges is provided, the limit is distributed evenly across the specified exchanges.

Parameters

instrument_type : str | InstrumentType

For which instrument type to list the instruments.

exchange : str | Exchange | list[str | Exchange] | None, default=None
Optional exchange filter. If None, a default list of major exchanges is used. If specified, only query those exchanges and distribute limit evenly across them. This parameter is ignored for single-exchange providers.

limit : int, default=100
Maximum number of instruments to return. The actual number may be smaller, but not larger.

verbose : bool, default=True
Whether to display a progress spinner in the terminal.

Returns

list[Instrument]

Instruments for the given instrument type.


See Also

download_bars

Download OHLCV data for the instruments described in a list of profiles.

fetch_instruments

Get instruments given their symbols.

resolve_profiles

Resolve the instrument profiles needed to download a set of symbols.


Example

>>> from backtide.data import list_instruments

>>> print(list_instruments("crypto", limit=5))

[Instrument(symbol="BTC-USD", name="Bitcoin USD", base="BTC", quote="USD", instrument_type="crypto", exchange="CCC", provider=Yahoo), Instrument(symbol="BTC-EUR", name="Bitcoin EUR", base="BTC", quote="EUR", instrument_type="crypto", exchange="CCC", provider=Yahoo), Instrument(symbol="BTC-GBP", name="Bitcoin GBP", base="BTC", quote="GBP", instrument_type="crypto", exchange="CCC", provider=Yahoo)]