get_trades {cryptowatchR}R Documentation

Get trades of cryptocurrencies


Get data.frame with trades of cryptocurrencies using the REST API of The route is trades and returns trades for a specified market. See for further information.


get_trades(pair, since = NULL, limit = NULL, exchange = "kraken",
           datetime = TRUE, api_key = NULL, allowance = FALSE)



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


An integer if datetime is FALSE and a character string if it is TRUE: Limit the response to trades after this date (optional). This can only be used to filter recent trades. Historical trades cannot be retrieved.


An integer: Limit the number of trades (optional). Max: 1000.


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


A logical. TRUE indicates that datetime type is used. FALSE indicates unix timestamp. Default is TRUE.


A character string containing the API key. See to learn how to create an account and how to generate an API key.


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.


A data.frame containing trades of a given pair of currencies. If allowance is TRUE, get_trades() returns a list.


See for further information.

See Also

get_markets, get_assets, get_exchanges, get_pairs


## Not run: 
# Most recent trades (default is 50)
trades <- get_trades(pair)
# 200 trades (maximum is 1000) since 1589571417 (unix timestamp)
trades.unix <- get_trades(pair, since = 1589571417, limit = 200, datetime = FALSE)
# 1000 trades and datetime is TRUE
trades.datetime <- get_trades(pair, since = "2021-06-01", limit = 1000)

## End(Not run)

[Package cryptowatchR version 0.2.0 Index]