Contracts#
The option contracts endpoints allow you to view the list of option contracts available on Alpaca for market data and trading.
Get Option Contracts#
- TradingClient.get_option_contracts(request: GetOptionContractsRequest) Union[OptionContractsResponse, Dict[str, Any]] #
The option contracts API serves as the master list of option contracts available for trade and data consumption from Alpaca.
- Parameters:
request (GetOptionContractsRequest) – The parameters that option contracts can be queried by.
- Returns:
The object includes list of option contracts.
- Return type:
OptionContracts (Union[OptionContractsResponse, RawData])
Get Option Contract#
- TradingClient.get_option_contract(symbol_or_id: Union[UUID, str]) Union[OptionContract, Dict[str, Any]] #
The option contracts API serves as the master list of option contracts available for trade and data consumption from Alpaca.
- Parameters:
symbol_or_id (Union[UUID, str]) – The symbol or id of the option contract to retrieve.
- Returns:
The list of option contracts.
- Return type:
OptionContracts (Union[OptionContracts, RawData])