library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="spot", interval ="1d", from =Sys.Date()-5)df_klines <-head(klines, n =5)
Get 1-hour OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="spot", interval ="1h")df_klines <-head(klines, n =5)
Get 1-minutes OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="spot", interval ="1m", from =Sys.Date() -1, to =Sys.time())df_klines <-head(klines, n =5)
Get 1-second OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="spot", interval ="1s", from =Sys.time() -1000, to =Sys.time())df_klines <-head(klines[-1,], n =5)
Examples: Futures USD-m (fapi)
Get 1-day OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="fapi", interval ="1d", from =Sys.Date()-5)df_klines <-head(klines, n =5)
Get 1-hour OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="fapi", interval ="1h")df_klines <-head(klines, n =5)
Get 1-minutes OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSDT", api ="fapi", interval ="1m", from =Sys.Date() -1, to =Sys.time(), quiet =TRUE)df_klines <-head(klines, n =5)
Examples: Futures COIN-m (dapi)
Get 1-day OHLC data for BTCUSDT
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSD_PERP", api ="dapi", interval ="1d", from =Sys.Date()-5)df_klines <-head(klines, n =5)
Get 1-hour OHLC data for BTCUSD_PERP
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSD_PERP", api ="dapi", interval ="1h")df_klines <-head(klines, n =5)
Get 1-minutes OHLC data for BTCUSD_PERP
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTCUSD_PERP", api ="dapi", interval ="1m", from =Sys.Date()-1, to =Sys.time())df_klines <-head(klines, n =5)
Examples: Options (eapi)
BTC-240628-30000-P is a Put contract with strike price 30000 and expiry date on 28-06-2024.
Get 1-day OHLC data for BTC-240628-30000-P
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTC-240628-30000-P", api ="eapi", interval ="1d", from =Sys.Date()-5)df_klines <-head(klines, n =5)
Get 1-hour OHLC data for BTC-240628-30000-P
Show the code
library(binancer)# import depth data from binance klines <-binance_klines(pair ="BTC-240628-30000-P", api ="eapi", interval ="1h")df_klines <-head(klines, n =5)
Get 1-minutes OHLC data for BTC-240628-30000-P
Show the code
# import depth data from binance klines <-binance_klines(pair ="BTC-240628-30000-P", api ="eapi", interval ="1m", from =Sys.Date() -1, to =Sys.time())df_klines <-head(klines, n =5)