Learn R Programming

cryptowatchR (version 0.1.0)

get_markets: Get prices for cryptocurrencies

Description

Get price data for cryptocurrencies using the REST API of cryptowat.ch.

Usage

get_markets(pair, params = NULL, exchange = "kraken", route = "ohlc")

Arguments

pair

A string containing a pair symbol, e.g. btcusd (required argument).

params

A list containing before, after and periods (optional). See https://docs.cryptowat.ch/rest-api/markets/ohlc for further information.

exchange

A string containing the exchange. Default is kraken.

route

A string containing market prices. Possible values: price, trades, summary, orderbook, ohlc. Default is ohlc.

Value

data A list containing price data for a given pair of currencies.

References

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

See Also

markets, get_assets, get_exchanges, get_pairs

Examples

Run this code
# NOT RUN {
btcusd.data <- get_markets("btcusd")
btcusd.data2 <- get_markets("btcusd", list(periods = 3600, before = 1609851600,
                                           after = 1609506000))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab