Requests#
BaseTimeseriesDataRequest#
- class alpaca.data.requests.BaseTimeseriesDataRequest(*, 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)#
A base class for requests for time series data between a start and an end. This shouldn’t be instantiated directly. Instead, you should use one of the data type specific classes.
- symbol_or_symbols#
The ticker identifier or list of ticker 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. 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]
- currency#
The currency the data should be returned in. Default to USD.
- Type:
Optional[SupportedCurrencies]
- sort#
(Optional[Sort]): The chronological order of response based on the timestamp. Defaults to ASC.
- Type:
Optional[alpaca.common.enums.Sort]
BaseBarsRequest#
- class alpaca.data.requests.BaseBarsRequest(*, 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)#
A base request object for retrieving bar data for securities. You most likely should not use this directly and instead use the asset class specific request objects.
- symbol_or_symbols#
The ticker identifier or list of ticker 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]
- timeframe#
The period over which the bars should be aggregated. (i.e. 5 Min bars, 1 Day bars)
- Type:
- sort#
The chronological order of response based on the timestamp. Defaults to ASC.
- Type:
Optional[Sort]