crypto_listings {crypto2} | R Documentation |
Retrieves name, CMC id, symbol, slug, rank, an activity flag as well as activity dates on CMC for all coins
Description
This code uses the web api. It retrieves listing data (latest/new/historic) and does not require an 'API' key.
Usage
crypto_listings(
which = "latest",
convert = "USD",
limit = 5000,
start_date = NULL,
end_date = NULL,
interval = "day",
quote = FALSE,
sort = "market_cap",
sort_dir = "desc",
sleep = 0,
wait = 60,
finalWait = FALSE
)
Arguments
which |
string Shall the code retrieve the latest listing, the new listings or a historic listing? |
convert |
string (default: USD) to one or more of available fiat or precious metals prices ( |
limit |
integer Return the top n records, default is 5000 (max allowed by CMC) |
start_date |
string Start date to retrieve data from, format 'yyyymmdd' |
end_date |
string End date to retrieve data from, format 'yyyymmdd', if not provided, today will be assumed |
interval |
string Interval with which to sample data according to what |
quote |
logical set to TRUE if you want to include price data (FALSE=default) |
sort |
string use to sort results, possible values: "name", "symbol", "market_cap", "price", "circulating_supply", "total_supply", "max_supply", "num_market_pairs", "volume_24h", "volume_7d", "volume_30d", "percent_change_1h", "percent_change_24h", "percent_change_7d". Especially useful if you only want to download the top x entries using "limit" (deprecated for "new") |
sort_dir |
string used to specify the direction of the sort in "sort". Possible values are "asc" (DEFAULT) and "desc" |
sleep |
integer (default 60) Seconds to sleep between API requests |
wait |
waiting time before retry in case of fail (needs to be larger than 60s in case the server blocks too many attempts, default=60) |
finalWait |
to avoid calling the web-api again with another command before 60s are over (TRUE=default) |
Value
List of latest/new/historic listings of cryptocurrencies in a tibble (depending on the "which"-switch and whether "quote" is requested, the result may only contain some of the following variables):
id |
CMC id (unique identifier) |
name |
Coin name |
symbol |
Coin symbol (not-unique) |
slug |
Coin URL slug (unique) |
date_added |
Date when the coin was added to the dataset |
last_updated |
Last update of the data in the database |
rank |
Current rank on CMC (if still active) |
market_cap |
market cap - close x circulating supply |
market_cap_by_total_supply |
market cap - close x total supply |
market_cap_dominance |
market cap dominance |
fully_diluted_market_cap |
fully diluted market cap |
self_reported_market_cap |
is the source of the market cap self-reported |
self_reported_circulating_supply |
is the source of the circulating supply self-reported |
tvl_ratio |
percentage of total value locked |
price |
latest average price |
circulating_supply |
approx. number of coins in circulation |
total_supply |
approx. total amount of coins in existence right now (minus any coins that have been verifiably burned) |
max_supply |
CMC approx. of max amount of coins that will ever exist in the lifetime of the currency |
num_market_pairs |
number of market pairs across all exchanges this coin |
tvl |
total value locked |
volume_24h |
Volume 24 hours |
volume_change_24h |
Volume change in 24 hours |
percent_change_1h |
1 hour return |
percent_change_24h |
24 hour return |
percent_change_7d |
7 day return |
Examples
## Not run:
# return new listings from the last 30 days
new_listings <- crypto_listings(which="new", quote=FALSE)
new_listings2 <- crypto_listings(which="new", quote=TRUE, convert="BTC,USD")
# return latest listing (last available data of all CC including quotes)
latest_listings <- crypto_listings(which="latest", quote=TRUE)
# return all listings in the first week of January 2014
listings_2014w1 <- crypto_listings(which="historical", quote=TRUE,
start_date = "20140101", end_date="20140107", interval="day")
# report in two different currencies
listings_2014w1_USDBTC <- crypto_listings(which="historical", quote=TRUE,
start_date = "20140101", end_date="20140107", interval="day", convert="USD,BTC")
# only download the top 10 crypto currencies based on their market capitalization
listings_2015w1_mcsort <- crypto_listings(which="historical", quote=TRUE,
start_date = "20150101", end_date="20150107", interval="day", sort="market_cap",
sort_dir="desc", limit=10)
## End(Not run)