Description Usage Arguments Value References See Also Examples
Get data.frame with prices of cryptocurrencies using the REST API of cryptowat.ch. The route is ohlc and returns OHLC candlestick prices. The default is daily prices but can be changed with periods
. See https://docs.cryptowat.ch/rest-api/markets/ohlc for further information.
1 2 |
pair |
A character string containing a pair symbol, e.g. btcusd (required argument). Run |
before |
An integer if datetime is |
after |
An integer if datetime is |
periods |
A integer or integer vector. Only return these periods. Periods are measured in seconds (optional). Examples: 60, 180, 108000. |
exchange |
A character string containing the exchange. Default is kraken. Run |
datetime |
A logical. |
api_key |
A character string containing the API key. See https://docs.cryptowat.ch/rest-api/rate-limit to learn how to create an account and how to generate an API key. |
allowance |
A logical (default is |
A data.frame containing OHLC candlestick prices of a given pair of currencies. If allowance is TRUE
, get_ohlc()
returns a list.
See https://docs.cryptowat.ch/rest-api for further information.
get_markets
, get_assets
, get_exchanges
, get_pairs
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# Daily prices of Bitcoin in USD
df.ohlc <- get_ohlc("btcusd")
# Hourly prices of Bitcoin in USD for a specific time period
df.ohlc.hourly <- get_ohlc("btcusd", periods = 3600, before = 1609851600,
after = 1609506000, datetime = FALSE)
# Daily prices of Bitcoin in Euro for a specific time period
df.ohlc.daily <- get_ohlc("btceur", periods = 86400, before = "2021-05-12",
after = "2021-01-01", datetime = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.