Description Usage Arguments Value References See Also Examples
View source: R/get_current_price.R
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.
1 | get_current_price(pair, exchange = "kraken", api_key = NULL, allowance = FALSE)
|
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 |
Current price of a given pair of currencies. If allowance is TRUE
, get_current_price()
returns a list.
See https://docs.cryptowat.ch/rest-api for further information.
get_markets
, get_ohlc
, get_exchanges
, get_pairs
1 2 3 4 5 6 | ## Not run:
# Daily prices of Bitcoin in USD
current.price <- get_current_price("btcusd")
current.prices <- get_current_price()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.