MarketApi: Market operations

MarketApiR Documentation

Market operations

Description

binanceRapi.Market

Format

An R6Class generator object

Methods

ApiV3AggTradesGet Compressed/Aggregate Trades List Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated. - If `startTime` and `endTime` are sent, time between startTime and endTime must be less than 1 hour. - If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned. Weight(IP): 1

  • @param symbol character

  • @param from.id integer

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @returnType list( aggTrade )

  • status code : 200 | Trade list

  • return type : array[AggTrade]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3AvgPriceGet Current Average Price Current average price for a symbol. Weight(IP): 1

  • @param symbol character

  • @returnType InlineResponse2003

  • status code : 200 | Average price

  • return type : InlineResponse2003

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3DepthGet Order Book | Limit | Weight(IP) | |———————|————-| | 1-100 | 1 | | 101-500 | 5 | | 501-1000 | 10 | | 1001-5000 | 50 |

  • @param symbol character

  • @param limit integer

  • @returnType InlineResponse2002

  • status code : 200 | Order book

  • return type : InlineResponse2002

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3ExchangeInfoGet Exchange Information Current exchange trading rules and symbol information - If any symbol provided in either symbol or symbols do not exist, the endpoint will throw an error. Weight(IP): 10

  • @param symbol character

  • @param symbols character

  • @returnType InlineResponse2001

  • status code : 200 | Current exchange trading rules and symbol information

  • return type : InlineResponse2001

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3HistoricalTradesGet Old Trade Lookup (MARKET_DATA) Get older market trades. Weight(IP): 5

  • @param symbol character

  • @param limit integer

  • @param from.id integer

  • @returnType list( trade )

  • status code : 200 | Trade list

  • return type : array[Trade]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

  • status code : 401 | Unauthorized Request

  • return type : Error

  • response headers :

ApiV3KlinesGet Kline/Candlestick Data Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time. - If `startTime` and `endTime` are not sent, the most recent klines are returned. Weight(IP): 1

  • @param symbol character

  • @param interval Enum < [1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 8h, 12h, 1d, 3d, 1w, 1M] >

  • @param start.time integer

  • @param end.time integer

  • @param limit integer

  • @returnType list( array )

  • status code : 200 | Kline data

  • return type : array[array[OneOflongstring]]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3PingGet Test Connectivity Test connectivity to the Rest API. Weight(IP): 1

  • status code : 200 | OK

  • return type : object

  • response headers :

ApiV3Ticker24hrGet 24hr Ticker Price Change Statistics 24 hour rolling window price change statistics. Careful when accessing this with no symbol. - If the symbol is not sent, tickers for all symbols will be returned in an array. Weight(IP): - &#x60;1&#x60; for a single symbol; - &#x60;40&#x60; when the symbol parameter is omitted;

  • @param symbol character

  • @param symbols character

  • @returnType OneOftickertickerList

  • status code : 200 | 24hr ticker

  • return type : OneOftickertickerList

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3TickerBookTickerGet Symbol Order Book Ticker Best price/qty on the order book for a symbol or symbols. - If the symbol is not sent, bookTickers for all symbols will be returned in an array. Weight(IP): - &#x60;1&#x60; for a single symbol; - &#x60;2&#x60; when the symbol parameter is omitted;

  • @param symbol character

  • @param symbols character

  • @returnType OneOfbookTickerbookTickerList

  • status code : 200 | Order book ticker

  • return type : OneOfbookTickerbookTickerList

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3TickerPriceGet Symbol Price Ticker Latest price for a symbol or symbols. - If the symbol is not sent, prices for all symbols will be returned in an array. Weight(IP): - &#x60;1&#x60; for a single symbol; - &#x60;2&#x60; when the symbol parameter is omitted;

  • @param symbol character

  • @param symbols character

  • @returnType OneOfpriceTickerpriceTickerList

  • status code : 200 | Price ticker

  • return type : OneOfpriceTickerpriceTickerList

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

ApiV3TimeGet Check Server Time Test connectivity to the Rest API and get the current server time. Weight(IP): 1

  • @returnType InlineResponse200

  • status code : 200 | Binance server UTC timestamp

  • return type : InlineResponse200

  • response headers :

ApiV3TradesGet Recent Trades List Get recent trades. Weight(IP): 1

  • @param symbol character

  • @param limit integer

  • @returnType list( trade )

  • status code : 200 | Trade list

  • return type : array[Trade]

  • response headers :

  • status code : 400 | Bad Request

  • return type : Error

  • response headers :

Public fields

apiClient

Handles the client-server communication.

Methods

Public methods


Method new()

Usage
MarketApi$new(apiClient)

Method ApiV3AggTradesGet()

Usage
MarketApi$ApiV3AggTradesGet(
  symbol,
  from.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  ...
)

Method ApiV3AggTradesGetWithHttpInfo()

Usage
MarketApi$ApiV3AggTradesGetWithHttpInfo(
  symbol,
  from.id = NULL,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  ...
)

Method ApiV3AvgPriceGet()

Usage
MarketApi$ApiV3AvgPriceGet(symbol, ...)

Method ApiV3AvgPriceGetWithHttpInfo()

Usage
MarketApi$ApiV3AvgPriceGetWithHttpInfo(symbol, ...)

Method ApiV3DepthGet()

Usage
MarketApi$ApiV3DepthGet(symbol, limit = 100, ...)

Method ApiV3DepthGetWithHttpInfo()

Usage
MarketApi$ApiV3DepthGetWithHttpInfo(symbol, limit = 100, ...)

Method ApiV3ExchangeInfoGet()

Usage
MarketApi$ApiV3ExchangeInfoGet(symbol = NULL, symbols = NULL, ...)

Method ApiV3ExchangeInfoGetWithHttpInfo()

Usage
MarketApi$ApiV3ExchangeInfoGetWithHttpInfo(symbol = NULL, symbols = NULL, ...)

Method ApiV3HistoricalTradesGet()

Usage
MarketApi$ApiV3HistoricalTradesGet(symbol, limit = NULL, from.id = NULL, ...)

Method ApiV3HistoricalTradesGetWithHttpInfo()

Usage
MarketApi$ApiV3HistoricalTradesGetWithHttpInfo(
  symbol,
  limit = NULL,
  from.id = NULL,
  ...
)

Method ApiV3KlinesGet()

Usage
MarketApi$ApiV3KlinesGet(
  symbol,
  interval,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  ...
)

Method ApiV3KlinesGetWithHttpInfo()

Usage
MarketApi$ApiV3KlinesGetWithHttpInfo(
  symbol,
  interval,
  start.time = NULL,
  end.time = NULL,
  limit = NULL,
  ...
)

Method ApiV3PingGet()

Usage
MarketApi$ApiV3PingGet(...)

Method ApiV3PingGetWithHttpInfo()

Usage
MarketApi$ApiV3PingGetWithHttpInfo(...)

Method ApiV3Ticker24hrGet()

Usage
MarketApi$ApiV3Ticker24hrGet(symbol = NULL, symbols = NULL, ...)

Method ApiV3Ticker24hrGetWithHttpInfo()

Usage
MarketApi$ApiV3Ticker24hrGetWithHttpInfo(symbol = NULL, symbols = NULL, ...)

Method ApiV3TickerBookTickerGet()

Usage
MarketApi$ApiV3TickerBookTickerGet(symbol = NULL, symbols = NULL, ...)

Method ApiV3TickerBookTickerGetWithHttpInfo()

Usage
MarketApi$ApiV3TickerBookTickerGetWithHttpInfo(
  symbol = NULL,
  symbols = NULL,
  ...
)

Method ApiV3TickerPriceGet()

Usage
MarketApi$ApiV3TickerPriceGet(symbol = NULL, symbols = NULL, ...)

Method ApiV3TickerPriceGetWithHttpInfo()

Usage
MarketApi$ApiV3TickerPriceGetWithHttpInfo(symbol = NULL, symbols = NULL, ...)

Method ApiV3TimeGet()

Usage
MarketApi$ApiV3TimeGet(...)

Method ApiV3TimeGetWithHttpInfo()

Usage
MarketApi$ApiV3TimeGetWithHttpInfo(...)

Method ApiV3TradesGet()

Usage
MarketApi$ApiV3TradesGet(symbol, limit = NULL, ...)

Method ApiV3TradesGetWithHttpInfo()

Usage
MarketApi$ApiV3TradesGetWithHttpInfo(symbol, limit = NULL, ...)

Method clone()

The objects of this class are cloneable with this method.

Usage
MarketApi$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

## Not run: 
####################  ApiV3AggTradesGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.from.id <- 56 # integer | Trade id to fetch from. Default gets most recent trades.
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 500 # integer | Default 500; max 1000.

#Compressed/Aggregate Trades List
api.instance <- MarketApi$new()

result <- api.instance$ApiV3AggTradesGet(var.symbol, from.id=var.from.id, start.time=var.start.time, end.time=var.end.time, limit=var.limit)


####################  ApiV3AvgPriceGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT

#Current Average Price
api.instance <- MarketApi$new()

result <- api.instance$ApiV3AvgPriceGet(var.symbol)


####################  ApiV3DepthGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.limit <- 100 # integer | If limit > 5000, then the response will truncate to 5000

#Order Book
api.instance <- MarketApi$new()

result <- api.instance$ApiV3DepthGet(var.symbol, limit=var.limit)


####################  ApiV3ExchangeInfoGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.symbols <- '[\"BTCUSDT\",\"BNBBTC\"]' # character | 

#Exchange Information
api.instance <- MarketApi$new()

result <- api.instance$ApiV3ExchangeInfoGet(symbol=var.symbol, symbols=var.symbols)


####################  ApiV3HistoricalTradesGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.limit <- 500 # integer | Default 500; max 1000.
var.from.id <- 56 # integer | Trade id to fetch from. Default gets most recent trades.

#Old Trade Lookup  (MARKET_DATA)
api.instance <- MarketApi$new()

result <- api.instance$ApiV3HistoricalTradesGet(var.symbol, limit=var.limit, from.id=var.from.id)


####################  ApiV3KlinesGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.interval <- 'interval_example' # character | kline intervals
var.start.time <- 56 # integer | UTC timestamp in ms
var.end.time <- 56 # integer | UTC timestamp in ms
var.limit <- 500 # integer | Default 500; max 1000.

#Kline/Candlestick Data
api.instance <- MarketApi$new()

result <- api.instance$ApiV3KlinesGet(var.symbol, var.interval, start.time=var.start.time, end.time=var.end.time, limit=var.limit)


####################  ApiV3PingGet  ####################

library(binanceRapi)

#Test Connectivity
api.instance <- MarketApi$new()

result <- api.instance$ApiV3PingGet()


####################  ApiV3Ticker24hrGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.symbols <- '[\"BTCUSDT\",\"BNBBTC\"]' # character | 

#24hr Ticker Price Change Statistics
api.instance <- MarketApi$new()

result <- api.instance$ApiV3Ticker24hrGet(symbol=var.symbol, symbols=var.symbols)


####################  ApiV3TickerBookTickerGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.symbols <- '[\"BTCUSDT\",\"BNBBTC\"]' # character | 

#Symbol Order Book Ticker
api.instance <- MarketApi$new()

result <- api.instance$ApiV3TickerBookTickerGet(symbol=var.symbol, symbols=var.symbols)


####################  ApiV3TickerPriceGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.symbols <- '[\"BTCUSDT\",\"BNBBTC\"]' # character | 

#Symbol Price Ticker
api.instance <- MarketApi$new()

result <- api.instance$ApiV3TickerPriceGet(symbol=var.symbol, symbols=var.symbols)


####################  ApiV3TimeGet  ####################

library(binanceRapi)

#Check Server Time
api.instance <- MarketApi$new()

result <- api.instance$ApiV3TimeGet()


####################  ApiV3TradesGet  ####################

library(binanceRapi)
var.symbol <- 'BNBUSDT' # character | Trading symbol, e.g. BNBUSDT
var.limit <- 500 # integer | Default 500; max 1000.

#Recent Trades List
api.instance <- MarketApi$new()

result <- api.instance$ApiV3TradesGet(var.symbol, limit=var.limit)



## End(Not run)

grahamjwhite/binanceRapi documentation built on Nov. 22, 2022, 9:37 p.m.