binance_trades

Get aggregated historical trades data for a specified trading pair from the selected reference API.

  • Github function here.

Example: Spot (spot)

Show the code
library(binancer)
library(lubridate)
trades <- binance_trades("BTCUSDT", api = "spot", from = Sys.time() - lubridate::minutes(1)) 

df_trades <- head(trades, n = 5)

Example: USD-m (fapi)

Show the code
library(binancer)
library(lubridate)
trades <- binance_trades("BTCUSDT", api = "fapi", from = Sys.time() - lubridate::minutes(1)) 

df_trades <- head(trades, n = 5)

Example: COIN-m (fapi)

Show the code
library(binancer)
library(lubridate)
trades <- binance_trades("BTCUSD_PERP", api = "dapi", from = Sys.time() - lubridate::minutes(1)) 

df_trades <- head(trades, n = 5)
Back to top

Citation

BibTeX citation:
@online{sartini2024,
  author = {Sartini, Beniamino},
  date = {2024-06-18},
  url = {https://cryptoverser.org/binancer-docs/binance_trades.html},
  langid = {en}
}
For attribution, please cite this work as:
Sartini, Beniamino. 2024. June 18, 2024. https://cryptoverser.org/binancer-docs/binance_trades.html.