Skip to main content

historical

Historical Index Levels.

Examples

from openbb import obb
obb.index.price.historical(symbol='^GSPC', provider='fmp')
# Not all providers have the same symbols.
obb.index.price.historical(symbol='SPX', provider='intrinio')

Parameters

NameTypeDescriptionDefaultOptional
symbolUnion[str, List[str]]Symbol to get data for. Multiple items allowed for provider(s): cboe, fmp, intrinio, polygon, yfinance.False
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

Returns

OBBject
results : List[IndexHistorical]
Serializable results.

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

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

chart : Optional[Chart]
Chart object.

extra : Dict[str, Any]
Extra info.

Data

NameTypeDescription
dateUnion[Union[date, datetime], str]The date of the data.
openAnnotated[float, Strict(strict=True)]The open price.
highAnnotated[float, Strict(strict=True)]The high price.
lowAnnotated[float, Strict(strict=True)]The low price.
closeAnnotated[float, Strict(strict=True)]The close price.
volumeintThe trading volume.