Retrieves top-7 coins on CoinGecko according to their search popularity
trending_coins(max_attempts = 3)
(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.
If the API call succeeds, the function returns a tibble with the following columns:
timestamp
(POSIXct): date and time of the API request;
popularity_rank_24h
(integer): popularity rank in the last 24 hours;
coin_id
(character): coin ID;
name
(character): common name of the coin;
symbol
(character): symbol of the coin;
market_cap_rank
(integer): market capitalisation rank;
price_btc
(double): price expressed in Bitcoin.
Popularity of a coin is determined from search patterns at the CoinGecko website over the last 24 hours.
This function is based on the public CoinGecko API, which has a rate limit of 10-30 calls per minute. Please keep this limit in mind when developing your applications.
r <- trending_coins()
print(r)
#> # A tibble: 7 × 7
#> timestamp popularity_rank_24h coin_id name symbol market_cap_rank
#> <dttm> <int> <chr> <chr> <chr> <int>
#> 1 2023-03-28 19:30:59 1 arbitrum Arbi… ARB 40
#> 2 2023-03-28 19:30:59 2 insure inSu… SURE 175
#> 3 2023-03-28 19:30:59 3 zigzag-2 ZigZ… ZZ 684
#> 4 2023-03-28 19:30:59 4 flare-ne… Flare FLR 87
#> 5 2023-03-28 19:30:59 5 joe JOE JOE 204
#> 6 2023-03-28 19:30:59 6 space-id SPAC… ID 244
#> 7 2023-03-28 19:30:59 7 ethereum Ethe… ETH 2
#> # ℹ 1 more variable: price_btc <dbl>