Skip to main content

snapshots

Snapshots of currency exchange rates from an indirect or direct perspective of a base currency.

Examples

from openbb import obb
obb.currency.snapshots(provider='fmp')
# Get exchange rates from USD and XAU to EUR, JPY, and GBP using 'fmp' as provider.
obb.currency.snapshots(provider='fmp', base='USD,XAU', counter_currencies='EUR,JPY,GBP', quote_type='indirect')

Parameters

NameTypeDescriptionDefaultOptional
baseUnion[str, List[str]]The base currency symbol. Multiple items allowed for provider(s): fmp, polygon.usdTrue
quote_typeLiteral['direct', 'indirect']Whether the quote is direct or indirect. Selecting 'direct' will return the exchange rate as the amount of domestic currency required to buy one unit of the foreign currency. Selecting 'indirect' (default) will return the exchange rate as the amount of foreign currency required to buy one unit of the domestic currency.indirectTrue
counter_currenciesUnion[List[str], str]An optional list of counter currency symbols to filter for. None returns all.NoneTrue

Returns

OBBject
results : List[CurrencySnapshots]
Serializable results.

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

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

chart : Optional[Chart]
Chart object.

extra : Dict[str, Any]
Extra info.

Data

NameTypeDescription
base_currencystrThe base, or domestic, currency.
counter_currencystrThe counter, or foreign, currency.
last_ratefloatThe exchange rate, relative to the base currency. Rates are expressed as the amount of foreign currency received from selling one unit of the base currency, or the quantity of foreign currency required to purchase one unit of the domestic currency. To inverse the perspective, set the 'quote_type' parameter as 'direct'.
openfloatThe open price.
highfloatThe high price.
lowfloatThe low price.
closefloatThe close price.
volumeintThe trading volume.
prev_closefloatThe previous close price.