Binance Connector JS
    Preparing search index...

    MarketApi - object-oriented interface MarketApi

    Implements

    Index

    Constructors

    Methods

    • Get klines (candlestick bars).

      Klines are uniquely identified by their open & close time.

      If you need access to real-time kline updates, please consider using WebSocket Streams: <symbol>@kline_<interval>

      If you need historical kline data, please consider using data.binance.vision.

      Weight(IP): 2

      Security Type: NONE

      Notes: Data Source:* Database

      Supported kline intervals (case-sensitive):

      Interval interval value
      seconds 1s
      minutes 1m, 3m, 5m, 15m, 30m
      hours 1h, 2h, 4h, 6h, 8h, 12h
      days 1d, 3d
      weeks 1w
      months 1M

      Notes:*

      If startTime and endTime are not sent, the most recent klines are returned. Supported values for timeZone: Hours and minutes (e.g. -1:00, 05:45) Only hours (e.g. 0, 8, 4) Accepted range is strictly [-12:00 to +14:00] inclusive If timeZone provided, kline intervals are interpreted in that timezone instead of UTC. Note that startTime and endTime are always interpreted in UTC, regardless of timeZone.

      Parameters

      Returns Promise<WebsocketApiResponse<SpotWebsocketAPI.KlinesResponse>>

      MarketApi

    • Get rolling window price change statistics with a custom window.

      This request is similar to ticker.24hr but statistics are computed on demand using the arbitrary window you specify.

      Note:* Window size precision is limited to 1 minute. While the closeTime is the current time of the request, openTime always start on a minute boundary. As such, the effective window might be up to 59999 ms wider than the requested windowSize.

      Window computation example

      For example, a request for "windowSize": "7d" might result in the following window:

      {
      "openTime": 1659580020000,
      "closeTime": 1660184865291
      }

      Time of the request – closeTime – is 1660184865291 (August 11, 2022 02:27:45.291). Requested window size should put the openTime 7 days before that – August 4, 02:27:45.291 – but due to limited precision it ends up a bit earlier: 1659580020000 (August 4, 2022 02:27:00), exactly at the start of a minute.

      If you need to continuously monitor trading statistics, please consider using WebSocket Streams: <symbol>@ticker_<window_size> or !ticker_<window-size>@arr

      Weight: Adjusted based on the number of requested symbols:

      Symbols Weight
      1–50 4 per symbol
      51–100 200

      Security Type: NONE

      Notes: Data Source:* Database

      Supported window sizes:

      Unit windowSize value
      minutes 1m, 2m ... 59m
      hours 1h, 2h ... 23h
      days 1d, 2d ... 7d

      Notes:

      Either symbol or symbols must be specified.

      Maximum number of symbols in one request: 200.

      Window size units cannot be combined. E.g., 1d 2h is not supported.

      Parameters

      Returns Promise<WebsocketApiResponse<SpotWebsocketAPI.TickerResponse>>

      MarketApi

    • Get the current best price and quantity on the order book.

      If you need access to real-time order book ticker updates, please consider using WebSocket Streams:

      <symbol>@bookTicker

      Weight: Adjusted based on the number of requested symbols:

      Parameter Symbols Provided Weight
      symbol 1 2
      omitted 4
      symbols Any 4

      Security Type: NONE

      Notes: Data Source:* Memory

      Notes:

      symbol and symbols cannot be used together.

      If no symbol is specified, returns information about all symbols currently trading on the exchange.

      Parameters

      Returns Promise<WebsocketApiResponse<TickerBookResponse>>

      MarketApi

    • Get aggregate trades.

      An aggregate trade (aggtrade) represents one or more individual trades.

      Trades that fill at the same time, from the same taker order, with the same price –

      those trades are collected into an aggregate trade with total quantity of the individual trades.

      If you need access to real-time trading activity, please consider using WebSocket Streams:

      <symbol>@aggTrade

      If you need historical aggregate trade data, please consider using data.binance.vision.

      Weight(IP): 4

      Security Type: NONE

      Notes: Data Source:* Database

      • If fromId is specified, return aggtrades with aggregate trade ID >= fromId. Use fromId and limit to page through all aggtrades.
      • If startTime and/or endTime are specified, aggtrades are filtered by execution time (T). fromId cannot be used together with startTime and endTime.
      • If no condition is specified, the most recent aggregate trades are returned.

      Parameters

      Returns Promise<WebsocketApiResponse<TradesAggregateResponse>>

      MarketApi