get_current_price {cryptowatchR} | R Documentation |
Get current price of cryptocurrencies
Description
Get current price of cryptocurrencies using the REST API of cryptowat.ch. The route is price or prices and returns the current price of a given pair or current prices of all pairs. See https://docs.cryptowat.ch/rest-api/markets/price for further information.
Usage
get_current_price(pair, exchange = "kraken", api_key = NULL, allowance = FALSE)
Arguments
pair |
A string containing a pair symbol, e.g. btcusd (required argument). Run |
exchange |
A string containing the exchange. Default is kraken. Run |
api_key |
A 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 |
Value
Current price of a given pair of currencies. If allowance is TRUE
, get_current_price()
returns a list.
References
See https://docs.cryptowat.ch/rest-api for further information.
See Also
get_markets
, get_ohlc
, get_exchanges
, get_pairs
Examples
## Not run:
# Daily prices of Bitcoin in USD
current.price <- get_current_price("btcusd")
current.prices <- get_current_price()
## End(Not run)