Binance Connector JS
    Preparing search index...

    Interface MarketApiInterface

    MarketApi - interface MarketApi

    interface MarketApiInterface {
        aggTrades(
            requestParameters: AggTradesRequest,
        ): Promise<RestApiResponse<AggTradesResponse>>;
        avgPrice(
            requestParameters: SpotRestAPI.AvgPriceRequest,
        ): Promise<RestApiResponse<SpotRestAPI.AvgPriceResponse>>;
        depth(
            requestParameters: SpotRestAPI.DepthRequest,
        ): Promise<RestApiResponse<SpotRestAPI.DepthResponse>>;
        getTrades(
            requestParameters: GetTradesRequest,
        ): Promise<RestApiResponse<GetTradesResponse>>;
        historicalBlockTrades(
            requestParameters: HistoricalBlockTradesRequest,
        ): Promise<RestApiResponse<HistoricalBlockTradesResponse>>;
        historicalTrades(
            requestParameters: HistoricalTradesRequest,
        ): Promise<RestApiResponse<HistoricalTradesResponse>>;
        klines(
            requestParameters: SpotRestAPI.KlinesRequest,
        ): Promise<RestApiResponse<SpotRestAPI.KlinesResponse>>;
        referencePrice(
            requestParameters: SpotRestAPI.ReferencePriceRequest,
        ): Promise<RestApiResponse<SpotRestAPI.ReferencePriceResponse>>;
        referencePriceCalculation(
            requestParameters: SpotRestAPI.ReferencePriceCalculationRequest,
        ): Promise<RestApiResponse<SpotRestAPI.ReferencePriceCalculationResponse>>;
        ticker(
            requestParameters?: SpotRestAPI.TickerRequest,
        ): Promise<RestApiResponse<SpotRestAPI.TickerResponse>>;
        ticker24hr(
            requestParameters?: SpotRestAPI.Ticker24hrRequest,
        ): Promise<RestApiResponse<SpotRestAPI.Ticker24hrResponse>>;
        tickerBookTicker(
            requestParameters?: TickerBookTickerRequest,
        ): Promise<RestApiResponse<TickerBookTickerResponse>>;
        tickerPrice(
            requestParameters?: SpotRestAPI.TickerPriceRequest,
        ): Promise<RestApiResponse<SpotRestAPI.TickerPriceResponse>>;
        tickerTradingDay(
            requestParameters?: SpotRestAPI.TickerTradingDayRequest,
        ): Promise<RestApiResponse<SpotRestAPI.TickerTradingDayResponse>>;
        uiKlines(
            requestParameters: SpotRestAPI.UiKlinesRequest,
        ): Promise<RestApiResponse<SpotRestAPI.UiKlinesResponse>>;
    }

    Implemented by

    Index

    Methods

    • Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated.

      Weight(IP): 4

      Security Type: NONE

      Notes: Data Source:* Database

      • If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.

      Parameters

      Returns Promise<RestApiResponse<AggTradesResponse>>

      MarketApiInterface

    • Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

      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<RestApiResponse<SpotRestAPI.KlinesResponse>>

      MarketApiInterface

    • Note: This endpoint differs from GET /api/v3/ticker/24hr.

      The statistical time range of this endpoint can be up to 59999ms longer than the requested windowSize.

      openTime starts at the beginning of a minute, while the end time is the current time. Therefore, the actual interval can be up to 59999ms longer than the requested window.

      For example, if closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) and windowSize is 1d, then openTime is 1641201420000 (January 3, 2022, 09:17:00 UTC).

      Weight: 4 for each requested symbol regardless of windowSize.

      The weight for this request will cap at 200 once the number of symbols in the request is more than 50.

      Security Type: NONE

      Notes: Data Source:* Database

      Parameters

      Returns Promise<RestApiResponse<SpotRestAPI.TickerResponse>>

      MarketApiInterface

    • The request is similar to klines having the same parameters and response.

      uiKlines return modified kline data, optimized for presentation of candlestick charts.

      Weight(IP): 2

      Security Type: NONE

      Notes: Data Source:* Database

      • 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<RestApiResponse<SpotRestAPI.UiKlinesResponse>>

      MarketApiInterface