Binance JavaScript SDK

Installation and integration guidance for the Binance SDK in JavaScript.

JavaScript SDK Usage

Use framework-neutral JavaScript request and event flows across Node.js-compatible runtimes.

In JavaScript, use the package directly from readable examples. TypeScript remains useful for larger integrations, but the same client patterns work in plain JavaScript.

What This SDK Covers

  • Complete Binance REST API integrations for exchange-specific workflows.
  • Robust Binance WebSocket support for market and account stream handling.
  • JavaScript-friendly usage patterns for production integration work.
  • Adaptable JavaScript examples & guides under /examples for implementation reference.
  • Framework-neutral JavaScript snippets that stay approachable in all JavaScript runtimes.

Install Package

npm install binance
# or
pnpm install binance
yarn add binance

Quickstart REST API Walkthrough

Using Binance's USD-M Futures REST APIs in JavaScript is easy!

  • Install the Binance JavaScript SDK via NPM: npm install binance.
  • Import the USDMClient (REST API wrapper for Binance USD-M Futures APIs).
  • If Spot or Margin is preferred, use the MainClient instead.
  • Create an instance with your API credentials.
  • Call the desired REST API methods as functions and await the promise containing the response.

In this example, we:

  • Create an authenticated USD-M Futures REST client.
  • Submit a new market order for BTCUSDT using submitNewOrder().
  • Log the order response returned by Binance.

For a full map of available REST API methods, check out the endpoint reference below.

Quickstart REST API Example

404: Not Found

Quickstart WebSocket Walkthrough

Connecting to Binance's WebSocket streams is straightforward with the WebsocketClient.

  • Import the WebsocketClient (General WebSocket wrapper for all available Binance WebSocket streams)
  • Create an instance of the WebsocketClient (API credentials not required unless you want to consume private topics).
  • Configure event handlers for the emitted events you are interested in. The minimum recommended handlers are 'exception', 'message' and 'reconnected'. The latter informs you if a connection dropped and was successfully re-established by the client.
  • Call the subscribe method for the desired channels and handle incoming events.

In this example, we:

  • Subscribe to the spot trades streams for 3 symbols.
  • Log incoming messages to the console for demonstration purposes.
  • Use the "formattedMessage" event handler to log a more readable version of the incoming trade data (available thanks to the "beautify: true" configuration).

This setup allows you to receive real-time updates on market activity, a much faster alternative to polling REST endpoints for the same data.

Quickstart WebSocket Example

import { DefaultLogger, isWsFormattedTrade, WebsocketClient } from 'binance';

(async () => {
  const logger = {
    ...DefaultLogger,
    // trace: () => {},
  };

  const wsClient = new WebsocketClient(
    {
      beautify: true,
    },
    logger,
  );

  wsClient.on('formattedMessage', (data) => {
    if (isWsFormattedTrade(data)) {
      console.log('trade event ', data);
      return;
    }

    console.log('log formattedMessage: ', data);
  });

  wsClient.on('open', (data) => {
    console.log('connection opened open:', data.wsKey, data.wsUrl);
  });
  wsClient.on('response', (data) => {
    console.log('log response: ', JSON.stringify(data, null, 2));
  });
  wsClient.on('reconnecting', (data) => {
    console.log('ws automatically reconnecting.... ', data?.wsKey);
  });
  wsClient.on('reconnected', (data) => {
    console.log('ws has reconnected ', data?.wsKey);
  });

  // Request subscription to the following symbol trade events:
  const symbols = ['BTCUSDT', 'ETHUSDT', 'BNBUSDT'];

  // Loop through symbols
  for (const symbol of symbols) {
    console.log('subscribing to trades for: ', symbol);
    wsClient.subscribeSpotTrades(symbol);
  }
})();

Quickstart WebSocket API Walkthrough

Binance's WebSocket API (WS-API) is a powerful tool to send commands over a persisted and pre-authenticated WebSocket connection, allowing for lower latency interactions with the exchange compared to REST API calls.

The WS-API supports a wide range of commands, including order submission and cancellation, making it ideal for latency sensitive integrations.

To use the WebSocket API:

  • Import the WebsocketAPIClient (a specialised wrapper around the WebsocketClient)
  • Create an instance of the WebsocketAPIClient with credentials.
  • Note: Ed25519 keys are required for the maximum speed benefit.
  • HMAC & RSA credentials are supported, but will require each request to be individually signed.
  • Call the dedicated functions to send WS-API commands and await the responses.

Authentication is automatic. Connectivity is persistent with automatic failover. All WS-API commands are wrapped in promises, allowing you to await individual Websocket API commands as if it were a REST API call.

Quickstart WebSocket API Example

/* eslint-disable @typescript-eslint/no-unused-vars */

// or

import { DefaultLogger, WebsocketAPIClient } from 'binance';

/**
 * Note: the WebSocket API is fastest with Ed25519 keys. HMAC & RSA will
 * require each command to be individually signed.
 *
 * Check the rest-private-ed25519.md in this folder for more guidance
 * on preparing this Ed25519 API key.
 */

const publicKey = `-----BEGIN PUBLIC KEY-----
MCexampleQTxwLU9o=
-----END PUBLIC KEY-----
`;

const privateKey = `-----BEGIN PRIVATE KEY-----
MC4CAQAexamplewqj5CzUuTy1
-----END PRIVATE KEY-----
`;

const key = process.env.API_KEY_COM;
const secret = process.env.API_SECRET_COM;

// returned by binance, generated using the publicKey (above)
// const key = 'BVv39ATnIme5TTZRcC3I04C3FqLVM7vCw3Hf7mMT7uu61nEZK8xV1V5dmhf9kifm';
// Your Ed25519 private key is passed as the "secret"
// const secret = privateKey;

// function attachEventHandlers<TWSClient extends WebsocketClient>(
//   wsClient: TWSClient,
// ): void {
//   /**
//    * General event handlers for monitoring the WebsocketClient
//    */
//   wsClient.on('message', (data) => {
//     // console.log('raw message received ', JSON.stringify(data));
//   });
//   wsClient.on('response', (data) => {
//     // console.log('ws response: ', JSON.stringify(data));
//   });
//   wsClient.on('open', (data) => {
//     console.log('ws connected', data.wsKey);
//   });
//   wsClient.on('reconnecting', ({ wsKey }) => {
//     console.log('ws automatically reconnecting.... ', wsKey);
//   });
//   wsClient.on('reconnected', (data) => {
//     console.log('ws has reconnected ', data?.wsKey);
//   });
//   wsClient.on('authenticated', (data) => {
//     console.log('ws has authenticated ', data?.wsKey);
//   });
//   wsClient.on('exception', (data) => {
//     console.error('ws exception: ', JSON.stringify(data));
//   });
// }

async function main() {
  const customLogger = {
    ...DefaultLogger,
    // For a more detailed view of the WebsocketClient, enable the `trace` level by uncommenting the below line:
    // trace: (...params) => console.log(new Date(), 'trace', ...params),
  };

  const wsClient = new WebsocketAPIClient(
    {
      api_key: key,
      api_secret: secret,
      beautify: true,

      // Enforce testnet ws connections, regardless of supplied wsKey
      // testnet: true,

      // Note: unless you set this to false, the SDK will automatically call
      // the `subscribeUserDataStream()` method again if reconnected (if you called it before):
      // resubscribeUserDataStreamAfterReconnect: true,

      // If you want your own event handlers instead of the default ones with logs, disable this setting and see the `attachEventHandlers` example below:
      // attachEventListeners: false
    },
    customLogger,
  );

  // Optional, attach basic event handlers, so nothing is left unhandled
  // attachEventHandlers(wsClient.getWSClient());

  // Optional, if you see RECV Window errors, you can use this to manage time issues.
  // ! However, make sure you sync your system clock first!
  // https://github.com/tiagosiebler/awesome-crypto-examples/wiki/Timestamp-for-this-request-is-outside-of-the-recvWindow
  // wsClient.setTimeOffsetMs(-5000);

  // Optional. Can be used to prepare a connection before sending commands.
  // Can be done as part of a bootstrapping workflow, to reduce initial latency when sending the first command
  // await wsClient.getWSClient().connectWSAPI(WS_KEY_MAP.mainWSAPI);

  try {
    const response = await wsClient.getSpotSessionStatus();
    console.log('getSessionStatus response: ', response);
  } catch (e) {
    console.log('getSessionStatus error: ', e);
  }

  try {
    const response = await wsClient.getSpotServerTime();
    console.log('getSpotServerTime response: ', response);
  } catch (e) {
    console.log('getSpotServerTime error: ', e);
  }

  try {
    const response = await wsClient.getSpotExchangeInfo();
    console.log('getSpotExchangeInfo response: ', response);
  } catch (e) {
    console.log('getSpotExchangeInfo error: ', e);
  }

  try {
    const response = await wsClient.getSpotOrderBook({ symbol: 'BTCUSDT' });
    console.log('getSpotOrderBook response: ', response);
  } catch (e) {
    console.log('getSpotOrderBook error: ', e);
  }

  try {
    const response = await wsClient.getSpotHistoricalTrades({
      symbol: 'BTCUSDT',
      fromId: 0,
      limit: 1,
    });
    console.log('getSpotHistoricalTrades response: ', response);
  } catch (e) {
    console.log('getSpotHistoricalTrades error: ', e);
  }

  // SPOT - Market data requests
  try {
    const response = await wsClient.getSpotRecentTrades({
      symbol: 'BTCUSDT',
      limit: 1,
    });
    console.log('getSpotRecentTrades response: ', response);
  } catch (e) {
    console.log('getSpotRecentTrades error: ', e);
  }

  try {
    const response = await wsClient.getSpotAggregateTrades({
      symbol: 'BNBBTC',
      fromId: 50000000,
      limit: 1,
    });
    console.log('getSpotAggregateTrades response: ', response);
  } catch (e) {
    console.log('getSpotAggregateTrades error: ', e);
  }

  try {
    const response = await wsClient.getSpotKlines({
      symbol: 'BNBBTC',
      interval: '1h',
      startTime: 1655969280000,
      limit: 1,
    });
    console.log('getSpotKlines response: ', response);
  } catch (e) {
    console.log('getSpotKlines error: ', e);
  }

  try {
    const response = await wsClient.getSpotUIKlines({
      symbol: 'BNBBTC',
      interval: '1h',
      startTime: 1655969280000,
      limit: 1,
    });
    console.log('getSpotUIKlines response: ', response);
  } catch (e) {
    console.log('getSpotUIKlines error: ', e);
  }

  try {
    const response = await wsClient.getSpotAveragePrice({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotAveragePrice response: ', response);
  } catch (e) {
    console.log('getSpotAveragePrice error: ', e);
  }

  try {
    const response = await wsClient.getSpot24hrTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getSpot24hrTicker response: ', response);
  } catch (e) {
    console.log('getSpot24hrTicker error: ', e);
  }

  try {
    const response = await wsClient.getSpotTradingDayTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotTradingDayTicker response: ', response);
  } catch (e) {
    console.log('getSpotTradingDayTicker error: ', e);
  }

  try {
    const response = await wsClient.getSpotTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotTicker response: ', response);
  } catch (e) {
    console.log('getSpotTicker error: ', e);
  }

  try {
    const response = await wsClient.getSpotSymbolPriceTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotSymbolPriceTicker response: ', response);
  } catch (e) {
    console.log('getSpotSymbolPriceTicker error: ', e);
  }

  try {
    const response = await wsClient.getSpotSymbolOrderBookTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotSymbolOrderBookTicker response: ', response);
  } catch (e) {
    console.log('getSpotSymbolOrderBookTicker error: ', e);
  }

  // SPOT - Trading requests
  try {
    const response = await wsClient.submitNewSpotOrder({
      symbol: 'BTCUSDT',
      side: 'SELL',
      type: 'LIMIT',
      timeInForce: 'GTC',
      price: '23416.10000000',
      quantity: '0.00847000',
    });
    console.log('submitNewSpotOrder response: ', response);
  } catch (e) {
    console.log('submitNewSpotOrder error: ', e);
  }

  try {
    const response = await wsClient.testSpotOrder({
      symbol: 'BTCUSDT',
      side: 'SELL',
      type: 'LIMIT',
      timeInForce: 'GTC',
      price: '23416.1',
      quantity: '0.001',
      timestamp: Date.now(),
    });
    console.log('testSpotOrder response: ', response);
  } catch (e) {
    console.log('testSpotOrder error: ', e);
  }

  try {
    const response = await wsClient.getSpotOrderStatus({
      symbol: 'BTCUSDT',
      orderId: 12345678,
      timestamp: Date.now(),
    });
    console.log('getSpotOrderStatus response: ', response);
  } catch (e) {
    console.log('getSpotOrderStatus error: ', e);
  }

  try {
    const response = await wsClient.cancelSpotOrder({
      symbol: 'BTCUSDT',
      orderId: 12345678,
      timestamp: Date.now(),
    });
    console.log('cancelSpotOrder response: ', response);
  } catch (e) {
    console.log('cancelSpotOrder error: ', e);
  }

  try {
    const response = await wsClient.cancelReplaceSpotOrder({
      symbol: 'BTCUSDT',
      cancelReplaceMode: 'ALLOW_FAILURE',
      cancelOrigClientOrderId: '4d96324ff9d44481926157',
      side: 'SELL',
      type: 'LIMIT',
      timeInForce: 'GTC',
      price: '23416.10000000',
      quantity: '0.00847000',
      timestamp: Date.now(),
    });
    console.log('cancelReplaceSpotOrder response: ', response);
  } catch (e) {
    console.log('cancelReplaceSpotOrder error: ', e);
  }

  try {
    const response = await wsClient.amendSpotOrderKeepPriority({
      newQty: '5',
      origClientOrderId: 'my_test_order1',
      recvWindow: 5000,
      symbol: 'BTCUSDT',
      timestamp: Date.now(),
    });
    console.log('amendSpotOrderKeepPriority response: ', response);
  } catch (e) {
    console.log('amendSpotOrderKeepPriority error: ', e);
  }

  try {
    const response = await wsClient.getSpotOpenOrders({
      symbol: 'BTCUSDT',
      timestamp: Date.now(),
    });
    console.log('getSpotOpenOrders response: ', response);
  } catch (e) {
    console.log('getSpotOpenOrders error: ', e);
  }

  try {
    const response = await wsClient.cancelAllSpotOpenOrders({
      symbol: 'BTCUSDT',
      timestamp: Date.now(),
    });
    console.log('cancelAllSpotOpenOrders response: ', response);
  } catch (e) {
    console.log('cancelAllSpotOpenOrders error: ', e);
  }

  try {
    const response = await wsClient.placeSpotOrderList({
      symbol: 'BTCUSDT',
      side: 'SELL',
      price: '23420.00000000',
      quantity: '0.00650000',
      stopPrice: '23410.00000000',
      stopLimitPrice: '23405.00000000',
      stopLimitTimeInForce: 'GTC',
      newOrderRespType: 'RESULT',
      timestamp: Date.now(),
    });
    console.log('placeSpotOrderList response: ', response);
  } catch (e) {
    console.log('placeSpotOrderList error: ', e);
  }

  try {
    const response = await wsClient.placeSpotOCOOrderList({
      symbol: 'LTCBNB',
      side: 'BUY',
      quantity: 1,
      timestamp: 1711062760647,
      aboveType: 'STOP_LOSS_LIMIT',
      abovePrice: '1.5',
      aboveStopPrice: '1.50000001',
      aboveTimeInForce: 'GTC',
      belowType: 'LIMIT_MAKER',
      belowPrice: '1.49999999',
    });
    console.log('placeSpotOCOOrderList response: ', response);
  } catch (e) {
    console.log('placeSpotOCOOrderList error: ', e);
  }

  try {
    const response = await wsClient.placeSpotOTOOrderList({
      pendingQuantity: 1,
      pendingSide: 'BUY',
      pendingType: 'MARKET',
      symbol: 'LTCBNB',
      recvWindow: 5000,
      timestamp: 1712544395951,
      workingPrice: 1,
      workingQuantity: 1,
      workingSide: 'SELL',
      workingTimeInForce: 'GTC',
      workingType: 'LIMIT',
    });
    console.log('placeSpotOTOOrderList response: ', response);
  } catch (e) {
    console.log('placeSpotOTOOrderList error: ', e);
  }

  try {
    const response = await wsClient.placeSpotOTOCOOrderList({
      pendingQuantity: 5,
      pendingSide: 'SELL',
      pendingBelowPrice: 5,
      pendingBelowType: 'LIMIT_MAKER',
      pendingAboveStopPrice: 0.5,
      pendingAboveType: 'STOP_LOSS',
      symbol: 'LTCBNB',
      recvWindow: 5000,
      timestamp: Date.now(),
      workingPrice: 1.5,
      workingQuantity: 1,
      workingSide: 'BUY',
      workingTimeInForce: 'GTC',
      workingType: 'LIMIT',
    });
    console.log('placeSpotOTOCOOrderList response: ', response);
  } catch (e) {
    console.log('placeSpotOTOCOOrderList error: ', e);
  }

  try {
    const response = await wsClient.getSpotOrderListStatus({
      orderListId: 12345678,
      timestamp: Date.now(),
    });
    console.log('getSpotOrderListStatus response: ', response);
  } catch (e) {
    console.log('getSpotOrderListStatus error: ', e);
  }

  try {
    const response = await wsClient.cancelSpotOrderList({
      symbol: 'BTCUSDT',
      orderListId: 1274512,
      timestamp: Date.now(),
    });
    console.log('cancelSpotOrderList response: ', response);
  } catch (e) {
    console.log('cancelSpotOrderList error: ', e);
  }

  try {
    const response = await wsClient.getSpotOpenOrderLists({
      timestamp: Date.now(),
    });
    console.log('getSpotOpenOrderLists response: ', response);
  } catch (e) {
    console.log('getSpotOpenOrderLists error: ', e);
  }

  try {
    const response = await wsClient.placeSpotSOROrder({
      symbol: 'BTCUSDT',
      side: 'BUY',
      type: 'LIMIT',
      quantity: 0.5,
      timeInForce: 'GTC',
      price: 31000,
      timestamp: Date.now(),
    });
    console.log('placeSpotSOROrder response: ', response);
  } catch (e) {
    console.log('placeSpotSOROrder error: ', e);
  }

  try {
    const response = await wsClient.testSpotSOROrder({
      symbol: 'BTCUSDT',
      side: 'BUY',
      type: 'LIMIT',
      quantity: 0.1,
      timeInForce: 'GTC',
      price: 0.1,
      timestamp: Date.now(),
    });
    console.log('testSpotSOROrder response: ', response);
  } catch (e) {
    console.log('testSpotSOROrder error: ', e);
  }

  // SPOT - Account requests
  try {
    const response = await wsClient.getSpotAccountInformation({
      timestamp: Date.now(),
    });
    console.log('getSpotAccountInformation response: ', response);
  } catch (e) {
    console.log('getSpotAccountInformation error: ', e);
  }

  try {
    const response = await wsClient.getSpotOrderRateLimits({
      timestamp: Date.now(),
    });
    console.log('getSpotOrderRateLimits response: ', response);
  } catch (e) {
    console.log('getSpotOrderRateLimits error: ', e);
  }

  try {
    const response = await wsClient.getSpotAllOrders({
      symbol: 'BTCUSDT',
      limit: 10,
    });
    console.log('getSpotAllOrders response: ', response);
  } catch (e) {
    console.log('getSpotAllOrders error: ', e);
  }

  try {
    const response = await wsClient.getSpotAllOrderLists({
      limit: 10,
    });
    console.log('getSpotAllOrderLists response: ', response);
  } catch (e) {
    console.log('getSpotAllOrderLists error: ', e);
  }

  try {
    const response = await wsClient.getSpotMyTrades({
      symbol: 'BTCUSDT',
      limit: 10,
    });
    console.log('getSpotMyTrades response: ', response);
  } catch (e) {
    console.log('getSpotMyTrades error: ', e);
  }

  try {
    const response = await wsClient.getSpotPreventedMatches({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotPreventedMatches response: ', response);
  } catch (e) {
    console.log('getSpotPreventedMatches error: ', e);
  }

  try {
    const response = await wsClient.getSpotAllocations({
      symbol: 'BTCUSDT',
      orderId: 12345678,
    });
    console.log('getSpotAllocations response: ', response);
  } catch (e) {
    console.log('getSpotAllocations error: ', e);
  }

  try {
    const response = await wsClient.getSpotAccountCommission({
      symbol: 'BTCUSDT',
    });
    console.log('getSpotAccountCommission response: ', response);
  } catch (e) {
    console.log('getSpotAccountCommission error: ', e);
  }

  // FUTURES - Market data requests
  try {
    const response = await wsClient.getFuturesOrderBook({
      symbol: 'BTCUSDT',
    });
    console.log('getFuturesOrderBook response: ', response);
  } catch (e) {
    console.log('getFuturesOrderBook error: ', e);
  }

  try {
    const response = await wsClient.getFuturesSymbolPriceTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getFuturesSymbolPriceTicker response: ', response);
  } catch (e) {
    console.log('getFuturesSymbolPriceTicker error: ', e);
  }

  try {
    const response = await wsClient.getFuturesSymbolOrderBookTicker({
      symbol: 'BTCUSDT',
    });
    console.log('getFuturesSymbolOrderBookTicker response: ', response);
  } catch (e) {
    console.log('getFuturesSymbolOrderBookTicker error: ', e);
  }

  // FUTURES - Trading requests
  try {
    const response = await wsClient.submitNewFuturesOrder('usdm', {
      positionSide: 'BOTH',
      price: '43187.00',
      quantity: 0.1,
      side: 'BUY',
      symbol: 'BTCUSDT',
      timeInForce: 'GTC',
      timestamp: Date.now(),
      type: 'LIMIT',
    });
    console.log('submitNewFuturesOrder response: ', response);
  } catch (e) {
    console.log('submitNewFuturesOrder error: ', e);
  }

  try {
    const response = await wsClient.modifyFuturesOrder('usdm', {
      orderId: 328971409,
      origType: 'LIMIT',
      positionSide: 'SHORT',
      price: '43769.1',
      priceMatch: 'NONE',
      quantity: '0.11',
      side: 'SELL',
      symbol: 'BTCUSDT',
      timestamp: Date.now(),
    });
    console.log('modifyFuturesOrder response: ', response);
  } catch (e) {
    console.log('modifyFuturesOrder error: ', e);
  }

  try {
    const response = await wsClient.cancelFuturesOrder('usdm', {
      symbol: 'BTCUSDT',
      orderId: 328971409,
      timestamp: Date.now(),
    });
    console.log('cancelFuturesOrder response: ', response);
  } catch (e) {
    console.log('cancelFuturesOrder error: ', e);
  }

  try {
    const response = await wsClient.getFuturesOrderStatus('usdm', {
      orderId: 328999071,
      symbol: 'BTCUSDT',
      timestamp: Date.now(),
    });
    console.log('getFuturesOrderStatus response: ', response);
  } catch (e) {
    console.log('getFuturesOrderStatus error: ', e);
  }

  try {
    const response = await wsClient.getFuturesPositionV2({
      timestamp: Date.now(),
    });
    console.log('getFuturesPositionV2 response: ', response);
  } catch (e) {
    console.log('getFuturesPositionV2 error: ', e);
  }

  try {
    const response = await wsClient.getFuturesPosition('usdm', {
      timestamp: Date.now(),
    });
    console.log('getFuturesPosition response: ', response);
  } catch (e) {
    console.log('getFuturesPosition error: ', e);
  }

  // FUTURES - Account requests
  try {
    const response = await wsClient.getFuturesAccountBalanceV2({
      timestamp: Date.now(),
    });
    console.log('getFuturesAccountBalanceV2 response: ', response);
  } catch (e) {
    console.log('getFuturesAccountBalanceV2 error: ', e);
  }

  try {
    const response = await wsClient.getFuturesAccountBalance('usdm', {
      timestamp: Date.now(),
    });
    console.log('getFuturesAccountBalance response: ', response);
  } catch (e) {
    console.log('getFuturesAccountBalance error: ', e);
  }

  try {
    const response = await wsClient.getFuturesAccountStatusV2({
      timestamp: Date.now(),
    });
    console.log('getFuturesAccountStatusV2 response: ', response);
  } catch (e) {
    console.log('getFuturesAccountStatusV2 error: ', e);
  }

  try {
    const response = await wsClient.getFuturesAccountStatus('usdm', {
      timestamp: Date.now(),
    });
    console.log('getFuturesAccountStatus response: ', response);
  } catch (e) {
    console.log('getFuturesAccountStatus error: ', e);
  }

  try {
    const response = await wsClient.submitNewFuturesAlgoOrder({
      algoType: 'CONDITIONAL',
      symbol: 'BTCUSDT',
      side: 'BUY',
      type: 'STOP',
      timeInForce: 'GTC',
      price: '100000.10000000',
      stopPrice: '100000.10000000',
      quantity: '0.00847000',
      timestamp: Date.now(),
    });
    console.log('submitNewFuturesAlgoOrder response: ', response);
  } catch (e) {
    console.log('submitNewFuturesAlgoOrder error: ', e);
  }

  try {
    const response = await wsClient.cancelFuturesAlgoOrder({
      algoid: 1028312903,
      timestamp: Date.now(),
    });
    console.log('cancelFuturesAlgoOrder response: ', response);
  } catch (e) {
    console.log('cancelFuturesAlgoOrder error: ', e);
  }
}

// Start executing the example workflow
main();

Complete Binance API JavaScript Tutorial

Open the full Binance API JavaScript tutorial for a practical guide to Spot, margin, wallet, USD-M Futures, COIN-M Futures, Portfolio Margin, public streams, user data streams, WebSocket API commands, environments, reconnect handling, and production rollout checks.

Endpoint Function Reference

Endpoint maps

Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.

The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.

This can be used to easily find which method to call, once you have found which endpoint you're looking to use.

All REST clients are in the src folder. For usage examples, make sure to check the examples folder.

List of clients:

If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!

How to use table

Table consists of 4 parts:

  • Function name
  • AUTH
  • HTTP Method
  • Endpoint

Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!

AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.

HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.

Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.

main-client.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in main-client.ts.

FunctionAUTHHTTP MethodEndpoint
testConnectivity()GETapi/v3/ping
getExchangeInfo()GETapi/v3/exchangeInfo
getOrderBook()GETapi/v3/depth
getRecentTrades()GETapi/v3/trades
getHistoricalTrades()GETapi/v3/historicalTrades
getAggregateTrades()GETapi/v3/aggTrades
getKlines()GETapi/v3/klines
getUIKlines()GETapi/v3/uiKlines
getAvgPrice()GETapi/v3/avgPrice
getExecutionRules()GETapi/v3/executionRules?symbols=
getReferencePrice()GETapi/v3/referencePrice
getReferencePriceCalculation()GETapi/v3/referencePrice/calculation
get24hrChangeStatistics()GETapi/v3/ticker/24hr?symbols=
getTradingDayTicker()GETapi/v3/ticker/tradingDay?symbols=
getSymbolPriceTicker()GETapi/v3/ticker/price?symbols=
getSymbolOrderBookTicker()GETapi/v3/ticker/bookTicker?symbols=
getRollingWindowTicker()GETapi/v3/ticker?symbols=
submitNewOrder()🔐POSTapi/v3/order
testNewOrder()🔐POSTapi/v3/order/test
getOrder()🔐GETapi/v3/order
cancelOrder()🔐DELETEapi/v3/order
cancelAllSymbolOrders()🔐DELETEapi/v3/openOrders
replaceOrder()🔐POSTapi/v3/order/cancelReplace
amendOrderKeepPriority()🔐PUTfapi/v1/order/amend/keepPriority
getOpenOrders()🔐GETapi/v3/openOrders
getAllOrders()🔐GETapi/v3/allOrders
submitNewOCO()🔐POSTapi/v3/order/oco
submitNewOrderList()🔐POSTapi/v3/orderList/oco
submitNewOrderListOTO()🔐POSTapi/v3/orderList/oto
submitNewOrderListOTOCO()🔐POSTapi/v3/orderList/otoco
submitNewOrderListOPO()🔐POSTapi/v3/orderList/opo
submitNewOrderListOPOCO()🔐POSTapi/v3/orderList/opoco
cancelOCO()🔐DELETEapi/v3/orderList
getOCO()🔐GETapi/v3/orderList
getAllOCO()🔐GETapi/v3/allOrderList
getAllOpenOCO()🔐GETapi/v3/openOrderList
submitNewSOROrder()🔐POSTapi/v3/sor/order
testNewSOROrder()🔐POSTapi/v3/sor/order/test
getAccountInformation()🔐GETapi/v3/account
getAccountTradeList()🔐GETapi/v3/myTrades
getOrderRateLimit()🔐GETapi/v3/rateLimit/order
getPreventedMatches()🔐GETapi/v3/myPreventedMatches
getAllocations()🔐GETapi/v3/myAllocations
getCommissionRates()🔐GETapi/v3/account/commission
getCrossMarginCollateralRatio()🔐GETsapi/v1/margin/crossMarginCollateralRatio
getAllCrossMarginPairs()GETsapi/v1/margin/allPairs
getIsolatedMarginAllSymbols()🔐GETsapi/v1/margin/isolated/allPairs
getAllMarginAssets()GETsapi/v1/margin/allAssets
getMarginDelistSchedule()🔐GETsapi/v1/margin/delist-schedule
getIsolatedMarginTierData()🔐GETsapi/v1/margin/isolatedMarginTier
queryMarginPriceIndex()GETsapi/v1/margin/priceIndex
getMarginAvailableInventory()🔐GETsapi/v1/margin/available-inventory
getLeverageBracket()🔐GETsapi/v1/margin/leverageBracket
getNextHourlyInterestRate()🔐GETsapi/v1/margin/next-hourly-interest-rate
getMarginInterestHistory()🔐GETsapi/v1/margin/interestHistory
submitMarginAccountBorrowRepay()🔐POSTsapi/v1/margin/borrow-repay
getMarginAccountBorrowRepayRecords()🔐GETsapi/v1/margin/borrow-repay
getMarginInterestRateHistory()🔐GETsapi/v1/margin/interestRateHistory
queryMaxBorrow()🔐GETsapi/v1/margin/maxBorrowable
getMarginForceLiquidationRecord()🔐GETsapi/v1/margin/forceLiquidationRec
getSmallLiabilityExchangeCoins()🔐GETsapi/v1/margin/exchange-small-liability
getSmallLiabilityExchangeHistory()🔐GETsapi/v1/margin/exchange-small-liability-history
marginAccountCancelOpenOrders()🔐DELETEsapi/v1/margin/openOrders
marginAccountCancelOCO()🔐DELETEsapi/v1/margin/orderList
marginAccountCancelOrder()🔐DELETEsapi/v1/margin/order
marginAccountNewOCO()🔐POSTsapi/v1/margin/order/oco
marginAccountNewOrder()🔐POSTsapi/v1/margin/order
getMarginOrderCountUsage()🔐GETsapi/v1/margin/rateLimit/order
queryMarginAccountAllOCO()🔐GETsapi/v1/margin/allOrderList
queryMarginAccountAllOrders()🔐GETsapi/v1/margin/allOrders
queryMarginAccountOCO()🔐GETsapi/v1/margin/orderList
queryMarginAccountOpenOCO()🔐GETsapi/v1/margin/openOrderList
queryMarginAccountOpenOrders()🔐GETsapi/v1/margin/openOrders
queryMarginAccountOrder()🔐GETsapi/v1/margin/order
queryMarginAccountTradeList()🔐GETsapi/v1/margin/myTrades
submitSmallLiabilityExchange()🔐POSTsapi/v1/margin/exchange-small-liability
submitManualLiquidation()🔐POSTsapi/v1/margin/manual-liquidation
submitMarginOTOOrder()🔐POSTsapi/v1/margin/order/oto
submitMarginOTOCOOrder()🔐POSTsapi/v1/margin/order/otoco
createMarginSpecialLowLatencyKey()🔐POSTsapi/v1/margin/apiKey
deleteMarginSpecialLowLatencyKey()🔐DELETEsapi/v1/margin/apiKey
updateMarginIPForSpecialLowLatencyKey()🔐PUTsapi/v1/margin/apiKey/ip
getMarginSpecialLowLatencyKeys()🔐GETsapi/v1/margin/api-key-list
getMarginSpecialLowLatencyKey()🔐GETsapi/v1/margin/apiKey
getCrossMarginTransferHistory()🔐GETsapi/v1/margin/transfer
queryMaxTransferOutAmount()🔐GETsapi/v1/margin/maxTransferable
updateCrossMarginMaxLeverage()🔐POSTsapi/v1/margin/max-leverage
disableIsolatedMarginAccount()🔐DELETEsapi/v1/margin/isolated/account
enableIsolatedMarginAccount()🔐POSTsapi/v1/margin/isolated/account
getBNBBurn()🔐GETsapi/v1/bnbBurn
getMarginSummary()🔐GETsapi/v1/margin/tradeCoeff
queryCrossMarginAccountDetails()🔐GETsapi/v1/margin/account
getCrossMarginFeeData()🔐GETsapi/v1/margin/crossMarginData
getIsolatedMarginAccountLimit()🔐GETsapi/v1/margin/isolated/accountLimit
getIsolatedMarginAccountInfo()🔐GETsapi/v1/margin/isolated/account
getIsolatedMarginFeeData()🔐GETsapi/v1/margin/isolatedMarginData
toggleBNBBurn()🔐POSTsapi/v1/bnbBurn
getMarginCapitalFlow()🔐GETsapi/v1/margin/capital-flow
queryLoanRecord()🔐GETsapi/v1/margin/loan
queryRepayRecord()🔐GETsapi/v1/margin/repay
isolatedMarginAccountTransfer()🔐POSTsapi/v1/margin/isolated/transfer
getBalances()🔐GETsapi/v1/capital/config/getall
withdraw()🔐POSTsapi/v1/capital/withdraw/apply
getWithdrawHistory()🔐GETsapi/v1/capital/withdraw/history
getWithdrawAddresses()🔐GETsapi/v1/capital/withdraw/address/list
getWithdrawQuota()🔐GETsapi/v1/capital/withdraw/quota
getDepositHistory()🔐GETsapi/v1/capital/deposit/hisrec
getDepositAddress()🔐GETsapi/v1/capital/deposit/address
getDepositAddresses()🔐GETsapi/v1/capital/deposit/address/list
submitDepositCredit()🔐POSTsapi/v1/capital/deposit/credit-apply
getAutoConvertStablecoins()🔐GETsapi/v1/capital/contract/convertible-coins
setConvertibleCoins()🔐POSTsapi/v1/capital/contract/convertible-coins
getAssetDetail()🔐GETsapi/v1/asset/assetDetail
getWalletBalances()🔐GETsapi/v1/asset/wallet/balance
getUserAsset()🔐POSTsapi/v3/asset/getUserAsset
submitUniversalTransfer()🔐POSTsapi/v1/asset/transfer
getUniversalTransferHistory()🔐GETsapi/v1/asset/transfer
getDust()🔐POSTsapi/v1/asset/dust-btc
convertDustToBnb()🔐POSTsapi/v1/asset/dust
getDustLog()🔐GETsapi/v1/asset/dribblet
getAssetDividendRecord()🔐GETsapi/v1/asset/assetDividend
getTradeFee()🔐GETsapi/v1/asset/tradeFee
getFundingAsset()🔐POSTsapi/v1/asset/get-funding-asset
getCloudMiningHistory()🔐GETsapi/v1/asset/ledger-transfer/cloud-mining/queryByPage
getDelegationHistory()🔐GETsapi/v1/asset/custody/transfer-history
submitNewFutureAccountTransfer()🔐POSTsapi/v1/futures/transfer
getFutureAccountTransferHistory()🔐GETsapi/v1/futures/transfer
getCrossCollateralBorrowHistory()🔐GETsapi/v1/futures/loan/borrow/history
getCrossCollateralRepaymentHistory()🔐GETsapi/v1/futures/loan/repay/history
getCrossCollateralWalletV2()🔐GETsapi/v2/futures/loan/wallet
getAdjustCrossCollateralLTVHistory()🔐GETsapi/v1/futures/loan/adjustCollateral/history
getCrossCollateralLiquidationHistory()🔐GETsapi/v1/futures/loan/liquidationHistory
getCrossCollateralInterestHistory()🔐GETsapi/v1/futures/loan/interestHistory
getAccountInfo()🔐GETsapi/v1/account/info
getDailyAccountSnapshot()🔐GETsapi/v1/accountSnapshot
disableFastWithdrawSwitch()🔐POSTsapi/v1/account/disableFastWithdrawSwitch
enableFastWithdrawSwitch()🔐POSTsapi/v1/account/enableFastWithdrawSwitch
getAccountStatus()🔐GETsapi/v1/account/status
getApiTradingStatus()🔐GETsapi/v1/account/apiTradingStatus
getApiKeyPermissions()🔐GETsapi/v1/account/apiRestrictions
withdrawTravelRule()🔐POSTsapi/v1/localentity/withdraw/apply
getTravelRuleWithdrawHistory()🔐GETsapi/v1/localentity/withdraw/history
getTravelRuleWithdrawHistoryV2()🔐GETsapi/v2/localentity/withdraw/history
submitTravelRuleDepositQuestionnaire()🔐PUTsapi/v1/localentity/deposit/provide-info
getTravelRuleDepositHistory()🔐GETsapi/v1/localentity/deposit/history
getOnboardedVASPList()🔐GETsapi/v1/localentity/vasp
getSystemStatus()GETsapi/v1/system/status
getDelistSchedule()🔐GETsapi/v1/spot/delist-schedule
createVirtualSubAccount()🔐POSTsapi/v1/sub-account/virtualSubAccount
getSubAccountList()🔐GETsapi/v1/sub-account/list
subAccountEnableFutures()🔐POSTsapi/v1/sub-account/futures/enable
subAccountEnableMargin()🔐POSTsapi/v1/sub-account/margin/enable
enableOptionsForSubAccount()🔐POSTsapi/v1/sub-account/eoptions/enable
subAccountEnableLeverageToken()🔐POSTsapi/v1/sub-account/blvt/enable
getSubAccountStatusOnMarginOrFutures()🔐GETsapi/v1/sub-account/status
getSubAccountFuturesPositionRisk()🔐GETsapi/v1/sub-account/futures/positionRisk
getSubAccountFuturesPositionRiskV2()🔐GETsapi/v2/sub-account/futures/positionRisk
getSubAccountTransactionStatistics()🔐GETsapi/v1/sub-account/transaction-statistics
getSubAccountIPRestriction()🔐GETsapi/v1/sub-account/subAccountApi/ipRestriction
subAccountDeleteIPList()🔐DELETEsapi/v1/sub-account/subAccountApi/ipRestriction/ipList
subAccountAddIPRestriction()🔐POSTsapi/v2/sub-account/subAccountApi/ipRestriction
subAccountAddIPList()🔐POSTsapi/v1/sub-account/subAccountApi/ipRestriction/ipList
subAccountEnableOrDisableIPRestriction()🔐POSTsapi/v1/sub-account/subAccountApi/ipRestriction
subAccountFuturesTransfer()🔐POSTsapi/v1/sub-account/futures/transfer
getSubAccountFuturesAccountDetail()🔐GETsapi/v1/sub-account/futures/account
getSubAccountDetailOnFuturesAccountV2()🔐GETsapi/v2/sub-account/futures/account
getSubAccountDetailOnMarginAccount()🔐GETsapi/v1/sub-account/margin/account
getSubAccountDepositAddress()🔐GETsapi/v1/capital/deposit/subAddress
getSubAccountDepositHistory()🔐GETsapi/v1/capital/deposit/subHisrec
getSubAccountFuturesAccountSummary()🔐GETsapi/v1/sub-account/futures/accountSummary
getSubAccountSummaryOnFuturesAccountV2()🔐GETsapi/v2/sub-account/futures/accountSummary
getSubAccountsSummaryOfMarginAccount()🔐GETsapi/v1/sub-account/margin/accountSummary
subAccountMarginTransfer()🔐POSTsapi/v1/sub-account/margin/transfer
getSubAccountAssets()🔐GETsapi/v3/sub-account/assets
getSubAccountAssetsMaster()🔐GETsapi/v4/sub-account/assets
getSubAccountFuturesAssetTransferHistory()🔐GETsapi/v1/sub-account/futures/internalTransfer
getSubAccountSpotAssetTransferHistory()🔐GETsapi/v1/sub-account/sub/transfer/history
getSubAccountSpotAssetsSummary()🔐GETsapi/v1/sub-account/spotSummary
getSubAccountUniversalTransferHistory()🔐GETsapi/v1/sub-account/universalTransfer
subAccountFuturesAssetTransfer()🔐POSTsapi/v1/sub-account/futures/internalTransfer
subAccountTransferHistory()🔐GETsapi/v1/sub-account/transfer/subUserHistory
subAccountTransferToMaster()🔐POSTsapi/v1/sub-account/transfer/subToMaster
subAccountTransferToSameMaster()🔐POSTsapi/v1/sub-account/transfer/subToSub
subAccountUniversalTransfer()🔐POSTsapi/v1/sub-account/universalTransfer
subAccountMovePosition()🔐POSTsapi/v1/sub-account/futures/move-position
getSubAccountFuturesPositionMoveHistory()🔐GETsapi/v1/sub-account/futures/move-position
depositAssetsIntoManagedSubAccount()🔐POSTsapi/v1/managed-subaccount/deposit
getManagedSubAccountDepositAddress()🔐GETsapi/v1/managed-subaccount/deposit/address
withdrawAssetsFromManagedSubAccount()🔐POSTsapi/v1/managed-subaccount/withdraw
getManagedSubAccountTransfersParent()🔐GETsapi/v1/managed-subaccount/queryTransLogForTradeParent
getManagedSubAccountTransferLog()🔐GETsapi/v1/managed-subaccount/query-trans-log
getManagedSubAccountTransfersInvestor()🔐GETsapi/v1/managed-subaccount/queryTransLogForInvestor
getManagedSubAccounts()🔐GETsapi/v1/managed-subaccount/info
getManagedSubAccountSnapshot()🔐GETsapi/v1/managed-subaccount/accountSnapshot
getManagedSubAccountAssetDetails()🔐GETsapi/v1/managed-subaccount/asset
getManagedSubAccountMarginAssets()🔐GETsapi/v1/managed-subaccount/marginAsset
getManagedSubAccountFuturesAssets()🔐GETsapi/v1/managed-subaccount/fetch-future-asset
getAutoInvestAssets()🔐GETsapi/v1/lending/auto-invest/all/asset
getAutoInvestSourceAssets()🔐GETsapi/v1/lending/auto-invest/source-asset/list
getAutoInvestTargetAssets()🔐GETsapi/v1/lending/auto-invest/target-asset/list
getAutoInvestTargetAssetsROI()🔐GETsapi/v1/lending/auto-invest/target-asset/roi/list
getAutoInvestIndex()🔐GETsapi/v1/lending/auto-invest/index/info
getAutoInvestPlans()🔐GETsapi/v1/lending/auto-invest/plan/list
submitAutoInvestOneTimeTransaction()🔐POSTsapi/v1/lending/auto-invest/one-off
updateAutoInvestPlanStatus()🔐POSTsapi/v1/lending/auto-invest/plan/edit-status
updateAutoInvestmentPlan()🔐POSTsapi/v1/lending/auto-invest/plan/edit
submitAutoInvestRedemption()🔐POSTsapi/v1/lending/auto-invest/redeem
getAutoInvestSubscriptionTransactions()🔐GETsapi/v1/lending/auto-invest/history/list
getOneTimeTransactionStatus()🔐GETsapi/v1/lending/auto-invest/one-off/status
submitAutoInvestmentPlan()🔐POSTsapi/v1/lending/auto-invest/plan/add
getAutoInvestRedemptionHistory()🔐GETsapi/v1/lending/auto-invest/redeem/history
getAutoInvestPlan()🔐GETsapi/v1/lending/auto-invest/plan/id
getAutoInvestUserIndex()🔐GETsapi/v1/lending/auto-invest/index/user-summary
getAutoInvestRebalanceHistory()🔐GETsapi/v1/lending/auto-invest/rebalance/history
getConvertPairs()🔐GETsapi/v1/convert/exchangeInfo
getConvertAssetInfo()🔐GETsapi/v1/convert/assetInfo
convertQuoteRequest()🔐POSTsapi/v1/convert/getQuote
acceptQuoteRequest()🔐POSTsapi/v1/convert/acceptQuote
getConvertTradeHistory()🔐GETsapi/v1/convert/tradeFlow
getOrderStatus()🔐GETsapi/v1/convert/orderStatus
submitConvertLimitOrder()🔐POSTsapi/v1/convert/limit/placeOrder
cancelConvertLimitOrder()🔐POSTsapi/v1/convert/limit/cancelOrder
getConvertLimitOpenOrders()🔐GETsapi/v1/convert/limit/queryOpenOrders
getEthStakingAccount()🔐GETsapi/v1/eth-staking/account
getEthStakingAccountV2()🔐GETsapi/v2/eth-staking/account
getEthStakingQuota()🔐GETsapi/v1/eth-staking/eth/quota
subscribeEthStakingV1()🔐POSTsapi/v1/eth-staking/eth/stake
subscribeEthStakingV2()🔐POSTsapi/v2/eth-staking/eth/stake
redeemEth()🔐POSTsapi/v1/eth-staking/eth/redeem
wrapBeth()🔐POSTsapi/v1/eth-staking/wbeth/wrap
getEthStakingHistory()🔐GETsapi/v1/eth-staking/eth/history/stakingHistory
getEthRedemptionHistory()🔐GETsapi/v1/eth-staking/eth/history/redemptionHistory
getBethRewardsHistory()🔐GETsapi/v1/eth-staking/eth/history/rewardsHistory
getWbethRewardsHistory()🔐GETsapi/v1/eth-staking/eth/history/wbethRewardsHistory
getEthRateHistory()🔐GETsapi/v1/eth-staking/eth/history/rateHistory
getBethWrapHistory()🔐GETsapi/v1/eth-staking/wbeth/history/wrapHistory
getBethUnwrapHistory()🔐GETsapi/v1/eth-staking/wbeth/history/unwrapHistory
getBfusdAccount()🔐GETsapi/v1/bfusd/account
getBfusdQuota()🔐GETsapi/v1/bfusd/quota
subscribeBfusd()🔐POSTsapi/v1/bfusd/subscribe
redeemBfusd()🔐POSTsapi/v1/bfusd/redeem
getBfusdSubscriptionHistory()🔐GETsapi/v1/bfusd/history/subscriptionHistory
getBfusdRedemptionHistory()🔐GETsapi/v1/bfusd/history/redemptionHistory
getBfusdRewardsHistory()🔐GETsapi/v1/bfusd/history/rewardsHistory
getBfusdRateHistory()🔐GETsapi/v1/bfusd/history/rateHistory
getRwusdAccount()🔐GETsapi/v1/rwusd/account
getRwusdQuota()🔐GETsapi/v1/rwusd/quota
subscribeRwusd()🔐POSTsapi/v1/rwusd/subscribe
redeemRwusd()🔐POSTsapi/v1/rwusd/redeem
getRwusdSubscriptionHistory()🔐GETsapi/v1/rwusd/history/subscriptionHistory
getRwusdRedemptionHistory()🔐GETsapi/v1/rwusd/history/redemptionHistory
getRwusdRewardsHistory()🔐GETsapi/v1/rwusd/history/rewardsHistory
getRwusdRateHistory()🔐GETsapi/v1/rwusd/history/rateHistory
getStakingProducts()🔐GETsapi/v1/staking/productList
getStakingProductPosition()🔐GETsapi/v1/staking/position
getStakingHistory()🔐GETsapi/v1/staking/stakingRecord
getPersonalLeftQuotaOfStakingProduct()🔐GETsapi/v1/staking/personalLeftQuota
getSolStakingAccount()🔐GETsapi/v1/sol-staking/account
getSolStakingQuota()🔐GETsapi/v1/sol-staking/sol/quota
subscribeSolStaking()🔐POSTsapi/v1/sol-staking/sol/stake
redeemSol()🔐POSTsapi/v1/sol-staking/sol/redeem
claimSolBoostRewards()🔐POSTsapi/v1/sol-staking/sol/claim
getSolStakingHistory()🔐GETsapi/v1/sol-staking/sol/history/stakingHistory
getSolRedemptionHistory()🔐GETsapi/v1/sol-staking/sol/history/redemptionHistory
getBnsolRewardsHistory()🔐GETsapi/v1/sol-staking/sol/history/bnsolRewardsHistory
getBnsolRateHistory()🔐GETsapi/v1/sol-staking/sol/history/rateHistory
getSolBoostRewardsHistory()🔐GETsapi/v1/sol-staking/sol/history/boostRewardsHistory
getSolUnclaimedRewards()🔐GETsapi/v1/sol-staking/sol/history/unclaimedRewards
getOnchainYieldsLockedProducts()🔐GETsapi/v1/onchain-yields/locked/list
getOnchainYieldsLockedPersonalLeftQuota()🔐GETsapi/v1/onchain-yields/locked/personalLeftQuota
getOnchainYieldsLockedPosition()🔐GETsapi/v1/onchain-yields/locked/position
getOnchainYieldsAccount()🔐GETsapi/v1/onchain-yields/account
getOnchainYieldsLockedSubscriptionPreview()🔐GETsapi/v1/onchain-yields/locked/subscriptionPreview
subscribeOnchainYieldsLockedProduct()🔐POSTsapi/v1/onchain-yields/locked/subscribe
setOnchainYieldsLockedAutoSubscribe()🔐POSTsapi/v1/onchain-yields/locked/setAutoSubscribe
setOnchainYieldsLockedRedeemOption()🔐POSTsapi/v1/onchain-yields/locked/setRedeemOption
redeemOnchainYieldsLockedProduct()🔐POSTsapi/v1/onchain-yields/locked/redeem
getOnchainYieldsLockedSubscriptionRecord()🔐GETsapi/v1/onchain-yields/locked/history/subscriptionRecord
getOnchainYieldsLockedRewardsHistory()🔐GETsapi/v1/onchain-yields/locked/history/rewardsRecord
getOnchainYieldsLockedRedemptionRecord()🔐GETsapi/v1/onchain-yields/locked/history/redemptionRecord
getSoftStakingProductList()🔐GETsapi/v1/soft-staking/list
setSoftStaking()🔐GETsapi/v1/soft-staking/set
getSoftStakingRewardsHistory()🔐GETsapi/v1/soft-staking/history/rewardsRecord
getFuturesLeadTraderStatus()🔐GETsapi/v1/copyTrading/futures/userStatus
getFuturesLeadTradingSymbolWhitelist()🔐GETsapi/v1/copyTrading/futures/leadSymbol
getMiningAlgos()GETsapi/v1/mining/pub/algoList
getMiningCoins()GETsapi/v1/mining/pub/coinList
getHashrateResales()🔐GETsapi/v1/mining/hash-transfer/config/details/list
getMiners()🔐GETsapi/v1/mining/worker/list
getMinerDetails()🔐GETsapi/v1/mining/worker/detail
getExtraBonuses()🔐GETsapi/v1/mining/payment/other
getMiningEarnings()🔐GETsapi/v1/mining/payment/list
cancelHashrateResaleConfig()🔐POSTsapi/v1/mining/hash-transfer/config/cancel
getHashrateResale()🔐GETsapi/v1/mining/hash-transfer/profit/details
getMiningAccountEarnings()🔐GETsapi/v1/mining/payment/uid
getMiningStatistics()🔐GETsapi/v1/mining/statistics/user/status
submitHashrateResale()🔐POSTsapi/v1/mining/hash-transfer/config
getMiningAccounts()🔐GETsapi/v1/mining/statistics/user/list
submitVpNewOrder()🔐POSTsapi/v1/algo/futures/newOrderVp
submitTwapNewOrder()🔐POSTsapi/v1/algo/futures/newOrderTwap
cancelAlgoOrder()🔐DELETEsapi/v1/algo/futures/order
getAlgoSubOrders()🔐GETsapi/v1/algo/futures/subOrders
getAlgoOpenOrders()🔐GETsapi/v1/algo/futures/openOrders
getAlgoHistoricalOrders()🔐GETsapi/v1/algo/futures/historicalOrders
submitSpotAlgoTwapOrder()🔐POSTsapi/v1/algo/spot/newOrderTwap
cancelSpotAlgoOrder()🔐DELETEsapi/v1/algo/spot/order
getSpotAlgoSubOrders()🔐GETsapi/v1/algo/spot/subOrders
getSpotAlgoOpenOrders()🔐GETsapi/v1/algo/spot/openOrders
getSpotAlgoHistoricalOrders()🔐GETsapi/v1/algo/spot/historicalOrders
getCryptoLoanFlexibleCollateralAssets()🔐GETsapi/v2/loan/flexible/collateral/data
getCryptoLoanFlexibleAssets()🔐GETsapi/v2/loan/flexible/loanable/data
borrowCryptoLoanFlexible()🔐POSTsapi/v2/loan/flexible/borrow
repayCryptoLoanFlexible()🔐POSTsapi/v2/loan/flexible/repay
repayCryptoLoanFlexibleWithCollateral()🔐POSTsapi/v2/loan/flexible/repay/collateral
adjustCryptoLoanFlexibleLTV()🔐POSTsapi/v2/loan/flexible/adjust/ltv
getCryptoLoanFlexibleLTVAdjustmentHistory()🔐GETsapi/v2/loan/flexible/ltv/adjustment/history
getFlexibleLoanCollateralRepayRate()🔐GETsapi/v2/loan/flexible/repay/rate
getLoanFlexibleBorrowHistory()🔐GETsapi/v2/loan/flexible/borrow/history
getCryptoLoanFlexibleOngoingOrders()🔐GETsapi/v2/loan/flexible/ongoing/orders
getFlexibleLoanLiquidationHistory()🔐GETsapi/v2/loan/flexible/liquidation/history
getLoanFlexibleRepaymentHistory()🔐GETsapi/v2/loan/flexible/repay/history
getCryptoLoanLoanableAssets()🔐GETsapi/v1/loan/loanable/data
getCryptoLoanCollateralRepayRate()🔐GETsapi/v1/loan/repay/collateral/rate
getCryptoLoanCollateralAssetsData()🔐GETsapi/v1/loan/collateral/data
getCryptoLoansIncomeHistory()🔐GETsapi/v1/loan/income
borrowCryptoLoan()🔐POSTsapi/v1/loan/borrow
repayCryptoLoan()🔐POSTsapi/v1/loan/repay
adjustCryptoLoanLTV()🔐POSTsapi/v1/loan/adjust/ltv
customizeCryptoLoanMarginCall()🔐POSTsapi/v1/loan/customize/margin_call
getCryptoLoanOngoingOrders()🔐GETsapi/v1/loan/ongoing/orders
getCryptoLoanBorrowHistory()🔐GETsapi/v1/loan/borrow/history
getCryptoLoanLTVAdjustmentHistory()🔐GETsapi/v1/loan/ltv/adjustment/history
getCryptoLoanRepaymentHistory()🔐GETsapi/v1/loan/repay/history
getSimpleEarnAccount()🔐GETsapi/v1/simple-earn/account
getFlexibleSavingProducts()🔐GETsapi/v1/simple-earn/flexible/list
getSimpleEarnLockedProductList()🔐GETsapi/v1/simple-earn/locked/list
getFlexibleProductPosition()🔐GETsapi/v1/simple-earn/flexible/position
getLockedProductPosition()🔐GETsapi/v1/simple-earn/locked/position
getFlexiblePersonalLeftQuota()🔐GETsapi/v1/simple-earn/flexible/personalLeftQuota
getLockedPersonalLeftQuota()🔐GETsapi/v1/simple-earn/locked/personalLeftQuota
purchaseFlexibleProduct()🔐POSTsapi/v1/simple-earn/flexible/subscribe
subscribeSimpleEarnLockedProduct()🔐POSTsapi/v1/simple-earn/locked/subscribe
redeemFlexibleProduct()🔐POSTsapi/v1/simple-earn/flexible/redeem
redeemLockedProduct()🔐POSTsapi/v1/simple-earn/locked/redeem
setFlexibleAutoSubscribe()🔐POSTsapi/v1/simple-earn/flexible/setAutoSubscribe
setLockedAutoSubscribe()🔐POSTsapi/v1/simple-earn/locked/setAutoSubscribe
getFlexibleSubscriptionPreview()🔐GETsapi/v1/simple-earn/flexible/subscriptionPreview
getLockedSubscriptionPreview()🔐GETsapi/v1/simple-earn/locked/subscriptionPreview
setLockedProductRedeemOption()🔐POSTsapi/v1/simple-earn/locked/setRedeemOption
getFlexibleSubscriptionRecord()🔐GETsapi/v1/simple-earn/flexible/history/subscriptionRecord
getLockedSubscriptionRecord()🔐GETsapi/v1/simple-earn/locked/history/subscriptionRecord
getFlexibleRedemptionRecord()🔐GETsapi/v1/simple-earn/flexible/history/redemptionRecord
getLockedRedemptionRecord()🔐GETsapi/v1/simple-earn/locked/history/redemptionRecord
getFlexibleRewardsHistory()🔐GETsapi/v1/simple-earn/flexible/history/rewardsRecord
getLockedRewardsHistory()🔐GETsapi/v1/simple-earn/locked/history/rewardsRecord
getCollateralRecord()🔐GETsapi/v1/simple-earn/flexible/history/collateralRecord
getRateHistory()🔐GETsapi/v1/simple-earn/flexible/history/rateHistory
getVipBorrowInterestRate()🔐GETsapi/v1/loan/vip/request/interestRate
getVipLoanInterestRateHistory()🔐GETsapi/v1/loan/vip/interestRateHistory
getVipLoanableAssets()🔐GETsapi/v1/loan/vip/loanable/data
getVipCollateralAssets()🔐GETsapi/v1/loan/vip/collateral/data
getVipLoanOpenOrders()🔐GETsapi/v1/loan/vip/ongoing/orders
getVipLoanRepaymentHistory()🔐GETsapi/v1/loan/vip/repay/history
checkVipCollateralAccount()🔐GETsapi/v1/loan/vip/collateral/account
getVipApplicationStatus()🔐GETsapi/v1/loan/vip/request/data
renewVipLoan()🔐POSTsapi/v1/loan/vip/renew
repayVipLoan()🔐POSTsapi/v1/loan/vip/repay
borrowVipLoan()🔐POSTsapi/v1/loan/vip/borrow
getDualInvestmentProducts()🔐GETsapi/v1/dci/product/list
subscribeDualInvestmentProduct()🔐POSTsapi/v1/dci/product/subscribe
getDualInvestmentPositions()🔐GETsapi/v1/dci/product/positions
getDualInvestmentAccounts()🔐GETsapi/v1/dci/product/accounts
getVipLoanAccruedInterest()🔐GETsapi/v1/loan/vip/accruedInterest
updateAutoCompoundStatus()🔐POSTsapi/v1/dci/product/auto_compound/edit-status
createGiftCard()🔐POSTsapi/v1/giftcard/createCode
createDualTokenGiftCard()🔐POSTsapi/v1/giftcard/buyCode
redeemGiftCard()🔐POSTsapi/v1/giftcard/redeemCode
verifyGiftCard()🔐GETsapi/v1/giftcard/verify
getTokenLimit()🔐GETsapi/v1/giftcard/buyCode/token-limit
getRsaPublicKey()🔐GETsapi/v1/giftcard/cryptography/rsa-public-key
getNftTransactionHistory()🔐GETsapi/v1/nft/history/transactions
getNftDepositHistory()🔐GETsapi/v1/nft/history/deposit
getNftWithdrawHistory()🔐GETsapi/v1/nft/history/withdraw
getNftAsset()🔐GETsapi/v1/nft/user/getAsset
getC2CTradeHistory()🔐GETsapi/v1/c2c/orderMatch/listUserOrderHistory
getFiatOrderHistory()🔐GETsapi/v1/fiat/orders
getFiatPaymentsHistory()🔐GETsapi/v1/fiat/payments
fiatWithdraw()🔐POST/sapi/v2/fiat/withdraw
fiatDeposit()🔐POSTsapi/v1/fiat/deposit
getFiatOrderDetail()🔐GETsapi/v1/fiat/get-order-detail
getSpotRebateHistoryRecords()🔐GETsapi/v1/rebate/taxQuery
getPortfolioMarginIndexPrice()GETsapi/v1/portfolio/asset-index-price
getPortfolioMarginAssetLeverage()🔐GETsapi/v1/portfolio/margin-asset-leverage
getPortfolioMarginProCollateralRate()GETsapi/v1/portfolio/collateralRate
getPortfolioMarginProTieredCollateralRate()GETsapi/v2/portfolio/collateralRate
getPortfolioMarginProAccountInfo()🔐GETsapi/v1/portfolio/account
setPortfolioMarginMarginCallLevel()🔐POSTsapi/v1/portfolio/margin-call-level
getPortfolioMarginMarginCallLevel()🔐GETsapi/v1/portfolio/margin-call-level
deletePortfolioMarginMarginCallLevel()🔐DELETEsapi/v1/portfolio/margin-call-level
bnbTransfer()🔐POSTsapi/v1/portfolio/bnb-transfer
submitPortfolioMarginProFullTransfer()🔐POSTsapi/v1/portfolio/auto-collection
submitPortfolioMarginProSpecificTransfer()🔐POSTsapi/v1/portfolio/asset-collection
repayPortfolioMarginProBankruptcyLoan()🔐POSTsapi/v1/portfolio/repay
getPortfolioMarginProBankruptcyLoanAmount()🔐GETsapi/v1/portfolio/pmLoan
repayFuturesNegativeBalance()🔐POSTsapi/v1/portfolio/repay-futures-negative-balance
updateAutoRepayFuturesStatus()🔐POSTsapi/v1/portfolio/repay-futures-switch
getAutoRepayFuturesStatus()🔐GETsapi/v1/portfolio/repay-futures-switch
getPortfolioMarginProInterestHistory()🔐GETsapi/v1/portfolio/interest-history
getPortfolioMarginProSpanAccountInfo()🔐GETsapi/v2/portfolio/account
getPortfolioMarginProAccountBalance()🔐GETsapi/v1/portfolio/balance
mintPortfolioMarginBFUSD()🔐POSTsapi/v1/portfolio/mint
redeemPortfolioMarginBFUSD()🔐POSTsapi/v1/portfolio/redeem
getPortfolioMarginBankruptcyLoanRepayHistory()🔐GETsapi/v1/portfolio/pmLoan-history
transferLDUSDTPortfolioMargin()🔐POSTsapi/v1/portfolio/earn-asset-transfer
getTransferableEarnAssetBalanceForPortfolioMargin()🔐GETsapi/v1/portfolio/earn-asset-balance
getFuturesTickLevelOrderbookDataLink()🔐GETsapi/v1/futures/histDataLink
getBlvtInfo()GETsapi/v1/blvt/tokenInfo
subscribeBlvt()🔐POSTsapi/v1/blvt/subscribe
getBlvtSubscriptionRecord()🔐GETsapi/v1/blvt/subscribe/record
redeemBlvt()🔐POSTsapi/v1/blvt/redeem
getBlvtRedemptionRecord()🔐GETsapi/v1/blvt/redeem/record
getBlvtUserLimitInfo()🔐GETsapi/v1/blvt/userLimit
getPayTransactions()🔐GETsapi/v1/pay/transactions
getInstLoanRiskUnit()🔐GETsapi/v1/margin/loan-group/ltv-details
closeInstLoanRiskUnit()🔐DELETEsapi/v1/margin/loan-group
addInstLoanCollateralAccount()🔐POSTsapi/v1/margin/loan-group/edit-member
getActiveInstLoanRiskUnits()🔐GETsapi/v1/margin/loan-groups/activated
getClosedInstLoanRiskUnits()🔐GETsapi/v1/margin/loan-groups/closed
getInstLoanForceLiquidationRecord()🔐GETsapi/v1/margin/loan-group/force-liquidation
transferInstLoanRiskUnit()🔐POSTsapi/v1/margin/loan-group/transfer-out
borrowInstitutionalLoan()🔐POSTsapi/v1/margin/loan-group/borrow
getInstLoanInterestHistory()🔐GETsapi/v1/margin/loan-group/interest-history
repayInstitutionalLoan()🔐POSTsapi/v1/margin/loan-group/repay
getInstLoanBorrowRepayRecords()🔐GETsapi/v1/margin/loan-group/borrow-repay
getMarginInterestRebateBalance()🔐GETsapi/v1/margin/loan-group/interest-rebate-balance
getMarginInterestRebateBalanceRecords()🔐GETsapi/v1/margin/loan-group/interest-rebate-balance/records
getAlphaTokenList()GETbapi/defi/v1/public/wallet-direct/buw/wallet/cex/alpha/all/token/list
getAlphaExchangeInfo()GETbapi/defi/v1/public/alpha-trade/get-exchange-info
getAlphaAggTrades()GETbapi/defi/v1/public/alpha-trade/agg-trades
getAlphaKlines()GETbapi/defi/v1/public/alpha-trade/klines
getAlphaTicker()GETbapi/defi/v1/public/alpha-trade/ticker
getAlphaFullDepth()GETbapi/defi/v1/public/alpha-trade/fullDepth
createBrokerSubAccount()🔐POSTsapi/v1/broker/subAccount
getBrokerSubAccount()🔐GETsapi/v1/broker/subAccount
enableMarginBrokerSubAccount()🔐POSTsapi/v1/broker/subAccount/futures
createApiKeyBrokerSubAccount()🔐POSTsapi/v1/broker/subAccountApi
changePermissionApiKeyBrokerSubAccount()🔐POSTsapi/v1/broker/subAccountApi/permission
changeComissionBrokerSubAccount()🔐POSTsapi/v1/broker/subAccountApi/permission
enableUniversalTransferApiKeyBrokerSubAccount()🔐POSTsapi/v1/broker/subAccountApi/permission/universalTransfer
updateIpRestrictionForSubAccountApiKey()🔐POSTsapi/v2/broker/subAccountApi/ipRestriction
deleteIPRestrictionForSubAccountApiKey()🔐DELETEsapi/v1/broker/subAccountApi/ipRestriction/ipList
deleteApiKeyBrokerSubAccount()🔐DELETEsapi/v1/broker/subAccountApi
getSubAccountBrokerIpRestriction()🔐GETsapi/v1/broker/subAccountApi/ipRestriction
getApiKeyBrokerSubAccount()🔐GETsapi/v1/broker/subAccountApi
getBrokerInfo()🔐GETsapi/v1/broker/info
updateSubAccountBNBBurn()🔐POSTsapi/v1/broker/subAccount/bnbBurn/spot
updateSubAccountMarginInterestBNBBurn()🔐POSTsapi/v1/broker/subAccount/bnbBurn/marginInterest
getSubAccountBNBBurnStatus()🔐GETsapi/v1/broker/subAccount/bnbBurn/status
deleteBrokerSubAccount()🔐DELETE/sapi/v1/broker/subAccount
transferBrokerSubAccount()🔐POSTsapi/v1/broker/transfer
getBrokerSubAccountHistory()🔐GETsapi/v1/broker/transfer
submitBrokerSubFuturesTransfer()🔐POSTsapi/v1/broker/transfer/futures
getSubAccountFuturesTransferHistory()🔐GETsapi/v1/broker/transfer/futures
getBrokerSubDepositHistory()🔐GETsapi/v1/broker/subAccount/depositHist
getBrokerSubAccountSpotAssets()🔐GETsapi/v1/broker/subAccount/spotSummary
getSubAccountMarginAssetInfo()🔐GETsapi/v1/broker/subAccount/marginSummary
querySubAccountFuturesAssetInfo()🔐GETsapi/v3/broker/subAccount/futuresSummary
universalTransferBroker()🔐POSTsapi/v1/broker/universalTransfer
getUniversalTransferBroker()🔐GETsapi/v1/broker/universalTransfer
updateBrokerSubAccountCommission()🔐POSTsapi/v1/broker/subAccountApi/commission
updateBrokerSubAccountFuturesCommission()🔐POSTsapi/v1/broker/subAccountApi/commission/futures
getBrokerSubAccountFuturesCommission()🔐GETsapi/v1/broker/subAccountApi/commission/futures
updateBrokerSubAccountCoinFuturesCommission()🔐POSTsapi/v1/broker/subAccountApi/commission/coinFutures
getBrokerSubAccountCoinFuturesCommission()🔐GETsapi/v1/broker/subAccountApi/commission/coinFutures
getBrokerSpotCommissionRebate()🔐GETsapi/v1/broker/rebate/recentRecord
getBrokerFuturesCommissionRebate()🔐GETsapi/v1/broker/rebate/futures/recentRecord
getBrokerIfNewSpotUser()🔐GETsapi/v1/apiReferral/ifNewUser
getBrokerSubAccountDepositHistory()🔐GETsapi/v1/bv1/apiReferral/ifNewUser
enableFuturesBrokerSubAccount()🔐POSTsapi/v1/broker/subAccount
enableMarginApiKeyBrokerSubAccount()🔐POSTsapi/v1/broker/subAccount/margin
getSpotUserDataListenKey()POSTapi/v3/userDataStream
keepAliveSpotUserDataListenKey()PUTapi/v3/userDataStream?listenKey=${listenKey}
closeSpotUserDataListenKey()DELETEapi/v3/userDataStream?listenKey=${listenKey}
getMarginUserDataListenKey()POSTsapi/v1/userDataStream
keepAliveMarginUserDataListenKey()PUTsapi/v1/userDataStream?listenKey=${listenKey}
closeMarginUserDataListenKey()DELETEsapi/v1/userDataStream?listenKey=${listenKey}
getIsolatedMarginUserDataListenKey()POSTsapi/v1/userDataStream/isolated?${serialiseParams(params
keepAliveIsolatedMarginUserDataListenKey()PUTsapi/v1/userDataStream/isolated?${serialiseParams(params
closeIsolatedMarginUserDataListenKey()DELETEsapi/v1/userDataStream/isolated?${serialiseParams(params
getMarginRiskUserDataListenKey()POSTsapi/v1/margin/listen-key
keepAliveMarginRiskUserDataListenKey()PUTsapi/v1/margin/listen-key?listenKey=${listenKey}
closeMarginRiskUserDataListenKey()DELETEsapi/v1/margin/listen-key
getMarginListenToken()🔐POSTsapi/v1/userListenToken
getBSwapLiquidity()🔐GETsapi/v1/bswap/liquidity
addBSwapLiquidity()🔐POSTsapi/v1/bswap/liquidityAdd
removeBSwapLiquidity()🔐POSTsapi/v1/bswap/liquidityRemove
getBSwapOperations()🔐GETsapi/v1/bswap/liquidityOps
getLeftDailyPurchaseQuotaFlexibleProduct()🔐GETsapi/v1/lending/daily/userLeftQuota
getLeftDailyRedemptionQuotaFlexibleProduct()🔐GETsapi/v1/lending/daily/userRedemptionQuota
purchaseFixedAndActivityProject()🔐POSTsapi/v1/lending/customizedFixed/purchase
getFixedAndActivityProjects()🔐GETsapi/v1/lending/project/list
getFixedAndActivityProductPosition()🔐GETsapi/v1/lending/project/position/list
getLendingAccount()🔐GETsapi/v1/lending/union/account
getPurchaseRecord()🔐GETsapi/v1/lending/union/purchaseRecord
getRedemptionRecord()🔐GETsapi/v1/lending/union/redemptionRecord
getInterestHistory()🔐GETsapi/v1/lending/union/interestHistory
changeFixedAndActivityPositionToDailyPosition()🔐POSTsapi/v1/lending/positionChanged
enableConvertSubAccount()🔐POSTsapi/v1/broker/subAccount/convert
convertBUSD()🔐POSTsapi/v1/asset/convert-transfer
getConvertBUSDHistory()🔐GETsapi/v1/asset/convert-transfer/queryByPage

usdm-client.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in usdm-client.ts.

FunctionAUTHHTTP MethodEndpoint
testConnectivity()GETfapi/v1/ping
getExchangeInfo()GETfapi/v1/exchangeInfo
getOrderBook()GETfapi/v1/depth
getRpiOrderBook()GETfapi/v1/rpiDepth
getRecentTrades()GETfapi/v1/trades
getHistoricalTrades()GETfapi/v1/historicalTrades
getAggregateTrades()GETfapi/v1/aggTrades
getKlines()GETfapi/v1/klines
getContinuousContractKlines()GETfapi/v1/continuousKlines
getIndexPriceKlines()GETfapi/v1/indexPriceKlines
getMarkPriceKlines()GETfapi/v1/markPriceKlines
getPremiumIndexKlines()GETfapi/v1/premiumIndexKlines
getMarkPrice()GETfapi/v1/premiumIndex
getFundingRateHistory()GETfapi/v1/fundingRate
getFundingRates()GETfapi/v1/fundingInfo
get24hrChangeStatistics()GETfapi/v1/ticker/24hr
getSymbolPriceTicker()GETfapi/v1/ticker/price
getSymbolPriceTickerV2()GETfapi/v2/ticker/price
getSymbolOrderBookTicker()GETfapi/v1/ticker/bookTicker
getQuarterlyContractSettlementPrices()GETfutures/data/delivery-price
getOpenInterest()GETfapi/v1/openInterest
getOpenInterestStatistics()GETfutures/data/openInterestHist
getTopTradersLongShortPositionRatio()GETfutures/data/topLongShortPositionRatio
getTopTradersLongShortAccountRatio()GETfutures/data/topLongShortAccountRatio
getGlobalLongShortAccountRatio()GETfutures/data/globalLongShortAccountRatio
getTakerBuySellVolume()GETfutures/data/takerlongshortRatio
getHistoricalBlvtNavKlines()GETfapi/v1/lvtKlines
getCompositeSymbolIndex()GETfapi/v1/indexInfo
getMultiAssetsModeAssetIndex()GETfapi/v1/assetIndex
getBasis()GETfutures/data/basis
getIndexPriceConstituents()GETfapi/v1/constituents
getInsuranceFundBalance()GETfapi/v1/insuranceBalance
getTradingSchedule()GETfapi/v1/tradingSchedule
submitNewOrder()🔐POSTfapi/v1/order
submitMultipleOrders()🔐POSTfapi/v1/batchOrders
modifyOrder()🔐PUTfapi/v1/order
modifyMultipleOrders()🔐PUTfapi/v1/batchOrders
getOrderModifyHistory()🔐GETfapi/v1/orderAmendment
cancelOrder()🔐DELETEfapi/v1/order
cancelMultipleOrders()🔐DELETEfapi/v1/batchOrders
cancelAllOpenOrders()🔐DELETEfapi/v1/allOpenOrders
setCancelOrdersOnTimeout()🔐POSTfapi/v1/countdownCancelAll
getOrder()🔐GETfapi/v1/order
getAllOrders()🔐GETfapi/v1/allOrders
getAllOpenOrders()🔐GETfapi/v1/openOrders
getCurrentOpenOrder()🔐GETfapi/v1/openOrder
getForceOrders()🔐GETfapi/v1/forceOrders
getAccountTrades()🔐GETfapi/v1/userTrades
setMarginType()🔐POSTfapi/v1/marginType
setPositionMode()🔐POSTfapi/v1/positionSide/dual
setLeverage()🔐POSTfapi/v1/leverage
setMultiAssetsMode()🔐POSTfapi/v1/multiAssetsMargin
setIsolatedPositionMargin()🔐POSTfapi/v1/positionMargin
getPositions()🔐GETfapi/v2/positionRisk
getPositionsV3()🔐GETfapi/v3/positionRisk
getADLQuantileEstimation()🔐GETfapi/v1/adlQuantile
getSymbolAdlRisk()GETfapi/v1/symbolAdlRisk
getPositionMarginChangeHistory()🔐GETfapi/v1/positionMargin/history
getBalanceV3()🔐GETfapi/v3/balance
getBalance()🔐GETfapi/v2/balance
getAccountInformationV3()🔐GETfapi/v3/account
getAccountInformation()🔐GETfapi/v2/account
getAccountCommissionRate()🔐GETfapi/v1/commissionRate
getFuturesAccountConfig()🔐GETfapi/v1/accountConfig
getFuturesSymbolConfig()🔐GETfapi/v1/symbolConfig
getUserForceOrders()🔐GETfapi/v1/rateLimit/order
getNotionalAndLeverageBrackets()🔐GETfapi/v1/leverageBracket
getMultiAssetsMode()🔐GETfapi/v1/multiAssetsMargin
getCurrentPositionMode()🔐GETfapi/v1/positionSide/dual
getIncomeHistory()🔐GETfapi/v1/income
getApiQuantitativeRulesIndicators()🔐GETfapi/v1/apiTradingStatus
getFuturesTransactionHistoryDownloadId()🔐GETfapi/v1/income/asyn
getFuturesTransactionHistoryDownloadLink()🔐GETfapi/v1/income/asyn/id
getFuturesOrderHistoryDownloadId()🔐GETfapi/v1/order/asyn
getFuturesOrderHistoryDownloadLink()🔐GETfapi/v1/order/asyn/id
getFuturesTradeHistoryDownloadId()🔐GETfapi/v1/trade/asyn
getFuturesTradeDownloadLink()🔐GETfapi/v1/trade/asyn/id
setBNBBurnEnabled()🔐POSTfapi/v1/feeBurn
getBNBBurnStatus()🔐GETfapi/v1/feeBurn
signTradFiPerpsAgreement()🔐POSTfapi/v1/stock/contract
testOrder()🔐POSTfapi/v1/order/test
submitNewAlgoOrder()🔐POSTfapi/v1/algoOrder
cancelAlgoOrder()🔐DELETEfapi/v1/algoOrder
cancelAllAlgoOpenOrders()🔐DELETEfapi/v1/algoOpenOrders
getAlgoOrder()🔐GETfapi/v1/algoOrder
getOpenAlgoOrders()🔐GETfapi/v1/openAlgoOrders
getAllAlgoOrders()🔐GETfapi/v1/allAlgoOrders
getAllConvertPairs()GETfapi/v1/convert/exchangeInfo
submitConvertQuoteRequest()🔐POSTfapi/v1/convert/getQuote
acceptConvertQuote()🔐POSTfapi/v1/convert/acceptQuote
getConvertOrderStatus()🔐GETfapi/v1/convert/orderStatus
getPortfolioMarginProAccountInfo()🔐GETfapi/v1/pmAccountInfo
getBrokerIfNewFuturesUser()🔐GETfapi/v1/apiReferral/ifNewUser
setBrokerCustomIdForClient()🔐POSTfapi/v1/apiReferral/customization
getBrokerClientCustomIds()🔐GETfapi/v1/apiReferral/customization
getBrokerUserCustomId()🔐GETfapi/v1/apiReferral/userCustomization
getBrokerRebateDataOverview()🔐GETfapi/v1/apiReferral/overview
getBrokerUserTradeVolume()🔐GETfapi/v1/apiReferral/tradeVol
getBrokerRebateVolume()🔐GETfapi/v1/apiReferral/rebateVol
getBrokerTradeDetail()🔐GETfapi/v1/apiReferral/traderSummary
getFuturesUserDataListenKey()POSTfapi/v1/listenKey
keepAliveFuturesUserDataListenKey()PUTfapi/v1/listenKey
closeFuturesUserDataListenKey()DELETEfapi/v1/listenKey

coinm-client.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in coinm-client.ts.

FunctionAUTHHTTP MethodEndpoint
testConnectivity()GETdapi/v1/ping
getExchangeInfo()GETdapi/v1/exchangeInfo
getOrderBook()GETdapi/v1/depth
getRecentTrades()GETdapi/v1/trades
getHistoricalTrades()GETdapi/v1/historicalTrades
getAggregateTrades()GETdapi/v1/aggTrades
getMarkPrice()GETdapi/v1/premiumIndex
getFundingRateHistory()GETdapi/v1/fundingRate
getFundingRate()GETdapi/v1/fundingInfo
getKlines()GETdapi/v1/klines
getContinuousContractKlines()GETdapi/v1/continuousKlines
getIndexPriceKlines()GETdapi/v1/indexPriceKlines
getMarkPriceKlines()GETdapi/v1/markPriceKlines
getPremiumIndexKlines()GETdapi/v1/premiumIndexKlines
get24hrChangeStatistics()GETdapi/v1/ticker/24hr
getSymbolPriceTicker()GETdapi/v1/ticker/price
getSymbolOrderBookTicker()GETdapi/v1/ticker/bookTicker
getOpenInterest()GETdapi/v1/openInterest
getOpenInterestStatistics()GETfutures/data/openInterestHist
getTopTradersLongShortAccountRatio()GETfutures/data/topLongShortAccountRatio
getTopTradersLongShortPositionRatio()GETfutures/data/topLongShortPositionRatio
getGlobalLongShortAccountRatio()GETfutures/data/globalLongShortAccountRatio
getTakerBuySellVolume()GETfutures/data/takerBuySellVol
getCompositeSymbolIndex()GETfutures/data/basis
getIndexPriceConstituents()GETdapi/v1/constituents
getQuarterlyContractSettlementPrices()GETfutures/data/delivery-price
submitNewOrder()🔐POSTdapi/v1/order
submitMultipleOrders()🔐POSTdapi/v1/batchOrders
modifyOrder()🔐PUTdapi/v1/order
modifyMultipleOrders()🔐PUTdapi/v1/batchOrders
getOrderModifyHistory()🔐GETdapi/v1/orderAmendment
cancelOrder()🔐DELETEdapi/v1/order
cancelMultipleOrders()🔐DELETEdapi/v1/batchOrders
cancelAllOpenOrders()🔐DELETEdapi/v1/allOpenOrders
setCancelOrdersOnTimeout()🔐POSTdapi/v1/countdownCancelAll
getOrder()🔐GETdapi/v1/order
getAllOrders()🔐GETdapi/v1/allOrders
getAllOpenOrders()🔐GETdapi/v1/openOrders
getCurrentOpenOrder()🔐GETdapi/v1/openOrder
getForceOrders()🔐GETdapi/v1/forceOrders
getAccountTrades()🔐GETdapi/v1/userTrades
getPositions()🔐GETdapi/v1/positionRisk
setPositionMode()🔐POSTdapi/v1/positionSide/dual
setMarginType()🔐POSTdapi/v1/marginType
setLeverage()🔐POSTdapi/v1/leverage
getADLQuantileEstimation()🔐GETdapi/v1/adlQuantile
setIsolatedPositionMargin()🔐POSTdapi/v1/positionMargin
getPositionMarginChangeHistory()🔐GETdapi/v1/positionMargin/history
getBalance()🔐GETdapi/v1/balance
getAccountCommissionRate()🔐GETdapi/v1/commissionRate
getAccountInformation()🔐GETdapi/v1/account
getNotionalAndLeverageBrackets()🔐GETdapi/v2/leverageBracket
getCurrentPositionMode()🔐GETdapi/v1/positionSide/dual
getIncomeHistory()🔐GETdapi/v1/income
getDownloadIdForFuturesTransactionHistory()🔐GETdapi/v1/income/asyn
getFuturesTransactionHistoryDownloadLink()🔐GETdapi/v1/income/asyn/id
getDownloadIdForFuturesOrderHistory()🔐GETdapi/v1/order/asyn
getFuturesOrderHistoryDownloadLink()🔐GETdapi/v1/order/asyn/id
getDownloadIdForFuturesTradeHistory()🔐GETdapi/v1/trade/asyn
getFuturesTradeHistoryDownloadLink()🔐GETdapi/v1/trade/asyn/id
getClassicPortfolioMarginAccount()🔐GETdapi/v1/pmAccountInfo
getClassicPortfolioMarginNotionalLimits()🔐GETdapi/v1/pmExchangeInfo
getBrokerIfNewFuturesUser()🔐GETdapi/v1/apiReferral/ifNewUser
setBrokerCustomIdForClient()🔐POSTdapi/v1/apiReferral/customization
getBrokerClientCustomIds()🔐GETdapi/v1/apiReferral/customization
getBrokerUserCustomId()🔐GETdapi/v1/apiReferral/userCustomization
getBrokerRebateDataOverview()🔐GETdapi/v1/apiReferral/overview
getBrokerUserTradeVolume()🔐GETdapi/v1/apiReferral/tradeVol
getBrokerRebateVolume()🔐GETdapi/v1/apiReferral/rebateVol
getBrokerTradeDetail()🔐GETdapi/v1/apiReferral/traderSummary
getFuturesUserDataListenKey()POSTdapi/v1/listenKey
keepAliveFuturesUserDataListenKey()PUTdapi/v1/listenKey
closeFuturesUserDataListenKey()DELETEdapi/v1/listenKey

portfolio-client.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in portfolio-client.ts.

FunctionAUTHHTTP MethodEndpoint
testConnectivity()GETpapi/v1/ping
signTradFiPerpsContract()🔐POSTpapi/v1/um/stock/contract
submitNewUMOrder()🔐POSTpapi/v1/um/order
submitNewUMConditionalOrder()🔐POSTpapi/v1/um/conditional/order
submitNewUMAlgoOrder()🔐POSTpapi/v1/um/algo/order
submitNewCMOrder()🔐POSTpapi/v1/cm/order
submitNewCMConditionalOrder()🔐POSTpapi/v1/cm/conditional/order
submitNewMarginOrder()🔐POSTpapi/v1/margin/order
submitMarginLoan()🔐POSTpapi/v1/marginLoan
submitMarginRepay()🔐POSTpapi/v1/repayLoan
submitNewMarginOCO()🔐POSTpapi/v1/margin/order/oco
cancelUMOrder()🔐DELETEpapi/v1/um/order
cancelAllUMOrders()🔐DELETEpapi/v1/um/allOpenOrders
cancelUMConditionalOrder()🔐DELETEpapi/v1/um/conditional/order
cancelUMAlgoOrder()🔐DELETEpapi/v1/um/algo/order
cancelAllUMConditionalOrders()🔐DELETEpapi/v1/um/conditional/allOpenOrders
cancelAllUMAlgoOpenOrders()🔐DELETEpapi/v1/um/algo/allOpenOrders
cancelCMOrder()🔐DELETEpapi/v1/cm/order
cancelAllCMOrders()🔐DELETEpapi/v1/cm/allOpenOrders
cancelCMConditionalOrder()🔐DELETEpapi/v1/cm/conditional/order
cancelAllCMConditionalOrders()🔐DELETEpapi/v1/cm/conditional/allOpenOrders
cancelMarginOrder()🔐DELETEpapi/v1/margin/order
cancelMarginOCO()🔐DELETEpapi/v1/margin/orderList
cancelAllMarginOrders()🔐DELETEpapi/v1/margin/allOpenOrders
modifyUMOrder()🔐PUTpapi/v1/um/order
modifyCMOrder()🔐PUTpapi/v1/cm/order
getUMOrder()🔐GETpapi/v1/um/order
getAllUMOrders()🔐GETpapi/v1/um/allOrders
getUMOpenOrder()🔐GETpapi/v1/um/openOrder
getAllUMOpenOrders()🔐GETpapi/v1/um/openOrders
getAllUMConditionalOrders()🔐GETpapi/v1/um/conditional/allOrders
getAllUMAlgoOrders()🔐GETpapi/v1/um/algo/allAlgoOrders
getUMOpenConditionalOrders()🔐GETpapi/v1/um/conditional/openOrders
getUMAlgoOpenOrders()🔐GETpapi/v1/um/algo/openAlgoOrders
getUMOpenConditionalOrder()🔐GETpapi/v1/um/conditional/openOrder
getUMAlgoOrder()🔐GETpapi/v1/um/algo/algoOrder
getUMConditionalOrderHistory()🔐GETpapi/v1/um/conditional/orderHistory
getCMOrder()🔐GETpapi/v1/cm/order
getAllCMOrders()🔐GETpapi/v1/cm/allOrders
getCMOpenOrder()🔐GETpapi/v1/cm/openOrder
getAllCMOpenOrders()🔐GETpapi/v1/cm/openOrders
getCMOpenConditionalOrders()🔐GETpapi/v1/cm/conditional/openOrders
getCMOpenConditionalOrder()🔐GETpapi/v1/cm/conditional/openOrder
getAllCMConditionalOrders()🔐GETpapi/v1/cm/conditional/allOrders
getCMConditionalOrderHistory()🔐GETpapi/v1/cm/conditional/orderHistory
getUMForceOrders()🔐GETpapi/v1/um/forceOrders
getCMForceOrders()🔐GETpapi/v1/cm/forceOrders
getUMOrderModificationHistory()🔐GETpapi/v1/um/orderAmendment
getCMOrderModificationHistory()🔐GETpapi/v1/cm/orderAmendment
getMarginForceOrders()🔐GETpapi/v1/margin/forceOrders
getUMTrades()🔐GETpapi/v1/um/userTrades
getCMTrades()🔐GETpapi/v1/cm/userTrades
getUMADLQuantile()🔐GETpapi/v1/um/adlQuantile
getCMADLQuantile()🔐GETpapi/v1/cm/adlQuantile
toggleUMFeeBurn()🔐POSTpapi/v1/um/feeBurn
getUMFeeBurnStatus()🔐GETpapi/v1/um/feeBurn
getMarginOrder()🔐GETpapi/v1/margin/order
getMarginOpenOrders()🔐GETpapi/v1/margin/openOrders
getAllMarginOrders()🔐GETpapi/v1/margin/allOrders
getMarginOCO()🔐GETpapi/v1/margin/orderList
getAllMarginOCO()🔐GETpapi/v1/margin/allOrderList
getMarginOpenOCO()🔐GETpapi/v1/margin/openOrderList
getMarginTrades()🔐GETpapi/v1/margin/myTrades
repayMarginDebt()🔐POSTpapi/v1/margin/repay-debt
getBalance()🔐GETpapi/v1/balance
getAccountInfo()🔐GETpapi/v1/account
getMarginMaxBorrow()🔐GETpapi/v1/margin/maxBorrowable
getMarginMaxWithdraw()🔐GETpapi/v1/margin/maxWithdraw
getUMPosition()🔐GETpapi/v1/um/positionRisk
getCMPosition()🔐GETpapi/v1/cm/positionRisk
updateUMLeverage()🔐POSTpapi/v1/um/leverage
updateCMLeverage()🔐POSTpapi/v1/cm/leverage
updateUMPositionMode()🔐POSTpapi/v1/um/positionSide/dual
updateCMPositionMode()🔐POSTpapi/v1/cm/positionSide/dual
getUMPositionMode()🔐GETpapi/v1/um/positionSide/dual
getCMPositionMode()🔐GETpapi/v1/cm/positionSide/dual
getUMLeverageBrackets()🔐GETpapi/v1/um/leverageBracket
getCMLeverageBrackets()🔐GETpapi/v1/cm/leverageBracket
getUMTradingStatus()🔐GETpapi/v1/um/apiTradingStatus
getUMCommissionRate()🔐GETpapi/v1/um/commissionRate
getCMCommissionRate()🔐GETpapi/v1/cm/commissionRate
getMarginLoanRecords()🔐GETpapi/v1/margin/marginLoan
getMarginRepayRecords()🔐GETpapi/v1/margin/repayLoan
getAutoRepayFuturesStatus()🔐GETpapi/v1/repay-futures-switch
updateAutoRepayFuturesStatus()🔐POSTpapi/v1/repay-futures-switch
getMarginInterestHistory()🔐GETpapi/v1/margin/marginInterestHistory
repayFuturesNegativeBalance()🔐POSTpapi/v1/repay-futures-negative-balance
getPortfolioNegativeBalanceInterestHistory()🔐GETpapi/v1/portfolio/interest-history
autoCollectFunds()🔐POSTpapi/v1/auto-collection
transferAssetFuturesMargin()🔐POSTpapi/v1/asset-collection
transferBNB()🔐POSTpapi/v1/bnb-transfer
getUMIncomeHistory()🔐GETpapi/v1/um/income
getCMIncomeHistory()🔐GETpapi/v1/cm/income
getUMAccount()🔐GETpapi/v1/um/account
getCMAccount()🔐GETpapi/v1/cm/account
getUMAccountConfig()🔐GETpapi/v1/um/accountConfig
getUMSymbolConfig()🔐GETpapi/v1/um/symbolConfig
getUMAccountV2()🔐GETpapi/v2/um/account
getUMTradeHistoryDownloadId()🔐GETpapi/v1/um/trade/asyn
getUMTradeDownloadLink()🔐GETpapi/v1/um/trade/asyn/id
getUMOrderHistoryDownloadId()🔐GETpapi/v1/um/order/asyn
getUMOrderDownloadLink()🔐GETpapi/v1/um/order/asyn/id
getUMTransactionHistoryDownloadId()🔐GETpapi/v1/um/income/asyn
getUMTransactionDownloadLink()🔐GETpapi/v1/um/income/asyn/id
getPMUserDataListenKey()POSTpapi/v1/listenKey
keepAlivePMUserDataListenKey()PUTpapi/v1/listenKey
closePMUserDataListenKey()DELETEpapi/v1/listenKey

websocket-api-client.ts

This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in websocket-api-client.ts.

This client provides WebSocket API endpoints which allow for faster interactions with the Binance API via a WebSocket connection.

FunctionAUTHHTTP MethodEndpoint
disconnectAll()WSping
testSpotConnectivity()WSping
getSpotServerTime()WStime
getSpotExchangeInfo()WSexchangeInfo
getSpotOrderBook()WSdepth
getSpotRecentTrades()WStrades.recent
getSpotHistoricalTrades()WStrades.historical
getSpotAggregateTrades()WStrades.aggregate
getSpotKlines()WSklines
getSpotUIKlines()WSuiKlines
getSpotAveragePrice()WSavgPrice
getSpotExecutionRules()WSexecutionRules
getSpotReferencePrice()WSreferencePrice
getSpotReferencePriceCalculation()WSreferencePrice.calculation
getSpot24hrTicker()WSticker.24hr
getSpotTradingDayTicker()WSticker.tradingDay
getSpotTicker()WSticker
getSpotSymbolPriceTicker()WSticker.price
getSpotSymbolOrderBookTicker()WSticker.book
getSpotSessionStatus()WSsession.status
submitNewSpotOrder()WSorder.place
testSpotOrder()WSorder.test
getSpotOrderStatus()WSorder.status
cancelSpotOrder()WSorder.cancel
cancelReplaceSpotOrder()WSorder.cancelReplace
amendSpotOrderKeepPriority()WSorder.amend.keepPriority
getSpotOpenOrders()WSopenOrders.status
cancelAllSpotOpenOrders()WSopenOrders.cancelAll
placeSpotOrderList()WSorderList.place
placeSpotOCOOrderList()WSorderList.place.oco
placeSpotOTOOrderList()WSorderList.place.oto
placeSpotOTOCOOrderList()WSorderList.place.otoco
placeSpotOPOOrderList()WSorderList.place.opo
placeSpotOPOCOOrderList()WSorderList.place.opoco
getSpotOrderListStatus()WSorderList.status
cancelSpotOrderList()WSorderList.cancel
getSpotOpenOrderLists()WSopenOrderLists.status
placeSpotSOROrder()WSsor.order.place
testSpotSOROrder()WSsor.order.test
getSpotAccountInformation()WSaccount.status
getSpotOrderRateLimits()WSaccount.rateLimits.orders
getSpotAllOrders()WSallOrders
getSpotAllOrderLists()WSallOrderLists
getSpotMyTrades()WSmyTrades
getSpotPreventedMatches()WSmyPreventedMatches
getSpotAllocations()WSmyAllocations
getSpotAccountCommission()WSaccount.commission
getFuturesOrderBook()WSdepth
getFuturesSymbolPriceTicker()WSticker.price
getFuturesSymbolOrderBookTicker()WSticker.book
submitNewFuturesOrder()WSorder.place
modifyFuturesOrder()WSorder.modify
cancelFuturesOrder()WSorder.cancel
getFuturesOrderStatus()WSorder.status
getFuturesPositionV2()WSv2/account.position
getFuturesPosition()WSaccount.position
submitNewFuturesAlgoOrder()WSalgoOrder.place
cancelFuturesAlgoOrder()WSalgoOrder.cancel
getFuturesAccountBalanceV2()WSv2/account.balance
getFuturesAccountBalance()WSaccount.balance
getFuturesAccountStatusV2()WSv2/account.status
getFuturesAccountStatus()WSaccount.status
startUserDataStreamForKey()WSuserDataStream.start
pingUserDataStreamForKey()WSuserDataStream.ping
stopUserDataStreamForKey()WSuserDataStream.stop
subscribeUserDataStream()WSuserDataStream.unsubscribe
unsubscribeUserDataStream()WSuserDataStream.unsubscribe

Source: View endpoint map source

Binance JavaScript FAQ

What does the Binance JavaScript SDK cover?

Binance supports Spot, Futures, Margin, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.

How do I authenticate private Binance API calls in JavaScript?

Install binance from npm & pass API credentials into the SDK client options, as shown in the Binance JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.

Does the Binance JavaScript SDK help with WebSocket connection management?

Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.

When should I use the Binance WebSocket API instead of REST?

Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.

Direct Example Files

Open the example files below if you want the clearest general-purpose starting point for REST API, WebSocket, and authentication workflows in plain JavaScript.

Reference Links