Skip to main content

historical

Get historical price data for cryptocurrency pair(s) within a provider.

Examples

from openbb import obb
obb.crypto.price.historical(symbol='BTCUSD', provider='fmp')
obb.crypto.price.historical(symbol='BTCUSD', start_date='2024-01-01', end_date='2024-01-31', provider='fmp')
obb.crypto.price.historical(symbol='BTCUSD,ETHUSD', start_date='2024-01-01', end_date='2024-01-31', provider='polygon')
# Get monthly historical prices from Yahoo Finance for Ethereum.
obb.crypto.price.historical(symbol='ETH-USD', interval=1m, start_date='2024-01-01', end_date='2024-12-31', provider='yfinance')

Parameters

symbol: str | list[str]
Symbol to get data for. Multiple items allowed for provider(s): fmp, polygon, tiingo, yfinance.

start_date: date | str
Start date of the data, in YYYY-MM-DD format.

end_date: date | str
End date of the data, in YYYY-MM-DD format.


Returns

results: list[CryptoHistorical]

Serializable results.

provider: Optional[Literal['fmp', 'polygon', 'tiingo', 'yfinance']]

Provider name.

warnings: Optional[list[Warning_]]

list of warnings.

chart: Optional[Chart]

Chart object.

extra: dict[str, Any]

Extra info.


Data

date: Union[Union[date, datetime], str]
The date of the data.

open: float
The open price.

high: float
The high price.

low: float
The low price.

close: float
The close price.

volume: float
The trading volume.

vwap: float
Volume Weighted Average Price over the period.