This page was built without a CoinMarketCap API key, so the code is shown without its results.
The Top 100 and Treemap tabs of the golemcrypto
app show the coins with the largest market cap. In R,
get_listings() downloads them, plot_treemap()
draws the treemap and listings_table() shows the table.
The listings come from the CoinMarketCap API, which needs a free API key. The price charts of Price charts in R and Volatility, drawdowns and seasonality do not need one.
.Renviron file with
usethis::edit_r_environ().COINMARKETCAP_APIKEY=your-api-key
To use a key for the current R session only, set it with
Sys.setenv():
Keep the key out of your scripts and out of Git: anyone who has it can use your API credits.
library(golemcrypto)
listings <- get_listings()
listings$time
head(listings$data$name_symbol, 10)
names(listings$data)listings$data has a row per coin, sorted by market cap,
with the price, the volume, the price changes from 24 hours to 90 days,
the market cap and the dominance, all in US dollars.
listings$time is when it was downloaded.
Each download uses one credit of your key.
get_listings() downloads the listings at most once every 10
minutes, and in between it returns the last download. When a download
fails, listings$problem says why, for example when the key
has used up its credits.
plot_treemap() draws a box per coin, sized by its market
cap and colored from red to green by its price change over 24 hours:
listings_table() shows the listings as a sortable table.
Losses are shaded red and gains green, more strongly the larger the
change:
Like the other charts, plot_treemap() takes
mode = "dark" for a dark page, and
htmlwidgets::saveWidget() saves the treemap or the table as
a web page.