get_markets | R Documentation |
Get prices of cryptocurrencies using the REST API of cryptowat.ch.
get_markets(route, pair = NULL, exchange = NULL, params = NULL, api_key = NULL, allowance = FALSE)
route |
A character string containing a market endpoint. Possible values: price, prices, trades, summary, summaries, orderbook, orderbook/liquidity, orderbooks/calculator, ohlc (required argument). See https://docs.cryptowat.ch/rest-api/markets for further information. |
pair |
A character string containing a pair symbol, e.g. btcusd
(optional argument). Run |
exchange |
A character string containing the exchange (optional argument).
Run |
params |
A list containing query parameters. E.g., for the route
ohlc, this is |
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 list containing markets data.
See https://docs.cryptowat.ch/rest-api for further information
markets
, get_assets
,
get_exchanges
, get_pairs
## Not run: # Prices of Bitcoin in USD for all periods btcusd_ohlc_all <- get_markets(route = "ohlc", pair = "btcusd", exchange = "kraken") # Hourly prices of Bitcoin in USD for a specific time period btcusd_ohlc_hourly <- get_markets(route = "ohlc", pair = "btcusd", exchange = "kraken", list(periods = 3600, before = as.numeric(as.POSIXct(Sys.Date())), after = as.numeric(as.POSIXct(Sys.Date() - 5)))) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.