coin_history_snapshot: History snapshot for a coin

Description Usage Arguments Details Value Examples

View source: R/coin_history_snapshot.R

Description

Coin-specific market data for a given historical date

Usage

1
coin_history_snapshot(coin_id, date, vs_currencies = "usd", max_attempts = 3)

Arguments

coin_id

(character): ID of the coin of interest or a vector with several IDs. The maximum number of coins that can be queried simultaneously is 30. An up-to-date list of supported coins and their IDs can be retrieved with the supported_coins() function.

date

(Date): date of interest. If no data exist for the requested date, nothing (NULL) will be returned.

vs_currencies

(character): a vector with names of the reference currencies to express the price in, e.g. c("usd", "eur", "btc"). An up-to-date list of supported vs_currencies (both fiat and cryptocurrencies) can be obtained with the supported_currencies() function. If vs_currencies contains at least one unsupported currency, the call will fail with the respective error message.

max_attempts

(double, positive): specifies the maximum number of attempts to call the CoinGecko API (e.g., if the first call fails for some reason). Additional attempts are implemented with an exponential backoff. Defaults to 3.

Details

This function is based on the public CoinGecko API, which has a limit of 50 calls per minute. Please keep this limit in mind when developing your applications.

Value

A tibble with the following columns:

Examples

1
2
3
4
5
6
r <- coin_history_snapshot(
  coin_id = "cardano",
  date = as.Date("2021-05-01"),
  vs_currencies = c("usd", "eth")
)
print(r)

geckor documentation built on Nov. 1, 2021, 5:07 p.m.