get_crypto_ohlcv {coinmarketcapr} | R Documentation |
List latest/historical OHLCV values
Description
Return the latest/historical OHLCV (Open, High, Low, Close, Volume) market values for one or more cryptocurrencies for the current UTC day. Since the current UTC day is still active these values are updated frequently. You can find the final calculated OHLCV values for the last completed UTC day along with all historic days using /cryptocurrency/ohlcv/historical.
Usage
get_crypto_ohlcv(
currency = "USD",
latest = TRUE,
symbol = NULL,
id = NULL,
...
)
Arguments
currency |
currency code - Default is 'USD' |
latest |
If 'TRUE' (default), only the latest data is retrieved, otherwise historical data is returned. |
symbol |
One or more cryptocurrency symbols. Example: c("BTC","ETH"). |
id |
Alternatively pass one or more CoinMarketCap cryptocurrency IDs. Example: c(1,2) |
... |
Further arguments passed to the request. Further information can be found in the API documentation |
Value
A dataframe with OHLCV values
Note
One of "id" or "symbol" is required for this request.
References
See Also
Other Cryptocurrencies:
get_crypto_listings()
,
get_crypto_map()
,
get_crypto_marketpairs()
,
get_crypto_meta()
,
get_crypto_quotes()
,
get_marketcap_ticker_all()
,
get_valid_currencies()
Examples
## Not run:
get_crypto_ohlcv("EUR")
get_crypto_ohlcv("EUR", latest = F)
get_crypto_ohlcv("EUR", latest = F, time_period = "hourly",
time_start=Sys.Date()-180, count=5, interval="monthly")
## End(Not run)