View source: R/cc_symbol_price.R
cc_symbol_price | R Documentation |
Get the current price of any cryptocurrency in any other currency that you need.
cc_symbol_price(symbol = NULL,
exchange = NULL,
currency = "USD",
api_key = NULL)
symbol |
Character vector. The cryptocurrency symbol of interest, e.g. |
currency |
Character vector. Currency symbols to convert into, e.g. |
exchange |
Character vector. The exchange to obtain data from.
If |
api_key |
character |
quiet |
Logical. Default is |
If the crypto does not trade directly into the symbol
requested, BTC
will be used for conversion.
If the opposite pair trades we invert it, e.g. BTC-XMR.
Return a tibble
. The number of columns will depends on the lenght of currency
parameter.
There are 3 columns always present:
date
: POSIXt
, time of the snapshot.
exchange
: Character, reference exchange. If exchange
is NULL
will be classified as Global
.
symbol
: Character, tcryptocurrency symbol of interest.
# Mean price for BTCUSD between all the exchanges
cc_symbol_price(symbol = "BTC", exchange = NULL, currency = "USD")
# Mean price for BTCUSD and ETHUSD between all the exchanges
cc_symbol_price(symbol = c("BTC", "ETH"), exchange = NULL, currency = "USD")
# Mean price for BTCUSDT, ETHUSDT on Binance
cc_symbol_price(symbol = c("BTC", "ETH"),
exchange = "Binance",
currency = c("USDT"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.