Description Usage Arguments Details Value Examples
Retrieves the most recent exchange tickers for a coin
1 | coin_tickers(coin_id, exchange_id, max_attempts = 3)
|
coin_id |
(character): ID of the coin of interest. An
up-to-date list of supported coins and their IDs can be retrieved
with the |
exchange_id |
(character): ID of the exchange to retrieve the data from.
An up-to-date list of supported exchanges and their IDs can be obtained
with the |
max_attempts |
(double, positive): specifies the maximum number of attempts to call the CoinGecko API (e.g., if the first call fails for some reason). Additional attempts are implemented with an exponential backoff. Defaults to 3. |
This function is based on the public CoinGecko API, which has a limit of 50 calls per minute. Please keep this limit in mind when developing your applications.
A tibble with the following columns:
exchange_id
(character): same as the argument exchange_id
;
exchange_name
(character): common name of the exchange;
coin_id
(character): same as the argument coin_id
;
name
(character): common name of the coin;
base
(character): symbol of the base currency in a trading pair;
target
(character): symbol of the target currency in a trading pair;
trust_score
(character): trust score of the trading pair ("green"
,
"yellow"
, "red"
; see this and
this article on the CoinGecko
website for details);
last_price
(double): last price reported by this exchange for this
trading pair;
last_fetch_at
(POSIXct, UTC time zone): timestamp of when last_price
was recorded;
last_traded_at
(POSIXct, UTC time zone): timestamp of the most recent
trade;
bid_ask_spread_percentage
(double): percentage difference between
the ask price (lowest price a seller is willing to sell for) and the bid price
(highest price a buyer is willing to buy for; see
Investopedia for
details);
trading_volume_24h
(double): trading volume (in target
currency)
recorded in the last 24 h (as of last_traded_at
);
last_price_btc
(double): last price reported by this exchange for this
coin, expressed in Bitcoin;
last_price_eth
(double): last price reported by this exchange for this
coin, expressed in Ethereum;
last_price_usd
(double): last price reported by this exchange for this
coin, expressed in US dollar;
trading_volume_24h_btc
(double): 24 hours trading volume expressed in
Bitcoin (as of last_traded_at
);
trading_volume_24h_eth
(double): 24 hours trading volume expressed in
Ethereum;
trading_volume_24h_usd
(double): 24 hours trading volume expressed in
US dollars;
cost_to_move_up_2percent_usd
and cost_to_move_down_2percent_usd
(double): 2% market depth (see
this article on the CoinGecko
website for details);
is_anomaly
(logical): an indicator of whether the ticker's price is an
outlier (see "Outlier detection" in
Methodology on the GoinGecko
website);
is_stale
(logical): an indicator of whether the ticker's price has not
been updated for a while (see "Outlier detection" in
Methodology on the GoinGecko
website);
trade_url
(character): URL to this trading pair's page.
1 2 | r <- coin_tickers(coin_id = "cardano", exchange_id = "binance")
print(r)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.