
Convert an amount of one cryptocurrency or fiat currency into one or more different currencies utilizing the latest market rate for each currency. You may optionally pass a historical timestamp as time to convert values based on historical rates (as your API plan supports).
get_price_conversion(amount = NULL, id, symbol, time, convert, convert_id)
An amount of currency to convert. Example: 10.43
The CoinMarketCap currency ID of the base cryptocurrency or fiat to convert from.
If id
and symbol
are both missing or NULL, `BTC` is set as default symbol.
Alternatively the currency symbol of the base cryptocurrency or fiat to convert from.
One id
or symbol
is required.
Optional timestamp to reference historical pricing during conversion. If not passed, the current time will be used. If passed, we'll reference the closest historic values available for this conversion.
Pass up to 120 comma-separated fiat or cryptocurrency symbols to convert the source amount to. Default is `USD`.
Optionally calculate market quotes by CoinMarketCap ID instead of symbol. This option is identical to convert outside of ID format. Ex: convert_id=1,2781 would replace convert=BTC,USD in your query. This parameter cannot be used when convert is used.
A dataframe with price conversion information
Cache / Update frequency:Every 60 seconds for the lastest cryptocurrency and fiat currency rates. Plan credit use: 1 call credit per call and 1 call credit per convert option beyond the first. CMC equivalent pages: Our cryptocurrency conversion page at converter.
# NOT RUN {
get_price_conversion(1)
get_price_conversion(amount = 1, symbol = "BTC", convert = c("EUR","LTC","USD"))
get_price_conversion(amount = 1, id=1, time = Sys.Date()-100)
# }
Run the code above in your browser using DataLab