Assets#

With the asset methods, you can query the list of assets that are available for trading and data consumption through Alpaca.

Get All Assets#

BrokerClient.get_all_assets(filter: Optional[GetAssetsRequest] = None) Union[List[Asset], Dict[str, Any]]#

The assets API serves as the master list of assets available for trade and data consumption from Alpaca. Some assets are not tradable with Alpaca. These assets will be marked with the flag tradable=false.

Parameters:

filter (Optional[GetAssetsRequest]) – The parameters that can be assets can be queried by.

Returns:

The list of assets.

Return type:

List[Asset]

Get a Single Asset#

BrokerClient.get_asset(symbol_or_asset_id: Union[UUID, str]) Union[Asset, Dict[str, Any]]#

Returns a specific asset by its symbol or asset id. If the specified asset does not exist a 404 error will be thrown.

Parameters:

symbol_or_asset_id (Union[UUID, str]) – The symbol or asset id for the specified asset

Returns:

The asset if it exists.

Return type:

Asset