Learn R Programming

cryptowatchR (version 0.2.0)

get_summary: Get 24-hour summary of cryptocurrencies

Description

Get 24-hour summary of cryptocurrencies using the REST API of cryptowat.ch. The route is summary or summaries and returns the current 24-hour summary of a given pair or a summary of all pairs. See https://docs.cryptowat.ch/rest-api/markets/summary for further information.

Usage

get_summary(pair, keyBy = NULL, exchange = "kraken", api_key = NULL, allowance = FALSE)

Arguments

pair

A character string containing a pair symbol, e.g. btcusd (required argument). Run get_pairs() to find other available pairs.

keyBy

A single character string. Possible values are are either id or symbols.

exchange

A character string containing the exchange. Default is kraken. Run get_exchanges() to find other available exchanges.

api_key

A character string containing the API key. See https://docs.cryptowat.ch/rest-api/rate-limit to learn how to create an account and how to generate an API key.

allowance

A logical (default is FALSE). If TRUE the function returns a list which includes allowance information, i.e. cost of the request, remaining credits and your account name.

Value

Current 24-hour summary of a given pair of currencies. If allowance is TRUE, get_summary() returns a list with additional information on allowances.

References

See https://docs.cryptowat.ch/rest-api for further information.

See Also

get_markets, get_current_price, get_exchanges, get_pairs

Examples

Run this code
# NOT RUN {
# 24h-hour summary of cryptocurrency pairs
summary <- get_summary("btcusd")
summaries <- get_summary()
summaries2 <- get_summary(keyBy = "id")
summaries3 <- get_summary(keyBy = "symbols")
# }

Run the code above in your browser using DataLab