Learn R Programming

crypto (version 1.0.3)

getCoins: Get historic crypto currency market data

Description

Scrape the crypto currency historic market tables from CoinMarketCap <https://coinmarketcap.com> and display the results in a date frame. This can be used to conduct analysis on the crypto financial markets or to attempt to predict future market movements or trends.

Usage

getCoins(coin = NULL, limit = NULL, cpu_cores = NULL,
  start_date = NULL, end_date = NULL)

crypto_history(coin = NULL, limit = NULL, cpu_cores = NULL, start_date = NULL, end_date = NULL)

Arguments

coin

string Name, symbol or slug of crypto currency, default is all tokens

limit

integer Return the top n records, default is all tokens

cpu_cores

integer Uses n cores for processing, default uses all cores

start_date

string Start date to retrieve data from, format 'yyyymmdd'

end_date

string End date to retrieve data from, format 'yyyymmdd'

...

No arguments, return all coins

Value

Crypto currency historic OHLC market data in a dataframe:

slug

Coin url slug

symbol

Coin symbol

name

Coin name

date

Market date

ranknow

Current Rank

open

Market open

high

Market high

low

Market low

close

Market close

volume

Volume 24 hours

market

USD Market cap

close_ratio

Close rate, min-maxed with the high and low values that day

spread

Volatility premium, high minus low for that day

This is the main function of the crypto package. If you want to retrieve ALL coins then do not pass a argument to getCoins(), or pass the coin name.

Please note that the doSNOW package is required to load the progress bar on both linux and macOS systems as the doParallel package does not support it.

Examples

Run this code
# NOT RUN {
# retrieving market history for specific crypto currency

coin <- "kin"
kin_coins <- listCoins(coin)

# }
# NOT RUN {
# retrieving market history for ALL crypto currencies

all_coins <- getCoins()

# retrieving this years market history for ALL crypto currencies

all_coins <- getCoins(start_date = '20180101')
# }

Run the code above in your browser using DataLab