Skip to main content

historical

Get historical price data for a given stock. This includes open, high, low, close, and volume.

Examples

from openbb import obb
obb.equity.price.historical(symbol='AAPL', provider='fmp')
obb.equity.price.historical(symbol='AAPL', interval='1d', provider='intrinio')

Parameters

NameTypeDescriptionDefaultOptional
symbolUnion[str, List[str]]Symbol to get data for. Multiple items allowed for provider(s): alpha_vantage, cboe, fmp, polygon, tiingo, tmx, tradier, yfinance.False
intervalstrTime interval of the data to return.1dTrue
start_dateUnion[date, str]Start date of the data, in YYYY-MM-DD format.NoneTrue
end_dateUnion[date, str]End date of the data, in YYYY-MM-DD format.NoneTrue
providerLiteral['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'tiingo', 'tmx', 'tradier', 'yfinance']The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'alpha_vantage' if there is no default.alpha_vantageTrue

Returns

OBBject
results : List[EquityHistorical]
Serializable results.

provider : Optional[Literal['alpha_vantage', 'cboe', 'fmp', 'intrinio', 'polygon', 'tiingo', 'tmx', 'tradier', 'yfinance']]
Provider name.

warnings : Optional[List[Warning_]]
List of warnings.

chart : Optional[Chart]
Chart object.

extra : Dict[str, Any]
Extra info.

Data

NameTypeDescription
dateUnion[date, datetime]The date of the data.
openfloatThe open price.
highfloatThe high price.
lowfloatThe low price.
closefloatThe close price.
volumeUnion[float, int]The trading volume.
vwapfloatVolume Weighted Average Price over the period.