Skip to main content

historical

ETF Historical Market Price.

Example​

from openbb import obb
obb.etf.historical(symbol="SPY")
obb.etf.historical("SPY", provider="yfinance")
#### This function accepts multiple tickers. ####
obb.etf.historical("SPY,IWM,QQQ,DJIA", provider="yfinance")

Parameters​

NameTypeDescriptionDefaultOptional
symbolstrSymbol to get data for. (ETF)False
start_dateUnion[str, date]Start date of the data, in YYYY-MM-DD format.NoneTrue
end_dateUnion[str, date]End date of the data, in YYYY-MM-DD format.NoneTrue
providerLiteral['yfinance']The provider to use for the query, by default None. If None, the provider specified in defaults is selected or 'yfinance' if there is no default.yfinanceTrue

Returns​

OBBject
results : List[EtfHistorical]
Serializable results.

provider : Optional[Literal['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.
volumeintThe trading volume.