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

NameTypeDescriptionDefaultOptional
symbolUnion[str, List[str]]Symbol to get data for. Can use CURR1-CURR2 or CURR1CURR2 format. Multiple items allowed for provider(s): fmp, polygon, tiingo, 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[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

NameTypeDescription
dateUnion[Union[date, datetime], str]The date of the data.
openfloatThe open price.
highfloatThe high price.
lowfloatThe low price.
closefloatThe close price.
volumefloatThe trading volume.
vwapAnnotated[float, Gt(gt=0)]Volume Weighted Average Price over the period.