crypto_listings: Retrieves name, CMC id, symbol, slug, rank, an activity flag...

View source: R/crypto_listings.R

crypto_listingsR 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,
  sleep = 0,
  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 (fiat_list()). If more than one are selected please separate by comma (e.g. "USD,BTC"), only necessary if 'quote=TRUE'

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 seq() needs

quote

logical set to TRUE if you want to include price data (FALSE=default)

sleep

integer (default 60) Seconds to sleep between API requests

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")

## End(Not run)


crypto2 documentation built on Oct. 20, 2022, 1:08 a.m.