Requests#
BaseOptionLatestDataRequest#
- class alpaca.data.requests.BaseOptionLatestDataRequest(*, symbol_or_symbols: Union[str, List[str]], feed: Optional[OptionsFeed] = None)#
A base request object for retrieving the latest data for options. You most likely should not use this directly and instead use the asset class specific request objects.
- symbol_or_symbols#
The option identifier or list of option identifiers.
- Type:
Union[str, List[str]]
- feed#
The source feed of the data. opra or indicative. Default: opra if the user has the options subscription, indicative otherwise.
- Type:
Optional[OptionsFeed]
OptionBarsRequest#
- class alpaca.data.requests.OptionBarsRequest(*, symbol_or_symbols: Union[str, List[str]], start: Optional[datetime] = None, end: Optional[datetime] = None, limit: Optional[int] = None, currency: Optional[SupportedCurrencies] = None, sort: Optional[Sort] = None, timeframe: TimeFrame)#
The request model for retrieving bar data for option contracts.
See BaseBarsRequest for more information on available parameters.
- symbol_or_symbols#
The ticker identifier or list of ticker identifiers.
- Type:
Union[str, List[str]]
- timeframe#
The period over which the bars should be aggregated. (i.e. 5 Min bars, 1 Day bars)
- Type:
- start#
The beginning of the time interval for desired data. Timezone naive inputs assumed to be in UTC.
- Type:
Optional[datetime]
- end#
The end of the time interval for desired data. Defaults to now. Timezone naive inputs assumed to be in UTC.
- Type:
Optional[datetime]
- limit#
Upper limit of number of data points to return. Defaults to None.
- Type:
Optional[int]
- sort#
The chronological order of response based on the timestamp. Defaults to ASC.
- Type:
Optional[Sort]
OptionTradesRequest#
- class alpaca.data.requests.OptionTradesRequest(*, symbol_or_symbols: Union[str, List[str]], start: Optional[datetime] = None, end: Optional[datetime] = None, limit: Optional[int] = None, currency: Optional[SupportedCurrencies] = None, sort: Optional[Sort] = None)#
This request class is used to submit a request for option trade data.
See BaseTimeseriesDataRequest for more information on available parameters.
- symbol_or_symbols#
The option identifier or list of option identifiers.
- Type:
Union[str, List[str]]
- start#
The beginning of the time interval for desired data. Timezone naive inputs assumed to be in UTC.
- Type:
Optional[datetime]
- end#
The end of the time interval for desired data. Defaults to now. Timezone naive inputs assumed to be in UTC.
- Type:
Optional[datetime]
- limit#
Upper limit of number of data points to return. Defaults to None.
- Type:
Optional[int]
- sort#
The chronological order of response based on the timestamp. Defaults to ASC.
- Type:
Optional[Sort]
OptionLatestQuoteRequest#
- class alpaca.data.requests.OptionLatestQuoteRequest(*, symbol_or_symbols: Union[str, List[str]], feed: Optional[OptionsFeed] = None)#
This request class is used to submit a request for the latest option quote data.
See BaseOptionLatestDataRequest for more information on available parameters.
- symbol_or_symbols#
The option identifier or list of option identifiers.
- Type:
Union[str, List[str]]
- feed#
The source feed of the data. opra or indicative. Default: opra if the user has the options subscription, indicative otherwise.
- Type:
Optional[OptionsFeed]
OptionLatestTradeRequest#
- class alpaca.data.requests.OptionLatestTradeRequest(*, symbol_or_symbols: Union[str, List[str]], feed: Optional[OptionsFeed] = None)#
This request class is used to submit a request for the latest option trade data.
See BaseOptionLatestDataRequest for more information on available parameters.
- symbol_or_symbols#
The option identifier or list of option identifiers.
- Type:
Union[str, List[str]]
- feed#
The source feed of the data. opra or indicative. Default: opra if the user has the options subscription, indicative otherwise.
- Type:
Optional[OptionsFeed]
OptionSnapshotRequest#
- class alpaca.data.requests.OptionSnapshotRequest(*, symbol_or_symbols: Union[str, List[str]], feed: Optional[OptionsFeed] = None)#
This request class is used to submit a request for snapshot data for options.
- symbol_or_symbols#
The option identifier or list of option identifiers.
- Type:
Union[str, List[str]]
- feed#
The source feed of the data. opra or indicative. Default: opra if the user has the options subscription, indicative otherwise.
- Type:
Optional[OptionsFeed]
OptionChainRequest#
- class alpaca.data.requests.OptionChainRequest(*, underlying_symbol: str, feed: Optional[OptionsFeed] = None, type: Optional[ContractType] = None, strike_price_gte: Optional[float] = None, strike_price_lte: Optional[float] = None, expiration_date: Optional[Union[date, str]] = None, expiration_date_gte: Optional[Union[date, str]] = None, expiration_date_lte: Optional[Union[date, str]] = None, root_symbol: Optional[str] = None, updated_since: Optional[datetime] = None)#
This request class is used to submit a request for option chain data for options.
- underlying_symbol#
The underlying_symbol for option contracts.
- Type:
str
- feed#
The source feed of the data. opra or indicative. Default: opra if the user has the options subscription, indicative otherwise.
- Type:
Optional[OptionsFeed]
- type#
Filter contracts by the type (call or put).
- Type:
Optional[ContractType]
- strike_price_gte#
Filter contracts with strike price greater than or equal to the specified value.
- Type:
Optional[float]
- strike_price_lte#
Filter contracts with strike price less than or equal to the specified value.
- Type:
Optional[float]
- expiration_date#
Filter contracts by the exact expiration date (format: YYYY-MM-DD).
- Type:
Optional[Union[date, str]]
- expiration_date_gte#
Filter contracts with expiration date greater than or equal to the specified date.
- Type:
Optional[Union[date, str]]
- expiration_date_lte#
Filter contracts with expiration date less than or equal to the specified date.
- Type:
Optional[Union[date, str]]
- root_symbol#
Filter contracts by the root symbol.
- Type:
Optional[str]
- updated_since#
Filter to snapshots that were updated since this timestamp.
- Type:
Optional[datetime]