Bitget JavaScript SDK
Build with the Bitget REST API & WebSockets with our JavaScript SDK, TypeScript-first package declarations, and Node.js-compatible runtime patterns. Discover installation, common examples, a detailed endpoint-to-function map, and the REST API/WebSocket patterns shared across our Siebly SDK family.
Use the same TypeScript-first REST API and WebSocket clients from plain JavaScript or TypeScript in Node.js-compatible runtimes.
Package surfaces
Explore the following API capabilities are covered by our Bitget SDK:
- Spot
- Copy
- Futures
- WebSockets
- WebSocket clients with:
- Built-in heartbeats.
- Automatic reconnection.
- Automatic reauthentication and resubscribe where the exchange supports it.
- Typed requests and responses for Node.js, JavaScript, and TypeScript IDEs.
- Framework-neutral JavaScript snippets that stay approachable in Node.js-compatible runtimes.
- TypeScript-first package declarations for stricter services, shared libraries, and editor-assisted integrations.
Install Bitget SDK
# Via your favourite package manager, e.g. npm:
npm install bitget-api
# or pnpm:
pnpm install bitget-api
# or yarn:
yarn add bitget-apiQuickstart Examples with the Bitget JavaScript SDK
Get started with just a few lines of JavaScript. TypeScript, while not required, is absolutely recommended. TypeScript declarations are included with all our SDKs and provide convenient definitions on request & response fields, WebSocket payloads, and generally safer integrations.
REST walkthrough
Easily start calling Bitget's V2 spot REST APIs in JavaScript.
- Install the Bitget JavaScript SDK via NPM:
npm install bitget-api. - Import the RestClientV2 class (REST API wrapper for Bitget's V2 APIs) and WebsocketClientV2.
- Note: for Bitget's V3 (UTA) APIs, you can use RestClientV3 and WebsocketClientV3 instead. Examples can be found on GitHub.
- Create client instances with your API credentials (different key types are automatically detected & handled).
- Call REST API methods as functions and await the promise containing the response.
In this example, we:
- Open a private WebSocket connection and subscribe to account and order updates for spot.
- Query account spot balances and find the available BTC balance.
- Query symbol trading rules for
BTCUSDTand select the minimum trade quantity. - Submit a market sell order using that quantity and log the response.
This setup demonstrates using REST and private WebSocket streams together, so you can place trades while receiving live account updates at the same time.
For a full map of available REST API methods, check out the endpoint reference below.
import { RestClientV2, SpotOrderRequestV2, WebsocketClientV2,} from 'bitget-api'; // read from environmental variablesconst API_KEY = process.env.API_KEY_COM;const API_SECRET = process.env.API_SECRET_COM;const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such:// API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/rest-trade-spot.ts // note the single quotes, preventing special characters such as $ from being incorrectly passed const client = new RestClientV2({ apiKey: API_KEY, apiSecret: API_SECRET, apiPass: API_PASS, // apiKey: 'apiKeyHere', // apiSecret: 'apiSecretHere', // apiPass: 'apiPassHere',}); const wsClient = new WebsocketClientV2({ apiKey: API_KEY, apiSecret: API_SECRET, apiPass: API_PASS,}); function logWSEvent(type: string, data: any) { console.log(new Date(), `WS ${type} event: `, data);} // simple sleep functionfunction promiseSleep(milliseconds: number) { return new Promise((resolve) => setTimeout(resolve, milliseconds));} /** This is a simple script wrapped in a immediately invoked function expression, designed to check for any available BTC balance and immediately sell the full amount for USDT */(async () => { try { // Add event listeners to log websocket events on account wsClient.on('update', (data) => logWSEvent('update', data)); wsClient.on('open', (data) => logWSEvent('open', data)); wsClient.on('response', (data) => logWSEvent('response', data)); wsClient.on('reconnect', (data) => logWSEvent('reconnect', data)); wsClient.on('reconnected', (data) => logWSEvent('reconnected', data)); wsClient.on('authenticated', (data) => logWSEvent('authenticated', data)); wsClient.on('exception', (data) => logWSEvent('exception', data)); // Subscribe to private account topics // spot private // : account updates wsClient.subscribeTopic('SPOT', 'account'); // : order updates (note: symbol is required) wsClient.subscribeTopic('SPOT', 'orders', 'BTCUSDT'); // wait briefly for ws to be ready (could also use the response or authenticated events, to make sure topics are subscribed to before starting) await promiseSleep(2.5 * 1000); const balanceResult = await client.getSpotAccountAssets(); const allBalances = balanceResult.data; const balanceBTC = allBalances.find( (bal) => bal.coin === 'BTC' || bal.coin === 'btc', ); const btcAmount = balanceBTC ? Number(balanceBTC.available) : 0; // console.log('balance: ', JSON.stringify(balances, null, 2)); console.log('BTC balance result: ', balanceBTC); if (!btcAmount) { console.error('No BTC to trade'); return; } console.log(`BTC available: ${btcAmount}`); const symbol = 'BTCUSDT'; const symbolsResult = await client.getSpotSymbolInfo(); const btcRules = symbolsResult.data.find((rule) => rule.symbol === symbol); console.log('btc trading rules: ', btcRules); if (!btcRules) { return console.log('no rules found for trading ' + symbol); } const quantity = btcRules.minTradeAmount; const order: SpotOrderRequestV2 = { symbol: symbol, side: 'sell', orderType: 'market', force: 'gtc', size: quantity, } as const; console.log('submitting order: ', order); const sellResult = await client.spotSubmitOrder(order); console.log('sell result: ', sellResult); } catch (e) { console.error('request failed: ', e); }})();WebSocket walkthrough
Connecting to Bitget's V3 (UTA) private WebSocket streams is straightforward with the WebsocketClientV3.
- Install the Bitget JavaScript SDK via NPM:
npm install bitget-api. - Import the WebsocketClientV3 and WS_KEY_MAP utilities.
- Create an authenticated WebsocketClientV3 instance with your API credentials.
- Configure event handlers for key events such as
update,response,reconnect,reconnected, andexception. - Subscribe to private topics and handle incoming account events in real time.
In this example, we:
- Subscribe to private account events on the UTA connection.
- Subscribe to
account,position,fill, andordertopics in a single batched request. - Inspect currently tracked private subscriptions after a short delay.
This setup allows you to receive real-time account activity updates without polling REST endpoints.
import { DefaultLogger, WebsocketClientV3, WS_KEY_MAP } from 'bitget-api'; (async () => { const logger = { ...DefaultLogger, trace: (...params: any[]) => console.log('trace', ...params), }; const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: // API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts const wsClient = new WebsocketClientV3( { apiKey: API_KEY, apiSecret: API_SECRET, apiPass: API_PASS, }, logger, ); wsClient.on('update', (data) => { console.log('WS raw message received ', data); // console.log('WS raw message received ', JSON.stringify(data, null, 2)); }); wsClient.on('open', (data) => { console.log('WS connection opened:', data.wsKey); }); wsClient.on('response', (data) => { console.log('WS response: ', JSON.stringify(data, null, 2)); }); wsClient.on('reconnect', ({ wsKey }) => { console.log('WS automatically reconnecting.... ', wsKey); }); wsClient.on('reconnected', (data) => { console.log('WS reconnected ', data?.wsKey); }); wsClient.on('exception', (data) => { console.log('WS error', data); }); // You can subscribe to one topic at a time wsClient.subscribe( { topic: 'account', payload: { instType: 'UTA', // Note: all account events go on the UTA instType }, }, WS_KEY_MAP.v3Private, // This parameter points to private or public ); // Note: all account events go on the UTA instType const ACCOUNT_INST_TYPE = 'UTA'; const ACCOUNT_WS_KEY = WS_KEY_MAP.v3Private; // Or multiple at once: wsClient.subscribe( [ { topic: 'account', payload: { instType: ACCOUNT_INST_TYPE, }, }, { topic: 'position', payload: { instType: ACCOUNT_INST_TYPE, }, }, { topic: 'fill', payload: { instType: ACCOUNT_INST_TYPE, }, }, { topic: 'order', payload: { instType: ACCOUNT_INST_TYPE, }, }, ], ACCOUNT_WS_KEY, ); // Topics are tracked per websocket type // The below example will pull a list of subscribed topics on that connection (e.g. all private topics), after a 5 second delay: setTimeout(() => { const privateTopics = wsClient.getWsStore().getTopics(WS_KEY_MAP.v3Private); console.log('private topics currently in state: ', privateTopics); }, 5 * 1000);})();WebSocket API walkthrough
Bitget's V3 (UTA) WebSocket API (WS-API) lets you send trading commands over a persistent, authenticated WebSocket connection, reducing overhead compared to separate REST requests.
The SDK's WebsocketAPIClient wraps this flow in promise-based helper methods, so each WS-API request can be awaited like a regular API call.
To use the WebSocket API:
- Install the Bitget JavaScript SDK via NPM:
npm install bitget-api. - Import the dedicated WebsocketAPIClient.
- Create an authenticated WebsocketAPIClient instance with your API credentials.
- Optionally call
connectWSAPI()before submitting commands to warm up the connection. - Call dedicated WS-API methods and await their responses.
In this example, we:
- Submit a new spot order.
- Submit a batch of spot orders.
- Cancel a single order.
- Cancel a batch of orders.
Note that:
- This requires Bitget V3/UTA API credentials.
- Responses are logged per operation, with errors handled in separate
try/catchblocks. - For batch endpoints, inspect per-order result codes in the response payload.
import { DefaultLogger, WebsocketAPIClient } from 'bitget-api'; // function attachEventHandlers<TWSClient extends WebsocketClientV3>(// wsClient: TWSClient,// ): void {// wsClient.on('update', (data) => {// console.log('raw message received ', JSON.stringify(data));// });// wsClient.on('open', (data) => {// console.log('ws connected', data.wsKey);// });// wsClient.on('reconnect', ({ 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);// });// } (async () => { const logger = { ...DefaultLogger, trace: (...params: any[]) => console.log('trace', ...params), }; const API_KEY = process.env.API_KEY_COM; const API_SECRET = process.env.API_SECRET_COM; const API_PASS = process.env.API_PASS_COM; // If running from CLI in unix, you can pass env vars as such: // API_KEY_COM='lkm12n3-2ba3-1mxf-fn13-lkm12n3a' API_SECRET_COM='035B2B9637E1BDFFEE2646BFBDDB8CE4' API_PASSPHRASE_COM='ComplexPa$$!23$5^' ts-node examples/ws-private.ts const wsClient = new WebsocketAPIClient( { apiKey: API_KEY, apiSecret: API_SECRET, apiPass: API_PASS, // Whether to use the demo trading wss connection // demoTrading: 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 }, logger, // Optional: inject a custom logger ); // Optional, see above "attachEventListeners". Attach basic event handlers, so nothing is left unhandled // attachEventHandlers(wsClient.getWSClient()); // Optional: prepare the WebSocket API connection in advance. // This happens automatically but you can do this early before making any API calls, to prevent delays from a cold start. await wsClient.getWSClient().connectWSAPI(); /** * Bitget's WebSocket API be used like a REST API, through this SDK's WebsocketAPIClient. The WebsocketAPIClient is a utility class wrapped around WebsocketClientV3's sendWSAPIRequest() capabilities. * * Each request sent via the WebsocketAPIClient will automatically: * - route via the active WS API connection * - return a Promise, which automatically resolves/rejects when a matching response is received * * Note: this requires V3/UTA API keys! */ /** * Place Order * https://www.bitget.com/api-doc/uta/websocket/private/Place-Order-Channel#request-parameters */ try { const res = await wsClient.submitNewOrder('spot', { orderType: 'limit', price: '100', qty: '0.1', side: 'buy', symbol: 'BTCUSDT', timeInForce: 'gtc', }); /** const res = { "event": "trade", "id": "1750034396082", "category": "spot", "topic": "place-order", "args": [ { "symbol": "BTCUSDT", "orderId": "xxxxxxxx", "clientOid": "xxxxxxxx", "cTime": "1750034397008" } ], "code": "0", "msg": "success", "ts": "1750034397076" }; */ console.log(new Date(), 'WS API "submitNewOrder()" result: ', res); } catch (e) { console.error(new Date(), 'Exception with WS API "submitNewOrder()": ', e); } /** * Batch Place Order Channel * https://www.bitget.com/api-doc/uta/websocket/private/Batch-Place-Order-Channel */ try { /** * Note: batch place will never reject the request, even if all orders were rejected. Check the "code" and "msg" properties for individual orders in the response, to detect batch place errors. */ const res = await wsClient.placeBatchOrders('spot', [ { clientOid: 'xxxxxxxx1', orderType: 'limit', price: '100', qty: '0.1', side: 'buy', symbol: 'BTCUSDT', timeInForce: 'gtc', }, { clientOid: 'xxxxxxxx2', orderType: 'limit', price: '100', qty: '0.15', side: 'buy', symbol: 'BTCUSDT', timeInForce: 'gtc', }, ]); /** const res = { "event": "trade", "id": "1750035029506", "category": "spot", "topic": "batch-place", "args": [ { "code": "0", "msg": "Success", "symbol": "BTCUSDT", "orderId": "xxxxxxxx", "clientOid": "xxxxxxxx" }, { "code": "0", "msg": "Success", "symbol": "BTCUSDT", "orderId": "xxxxxxxx", "clientOid": "xxxxxxxx" } ], "code": "0", "msg": "Success", "ts": "1750035029925" } */ console.log(new Date(), 'WS API "placeBatchOrders()" result: ', res); } catch (e) { console.error( new Date(), 'Exception with WS API "placeBatchOrders()": ', e, ); } /** * Cancel Order * https://www.bitget.com/api-doc/uta/websocket/private/Cancel-Order-Channel */ try { const res = await wsClient.cancelOrder('spot', { clientOid: 'xxxxxxxx1', }); /** const res = { "event": "trade", "id": "1750034870205", "topic": "cancel-order", "args": [ { "orderId": "xxxxxxxx", "clientOid": "xxxxxxxx" } ], "code": "0", "msg": "Success", "ts": "1750034870597" } */ console.log(new Date(), 'WS API "cancelOrder()" result: ', res); } catch (e) { console.error(new Date(), 'Exception with WS API "cancelOrder()": ', e); } /** * Batch Cancel Order * https://www.bitget.com/api-doc/uta/websocket/private/Batch-Cancel-Order-Channel */ try { const res = await wsClient.cancelBatchOrders('spot', [ { clientOid: 'xxxxxxxx1', }, { orderId: '123123123', }, ]); /** const res = { "event": "trade", "id": "bb553cc0-c1fa-454e-956d-c96c8d715760", "topic": "batch-cancel", "args": [ { "code": "0", "msg": "Success", "orderId": "xxxxxxxxxxxxx" }, { "code": "25204", "msg": "Order does not exist", "orderId": "xxxxxxxxxxxxx" } ], "code": "0", "msg": "Success", "ts": "1751980011084" } */ console.log(new Date(), 'WS API "cancelBatchOrders()" result: ', res); } catch (e) { console.error( new Date(), 'Exception with WS API "cancelBatchOrders()": ', e, ); } console.log(new Date(), 'Reached end of example.');})();Bitget API JavaScript Tutorial
A practical JavaScript guide to using bitget-api across Bitget V3/UTA REST, public and private streams, demo trading, WebSocket API commands, and V2/Classic fallback flows.
Your app / service
bot, dashboard, worker
bitget-api
RestClientV3, WebsocketClientV3, WebsocketAPIClient
Bitget APIs
V3/UTA REST, streams, WebSocket API, Classic fallbacks
Common Bitget implementation tasks
Start from the behavior you need, not just from REST or WebSocket as a transport. Market-data driven systems should be event driven. Backfill via the REST API once and let WebSockets passively stream new data to you, as it becomes available.
Bitget API tutorial
Use the focused tutorial for RestClientV3, UTA product values, private streams, demo trading, WebSocket API commands, and V2/Classic boundaries.
Open Bitget tutorialV3 private stream example
Use the private stream example for account, position, fill, and order topic subscriptions with instType set to UTA.
Open private stream exampleWebSocket API order example
Use the WebSocket API client example for promise-wrapped Bitget order placement, batch placement, cancellation, and batch cancellation.
Open WebSocket API exampleBackfill endpoint lookup
Use the endpoint reference to verify current V3 and Classic REST API method names, request shapes, response fields, and product-specific naming before coding.
Open endpoint referenceReconnect-safe consumer
Tell the agent to treat transport reconnect as separate from application correctness, then resync through REST before re-enabling event-driven workflows.
Open agent guidanceFor coding agents
Give these files to an agent before implementation so it can find the package, examples, task guidance, and safety rules from the normal SDK-page flow.
AI prompt framework
Prompt generator and task recipes for exchange API projects.
llms.txt
Compact discovery file for agents choosing where to start.
llms-full.txt
Full route and implementation guidance index for machine readers.
SDK catalog
Machine-readable package, docs, examples, and task guidance.
Agent skill
Reusable workflow rules for coding agents using exchange APIs.
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.
rest-client-v2.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in rest-client-v2.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getAnnouncements() | GET | /api/v2/public/annoucements | |
| getServerTime() | GET | /api/v2/public/time | |
| getTradeRate() | 🔐 | GET | /api/v2/common/trade-rate |
| getSpotTransactionRecords() | 🔐 | GET | /api/v2/tax/spot-record |
| getFuturesTransactionRecords() | 🔐 | GET | /api/v2/tax/future-record |
| getMarginTransactionRecords() | 🔐 | GET | /api/v2/tax/margin-record |
| getP2PTransactionRecords() | 🔐 | GET | /api/v2/tax/p2p-record |
| getP2PMerchantList() | 🔐 | GET | /api/v2/p2p/merchantList |
| getP2PMerchantInfo() | 🔐 | GET | /api/v2/p2p/merchantInfo |
| getP2PMerchantOrders() | 🔐 | GET | /api/v2/p2p/orderList |
| getP2PMerchantAdvertisementList() | 🔐 | GET | /api/v2/p2p/advList |
| getSpotWhaleNetFlowData() | 🔐 | GET | /api/v2/spot/market/whale-net-flow |
| getFuturesActiveTakerBuySellVolumeData() | GET | /api/v2/mix/market/taker-buy-sell | |
| getFuturesActiveLongShortPositionData() | GET | /api/v2/mix/market/position-long-short | |
| getFuturesLongShortRatio() | GET | /api/v2/mix/market/long-short-ratio | |
| getMarginLoanGrowthRate() | GET | /api/v2/mix/market/loan-growth | |
| getIsolatedMarginBorrowingRatio() | GET | /api/v2/mix/market/isolated-borrow-rate | |
| getFuturesActiveBuySellVolumeData() | GET | /api/v2/mix/market/long-short | |
| getSpotFundFlow() | GET | /api/v2/spot/market/fund-flow | |
| getTradeDataSupportSymbols() | GET | /api/v2/spot/market/support-symbols | |
| getSpotFundNetFlowData() | GET | /api/v2/spot/market/fund-net-flow | |
| getFuturesActiveLongShortAccountData() | GET | /api/v2/mix/market/account-long-short | |
| createVirtualSubaccount() | 🔐 | POST | /api/v2/user/create-virtual-subaccount |
| modifyVirtualSubaccount() | 🔐 | POST | /api/v2/user/modify-virtual-subaccount |
| batchCreateVirtualSubaccountAndAPIKey() | 🔐 | POST | /api/v2/user/batch-create-subaccount-and-apikey |
| getVirtualSubaccounts() | 🔐 | GET | /api/v2/user/virtual-subaccount-list |
| createVirtualSubaccountAPIKey() | 🔐 | POST | /api/v2/user/create-virtual-subaccount-apikey |
| modifyVirtualSubaccountAPIKey() | 🔐 | POST | /api/v2/user/modify-virtual-subaccount-apikey |
| getVirtualSubaccountAPIKeys() | 🔐 | GET | /api/v2/user/virtual-subaccount-apikey-list |
| createAgentSubaccount() | 🔐 | POST | /api/v2/user/create-agent-subaccount |
| getFundingAssets() | 🔐 | GET | /api/v2/account/funding-assets |
| getBotAccount() | 🔐 | GET | /api/v2/account/bot-assets |
| getBalances() | 🔐 | GET | /api/v2/account/all-account-balance |
| getConvertCoins() | 🔐 | GET | /api/v2/convert/currencies |
| getConvertQuotedPrice() | 🔐 | GET | /api/v2/convert/quoted-price |
| convert() | 🔐 | POST | /api/v2/convert/trade |
| getConvertHistory() | 🔐 | GET | /api/v2/convert/convert-record |
| getConvertBGBCoins() | 🔐 | GET | /api/v2/convert/bgb-convert-coin-list |
| convertBGB() | 🔐 | POST | /api/v2/convert/bgb-convert |
| getConvertBGBHistory() | 🔐 | GET | /api/v2/convert/bgb-convert-records |
| getSpotCoinInfo() | 🔐 | GET | /api/v2/spot/public/coins |
| getSpotSymbolInfo() | 🔐 | GET | /api/v2/spot/public/symbols |
| getSpotVIPFeeRate() | 🔐 | GET | /api/v2/spot/market/vip-fee-rate |
| getSpotTicker() | 🔐 | GET | /api/v2/spot/market/tickers |
| getSpotMergeDepth() | 🔐 | GET | /api/v2/spot/market/merge-depth |
| getSpotOrderBookDepth() | 🔐 | GET | /api/v2/spot/market/orderbook |
| getSpotCandles() | 🔐 | GET | /api/v2/spot/market/candles |
| getSpotHistoricCandles() | 🔐 | GET | /api/v2/spot/market/history-candles |
| getSpotRecentTrades() | 🔐 | GET | /api/v2/spot/market/fills |
| getSpotHistoricTrades() | 🔐 | GET | /api/v2/spot/market/fills-history |
| spotSubmitOrder() | 🔐 | POST | /api/v2/spot/trade/place-order |
| spotCancelandSubmitOrder() | 🔐 | POST | /api/v2/spot/trade/cancel-replace-order |
| spotBatchCancelandSubmitOrder() | 🔐 | POST | /api/v2/spot/trade/batch-cancel-replace-order |
| spotCancelOrder() | 🔐 | POST | /api/v2/spot/trade/cancel-order |
| spotBatchSubmitOrders() | 🔐 | POST | /api/v2/spot/trade/batch-orders |
| spotBatchCancelOrders() | 🔐 | POST | /api/v2/spot/trade/batch-cancel-order |
| spotCancelSymbolOrder() | 🔐 | POST | /api/v2/spot/trade/cancel-symbol-order |
| getSpotOrder() | 🔐 | GET | /api/v2/spot/trade/orderInfo |
| getSpotOpenOrders() | 🔐 | GET | /api/v2/spot/trade/unfilled-orders |
| getSpotHistoricOrders() | 🔐 | GET | /api/v2/spot/trade/history-orders |
| getSpotFills() | 🔐 | GET | /api/v2/spot/trade/fills |
| spotSubmitPlanOrder() | 🔐 | POST | /api/v2/spot/trade/place-plan-order |
| spotModifyPlanOrder() | 🔐 | POST | /api/v2/spot/trade/modify-plan-order |
| spotCancelPlanOrder() | 🔐 | POST | /api/v2/spot/trade/cancel-plan-order |
| getSpotCurrentPlanOrders() | 🔐 | GET | /api/v2/spot/trade/current-plan-order |
| getSpotPlanSubOrder() | 🔐 | GET | /api/v2/spot/trade/plan-sub-order |
| getSpotHistoricPlanOrders() | 🔐 | GET | /api/v2/spot/trade/history-plan-order |
| spotCancelPlanOrders() | 🔐 | POST | /api/v2/spot/trade/batch-cancel-plan-order |
| getSpotAccount() | 🔐 | GET | /api/v2/spot/account/info |
| getSpotAccountAssets() | 🔐 | GET | /api/v2/spot/account/assets |
| getSpotSubAccountAssets() | 🔐 | GET | /api/v2/spot/account/subaccount-assets |
| spotModifyDepositAccount() | 🔐 | POST | /api/v2/spot/wallet/modify-deposit-account |
| getSpotAccountBills() | 🔐 | GET | /api/v2/spot/account/bills |
| spotTransfer() | 🔐 | POST | /api/v2/spot/wallet/transfer |
| getSpotTransferableCoins() | 🔐 | GET | /api/v2/spot/wallet/transfer-coin-info |
| spotSubTransfer() | 🔐 | POST | /api/v2/spot/wallet/subaccount-transfer |
| spotWithdraw() | 🔐 | POST | /api/v2/spot/wallet/withdrawal |
| getSpotMainSubTransferRecord() | 🔐 | GET | /api/v2/spot/account/sub-main-trans-record |
| getSpotTransferHistory() | 🔐 | GET | /api/v2/spot/account/transferRecords |
| spotSwitchBGBDeduct() | 🔐 | POST | /api/v2/spot/account/switch-deduct |
| getSpotDepositAddress() | 🔐 | GET | /api/v2/spot/wallet/deposit-address |
| getSpotSubDepositAddress() | 🔐 | GET | /api/v2/spot/wallet/subaccount-deposit-address |
| getSpotBGBDeductInfo() | 🔐 | GET | /api/v2/spot/account/deduct-info |
| spotCancelWithdrawal() | 🔐 | POST | /api/v2/spot/wallet/cancel-withdrawal |
| getSubAccountDepositRecords() | 🔐 | GET | /api/v2/spot/wallet/subaccount-deposit-records |
| getSpotWithdrawalHistory() | 🔐 | GET | /api/v2/spot/wallet/withdrawal-records |
| getSpotDepositHistory() | 🔐 | GET | /api/v2/spot/wallet/deposit-records |
| upgradeToUnifiedAccount() | 🔐 | POST | /api/v2/spot/account/upgrade |
| getUnifiedAccountSwitchStatus() | 🔐 | GET | /api/v2/spot/account/upgrade-status |
| getFuturesVIPFeeRate() | GET | /api/v2/mix/market/vip-fee-rate | |
| getFuturesInterestRateHistory() | GET | /api/v2/mix/market/union-interest-rate-history | |
| getFuturesInterestExchangeRate() | GET | /api/v2/mix/market/exchange-rate | |
| getFuturesDiscountRate() | GET | /api/v2/mix/market/discount-rate | |
| getFuturesMergeDepth() | GET | /api/v2/mix/market/merge-depth | |
| getFuturesTicker() | GET | /api/v2/mix/market/ticker | |
| getFuturesAllTickers() | GET | /api/v2/mix/market/tickers | |
| getFuturesRecentTrades() | GET | /api/v2/mix/market/fills | |
| getFuturesHistoricTrades() | GET | /api/v2/mix/market/fills-history | |
| getFuturesCandles() | GET | /api/v2/mix/market/candles | |
| getFuturesHistoricCandles() | GET | /api/v2/mix/market/history-candles | |
| getFuturesHistoricIndexPriceCandles() | GET | /api/v2/mix/market/history-index-candles | |
| getFuturesHistoricMarkPriceCandles() | GET | /api/v2/mix/market/history-mark-candles | |
| getFuturesOpenInterest() | GET | /api/v2/mix/market/open-interest | |
| getFuturesNextFundingTime() | GET | /api/v2/mix/market/funding-time | |
| getFuturesSymbolPrice() | GET | /api/v2/mix/market/symbol-price | |
| getFuturesHistoricFundingRates() | GET | /api/v2/mix/market/history-fund-rate | |
| getFuturesCurrentFundingRate() | GET | /api/v2/mix/market/current-fund-rate | |
| getFuturesContractConfig() | GET | /api/v2/mix/market/contracts | |
| getFuturesAccountAsset() | 🔐 | GET | /api/v2/mix/account/account |
| getFuturesAccountAssets() | 🔐 | GET | /api/v2/mix/account/accounts |
| getFuturesSubAccountAssets() | 🔐 | GET | /api/v2/mix/account/sub-account-assets |
| getFuturesInterestHistory() | 🔐 | GET | /api/v2/mix/account/interest-history |
| getFuturesOpenCount() | 🔐 | GET | /api/v2/mix/account/open-count |
| setFuturesPositionAutoMargin() | 🔐 | POST | /api/v2/mix/account/set-auto-margin |
| setFuturesLeverage() | 🔐 | POST | /api/v2/mix/account/set-leverage |
| setFuturesPositionMargin() | 🔐 | POST | /api/v2/mix/account/set-margin |
| setFuturesAssetMode() | 🔐 | POST | /api/v2/mix/account/set-asset-mode |
| setFuturesMarginMode() | 🔐 | POST | /api/v2/mix/account/set-margin-mode |
| setFuturesPositionMode() | 🔐 | POST | /api/v2/mix/account/set-position-mode |
| getFuturesAccountBills() | 🔐 | GET | /api/v2/mix/account/bill |
| getUnionTransferLimits() | 🔐 | GET | /api/v2/mix/account/transfer-limits |
| getUnionConfig() | 🔐 | GET | /api/v2/mix/account/union-config |
| getSwitchUnionUsdt() | 🔐 | GET | /api/v2/mix/account/switch-union-usdt |
| unionConvert() | 🔐 | POST | /api/v2/mix/account/union-convert |
| getFuturesMaxOpenableQuantity() | 🔐 | GET | /api/v2/mix/account/max-open |
| getFuturesLiquidationPrice() | 🔐 | GET | /api/v2/mix/account/liq-price |
| getFuturesIsolatedSymbols() | 🔐 | GET | /api/v2/mix/account/isolated-symbols |
| getFuturesPositionTier() | GET | /api/v2/mix/market/query-position-lever | |
| getFuturesPosition() | 🔐 | GET | /api/v2/mix/position/single-position |
| getFuturesPositions() | 🔐 | GET | /api/v2/mix/position/all-position |
| getFuturesHistoricPositions() | 🔐 | GET | /api/v2/mix/position/history-position |
| futuresSubmitOrder() | 🔐 | POST | /api/v2/mix/order/place-order |
| futuresSubmitReversal() | 🔐 | POST | /api/v2/mix/order/click-backhand |
| futuresBatchSubmitOrders() | 🔐 | POST | /api/v2/mix/order/batch-place-order |
| futuresModifyOrder() | 🔐 | POST | /api/v2/mix/order/modify-order |
| futuresCancelOrder() | 🔐 | POST | /api/v2/mix/order/cancel-order |
| futuresBatchCancelOrders() | 🔐 | POST | /api/v2/mix/order/batch-cancel-orders |
| futuresFlashClosePositions() | 🔐 | POST | /api/v2/mix/order/close-positions |
| getFuturesOrder() | 🔐 | GET | /api/v2/mix/order/detail |
| getFuturesFills() | 🔐 | GET | /api/v2/mix/order/fills |
| getFuturesHistoricOrderFills() | 🔐 | GET | /api/v2/mix/order/fill-history |
| getFuturesOpenOrders() | 🔐 | GET | /api/v2/mix/order/orders-pending |
| getFuturesHistoricOrders() | 🔐 | GET | /api/v2/mix/order/orders-history |
| futuresCancelAllOrders() | 🔐 | POST | /api/v2/mix/order/cancel-all-orders |
| getFuturesTriggerSubOrder() | 🔐 | GET | /api/v2/mix/order/plan-sub-order |
| futuresSubmitTPSLOrder() | 🔐 | POST | /api/v2/mix/order/place-tpsl-order |
| futuresSubmitPlanOrder() | 🔐 | POST | /api/v2/mix/order/place-plan-order |
| futuresModifyTPSLPOrder() | 🔐 | POST | /api/v2/mix/order/modify-tpsl-order |
| futuresModifyPlanOrder() | 🔐 | POST | /api/v2/mix/order/modify-plan-order |
| getFuturesPlanOrders() | 🔐 | GET | /api/v2/mix/order/orders-plan-pending |
| futuresCancelPlanOrder() | 🔐 | POST | /api/v2/mix/order/cancel-plan-order |
| getFuturesHistoricPlanOrders() | 🔐 | GET | /api/v2/mix/order/orders-plan-history |
| modifySubaccountEmail() | 🔐 | POST | /api/v2/broker/account/modify-subaccount-email |
| getBrokerInfo() | 🔐 | GET | /api/v2/broker/account/info |
| createSubaccount() | 🔐 | POST | /api/v2/broker/account/create-subaccount |
| getSubaccounts() | 🔐 | GET | /api/v2/broker/account/subaccount-list |
| modifySubaccount() | 🔐 | POST | /api/v2/broker/account/modify-subaccount |
| getSubaccountEmail() | 🔐 | GET | /api/v2/broker/account/subaccount-email |
| getSubaccountSpotAssets() | 🔐 | GET | /api/v2/broker/account/subaccount-spot-assets |
| getSubaccountFuturesAssets() | 🔐 | GET | /api/v2/broker/account/subaccount-future-assets |
| createSubaccountDepositAddress() | 🔐 | POST | /api/v2/broker/account/subaccount-address |
| subaccountWithdrawal() | 🔐 | POST | /api/v2/broker/account/subaccount-withdrawal |
| subaccountSetAutoTransfer() | 🔐 | POST | /api/v2/broker/account/set-subaccount-autotransfer |
| subaccountDepositRecords() | 🔐 | GET | /api/v2/broker/subaccount-deposit |
| subaccountWithdrawalRecords() | 🔐 | GET | /api/v2/broker/subaccount-withdrawal |
| createSubaccountApiKey() | 🔐 | POST | /api/v2/broker/manage/create-subaccount-apikey |
| getSubaccountApiKey() | 🔐 | GET | /api/v2/broker/manage/subaccount-apikey-list |
| modifySubaccountApiKey() | 🔐 | POST | /api/v2/broker/manage/modify-subaccount-apikey |
| getAllSubDepositWithdrawalRecords() | 🔐 | GET | /api/v2/broker/all-sub-deposit-withdrawal |
| getBrokerSubaccounts() | 🔐 | GET | /api/v2/broker/subaccounts |
| getBrokerCommissions() | 🔐 | GET | /api/v2/broker/commissions |
| getBrokerTradeVolume() | 🔐 | GET | /api/v2/broker/trade-volume |
| getBrokerTotalCommission() | 🔐 | GET | /api/v2/broker/total-commission |
| getBrokerOrderCommission() | 🔐 | GET | /api/v2/broker/order-commission |
| getBrokerRebateInfo() | 🔐 | GET | /api/v2/broker/rebate-info |
| getAgentCustomerCommissions() | 🔐 | GET | /api/v2/broker/customer-commissions |
| getAgentSubCustomerList() | 🔐 | GET | /api/v2/broker/sub-customer-list |
| getAgentCustomerTradeVolume() | 🔐 | POST | /api/v2/broker/customer-trade-volume |
| getAgentCustomerList() | 🔐 | POST | /api/v2/broker/customer-list |
| getAgentCustomerKycResult() | 🔐 | GET | /api/v2/broker/customer-kyc-result |
| getAgentCustomerDeposits() | 🔐 | POST | /api/v2/broker/customer-deposit |
| getAgentCustomerAssets() | 🔐 | POST | /api/v2/broker/customer-asset |
| getAgentCommissionDetail() | 🔐 | GET | /api/v2/broker/agent-commission |
| getMarginCurrencies() | GET | /api/v2/margin/currencies | |
| getMarginBorrowHistory() | 🔐 | GET | /api/v2/margin/${marginType}/borrow-history |
| getMarginRepayHistory() | 🔐 | GET | /api/v2/margin/${marginType}/repay-history |
| getMarginInterestHistory() | 🔐 | GET | /api/v2/margin/${marginType}/interest-history |
| getMarginLiquidationHistory() | 🔐 | GET | /api/v2/margin/${marginType}/liquidation-history |
| getMarginFinancialHistory() | 🔐 | GET | /api/v2/margin/${marginType}/financial-records |
| getMarginAccountAssets() | 🔐 | GET | /api/v2/margin/${marginType}/account/assets |
| marginBorrow() | 🔐 | POST | /api/v2/margin/${marginType}/account/borrow |
| marginRepay() | 🔐 | POST | /api/v2/margin/${marginType}/account/repay |
| getMarginRiskRate() | 🔐 | GET | /api/v2/margin/${marginType}/account/risk-rate |
| getMarginMaxBorrowable() | 🔐 | GET | /api/v2/margin/${marginType}/account/max-borrowable-amount |
| getMarginMaxTransferable() | 🔐 | GET | /api/v2/margin/${marginType}/account/max-transfer-out-amount |
| getMarginInterestRateAndMaxBorrowable() | 🔐 | GET | /api/v2/margin/${marginType}/interest-rate-and-limit |
| getMarginTierConfiguration() | 🔐 | GET | /api/v2/margin/${marginType}/tier-data |
| marginFlashRepay() | 🔐 | POST | /api/v2/margin/${marginType}/account/flash-repay |
| getMarginFlashRepayResult() | 🔐 | GET | /api/v2/margin/${marginType}/account/query-flash-repay-status |
| marginSubmitOrder() | 🔐 | POST | /api/v2/margin/${marginType}/place-order |
| marginBatchSubmitOrders() | 🔐 | POST | /api/v2/margin/${marginType}/batch-place-order |
| marginCancelOrder() | 🔐 | POST | /api/v2/margin/${marginType}/cancel-order |
| marginBatchCancelOrders() | 🔐 | POST | /api/v2/margin/${marginType}/batch-cancel-order |
| getMarginOpenOrders() | 🔐 | GET | /api/v2/margin/${marginType}/open-orders |
| getMarginHistoricOrders() | 🔐 | GET | /api/v2/margin/${marginType}/history-orders |
| getMarginHistoricOrderFills() | 🔐 | GET | /api/v2/margin/${marginType}/fills |
| getMarginLiquidationOrders() | 🔐 | GET | /api/v2/margin/${marginType}/liquidation-order |
| getFuturesTraderCurrentOrder() | 🔐 | GET | /api/v2/copy/mix-trader/order-current-track |
| getFuturesTraderHistoryOrders() | 🔐 | GET | /api/v2/copy/mix-trader/order-history-track |
| modifyFuturesTraderOrderTPSL() | 🔐 | POST | /api/v2/copy/mix-trader/order-modify-tpsl |
| getFuturesTraderOrder() | 🔐 | GET | /api/v2/copy/mix-trader/order-total-detail |
| getFuturesTraderProfitHistory() | 🔐 | GET | /api/v2/copy/mix-trader/profit-history-summarys |
| getFuturesTraderProfitShareHistory() | 🔐 | GET | /api/v2/copy/mix-trader/profit-history-details |
| closeFuturesTraderOrder() | 🔐 | POST | /api/v2/copy/mix-trader/order-close-positions |
| getFuturesTraderProfitShare() | 🔐 | GET | /api/v2/copy/mix-trader/profit-details |
| getFuturesTraderProfitShareGroup() | 🔐 | GET | /api/v2/copy/mix-trader/profits-group-coin-date |
| getFuturesTraderSymbolSettings() | 🔐 | GET | /api/v2/copy/mix-trader/config-query-symbols |
| updateFuturesTraderSymbolSettings() | 🔐 | POST | /api/v2/copy/mix-trader/config-setting-symbols |
| updateFuturesTraderGlobalSettings() | 🔐 | POST | /api/v2/copy/mix-trader/config-settings-base |
| getFuturesTraderFollowers() | 🔐 | GET | /api/v2/copy/mix-trader/config-query-followers |
| removeFuturesTraderFollower() | 🔐 | POST | /api/v2/copy/mix-trader/config-remove-follower |
| getFuturesFollowerCurrentOrders() | 🔐 | GET | /api/v2/copy/mix-follower/query-current-orders |
| getFuturesFollowerHistoryOrders() | 🔐 | GET | /api/v2/copy/mix-follower/query-history-orders |
| updateFuturesFollowerTPSL() | 🔐 | POST | /api/v2/copy/mix-follower/setting-tpsl |
| updateFuturesFollowerSettings() | 🔐 | POST | /api/v2/copy/mix-follower/settings |
| getFuturesFollowerSettings() | 🔐 | GET | /api/v2/copy/mix-follower/query-settings |
| closeFuturesFollowerPositions() | 🔐 | POST | /api/v2/copy/mix-follower/close-positions |
| getFuturesFollowerTraders() | 🔐 | GET | /api/v2/copy/mix-follower/query-traders |
| getFuturesFollowerFollowLimit() | 🔐 | GET | /api/v2/copy/mix-follower/query-quantity-limit |
| unfollowFuturesTrader() | 🔐 | POST | /api/v2/copy/mix-follower/cancel-trader |
| getBrokerTraders() | 🔐 | GET | /api/v2/copy/mix-broker/query-traders |
| getBrokerTradersHistoricalOrders() | 🔐 | GET | /api/v2/copy/mix-broker/query-history-traces |
| getBrokerTradersPendingOrders() | 🔐 | GET | /api/v2/copy/mix-broker/query-current-traces |
| getSpotTraderProfit() | 🔐 | GET | /api/v2/copy/spot-trader/profit-summarys |
| getSpotTraderHistoryProfit() | 🔐 | GET | /api/v2/copy/spot-trader/profit-history-details |
| getSpotTraderUnrealizedProfit() | 🔐 | GET | /api/v2/copy/spot-trader/profit-details |
| getSpotTraderOrder() | 🔐 | GET | /api/v2/copy/spot-trader/order-total-detail |
| modifySpotTraderOrderTPSL() | 🔐 | POST | /api/v2/copy/spot-trader/order-modify-tpsl |
| getSpotTraderHistoryOrders() | 🔐 | GET | /api/v2/copy/spot-trader/order-history-track |
| getSpotTraderCurrentOrders() | 🔐 | GET | /api/v2/copy/spot-trader/order-current-track |
| sellSpotTrader() | 🔐 | POST | /api/v2/copy/spot-trader/order-close-tracking |
| getSpotTraderSymbolSettings() | 🔐 | POST | /api/v2/copy/spot-trader/config-setting-symbols |
| removeSpotTraderFollowers() | 🔐 | POST | /api/v2/copy/spot-trader/config-remove-follower |
| getSpotTraderConfiguration() | 🔐 | GET | /api/v2/copy/spot-trader/config-query-settings |
| getSpotTraderFollowers() | 🔐 | GET | /api/v2/copy/spot-trader/config-query-followers |
| cancelSpotFollowerOrder() | 🔐 | POST | /api/v2/copy/spot-follower/stop-order |
| updateSpotFollowerSettings() | 🔐 | POST | /api/v2/copy/spot-follower/settings |
| updateSpotFollowerTPSL() | 🔐 | POST | /api/v2/copy/spot-follower/setting-tpsl |
| getSpotFollowerTraders() | 🔐 | GET | /api/v2/copy/spot-follower/query-traders |
| getSpotFollowerCurrentTraderSymbols() | 🔐 | GET | /api/v2/copy/spot-follower/query-trader-symbols |
| getSpotFollowerSettings() | 🔐 | GET | /api/v2/copy/spot-follower/query-settings |
| getSpotFollowerHistoryOrders() | 🔐 | GET | /api/v2/copy/spot-follower/query-history-orders |
| getSpotFollowerOpenOrders() | 🔐 | GET | /api/v2/copy/spot-follower/query-current-orders |
| sellSpotFollower() | 🔐 | POST | /api/v2/copy/spot-follower/order-close-tracking |
| unfollowSpotTrader() | 🔐 | POST | /api/v2/copy/spot-follower/cancel-trader |
| getEarnSavingsProducts() | 🔐 | GET | /api/v2/earn/savings/product |
| getEarnSavingsAccount() | 🔐 | GET | /api/v2/earn/savings/account |
| getEarnSavingsAssets() | 🔐 | GET | /api/v2/earn/savings/assets |
| getEarnSavingsRecords() | 🔐 | GET | /api/v2/earn/savings/records |
| getEarnSavingsSubscription() | 🔐 | GET | /api/v2/earn/savings/subscribe-info |
| earnSubscribeSavings() | 🔐 | POST | /api/v2/earn/savings/subscribe |
| getEarnSavingsSubscriptionResult() | 🔐 | GET | /api/v2/earn/savings/subscribe-result |
| earnRedeemSavings() | 🔐 | POST | /api/v2/earn/savings/redeem |
| getEarnSavingsRedemptionResult() | 🔐 | GET | /api/v2/earn/savings/redeem-result |
| getEarnAccount() | 🔐 | GET | /api/v2/earn/account/assets |
| getEarnEliteProducts() | 🔐 | GET | /api/v2/earn/elite/product |
| getEarnEliteAssets() | 🔐 | GET | /api/v2/earn/elite/assets |
| getEarnEliteRecords() | 🔐 | GET | /api/v2/earn/elite/records |
| getEarnEliteSubscribeInfo() | 🔐 | GET | /api/v2/earn/elite/subscribe-info |
| subscribeEarnElite() | 🔐 | POST | /api/v2/earn/elite/subscribe |
| getEarnEliteSubscribeResult() | 🔐 | GET | /api/v2/earn/elite/subscribe-result |
| getEarnEliteRedeemInfo() | 🔐 | GET | /api/v2/earn/elite/redeem-info |
| redeemEarnElite() | 🔐 | POST | /api/v2/earn/elite/redeem |
| getSharkfinProducts() | 🔐 | GET | /api/v2/earn/sharkfin/product |
| getSharkfinAccount() | 🔐 | GET | /api/v2/earn/sharkfin/account |
| getSharkfinAssets() | 🔐 | GET | /api/v2/earn/sharkfin/assets |
| getSharkfinRecords() | 🔐 | GET | /api/v2/earn/sharkfin/records |
| getSharkfinSubscription() | 🔐 | GET | /api/v2/earn/sharkfin/subscribe-info |
| subscribeSharkfin() | 🔐 | POST | /api/v2/earn/sharkfin/subscribe |
| getSharkfinSubscriptionResult() | 🔐 | GET | /api/v2/earn/sharkfin/subscribe-result |
| getLoanCurrencies() | GET | /api/v2/earn/loan/public/coinInfos | |
| getLoanEstInterestAndBorrowable() | GET | /api/v2/earn/loan/public/hour-interest | |
| borrowLoan() | 🔐 | POST | /api/v2/earn/loan/borrow |
| getOngoingLoanOrders() | 🔐 | GET | /api/v2/earn/loan/ongoing-orders |
| repayLoan() | 🔐 | POST | /api/v2/earn/loan/repay |
| getRepayHistory() | 🔐 | GET | /api/v2/earn/loan/repay-history |
| updateLoanPledgeRate() | 🔐 | POST | /api/v2/earn/loan/revise-pledge |
| getLoanPledgeRateHistory() | 🔐 | GET | /api/v2/earn/loan/revise-history |
| getLoanHistory() | 🔐 | GET | /api/v2/earn/loan/borrow-history |
| getLoanDebts() | 🔐 | GET | /api/v2/earn/loan/debts |
| getLoanLiquidationRecords() | 🔐 | GET | /api/v2/earn/loan/reduces |
rest-client-v3.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in rest-client-v3.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getServerTime() | GET | /api/v3/public/time | |
| getInstruments() | GET | /api/v3/market/instruments | |
| getMarketFeeGroup() | GET | /api/v3/market/fee-group | |
| getLiquidations() | GET | /api/v3/market/liquidations | |
| getRpiSymbols() | GET | /api/v3/market/rpi-symbols | |
| getRpiOrderBook() | GET | /api/v3/market/rpi-orderbook | |
| getCashDividendRecords() | GET | /api/v3/market/cash-dividend-records | |
| getSpotWhaleFlow() | GET | /api/v3/market/spot-whale-flow | |
| getSpotFundFlow() | GET | /api/v3/market/spot-fund-flow | |
| getSpotNetFlow() | GET | /api/v3/market/spot-net-flow | |
| getMarginLongShort() | GET | /api/v3/market/margin-long-short | |
| getMarginLoanGrowth() | GET | /api/v3/market/margin-loan-growth | |
| getMarginIsolatedBorrow() | GET | /api/v3/market/margin-isolated-borrow | |
| getFuturesActiveBuySell() | GET | /api/v3/market/futures-active-buy-sell | |
| getFuturesLongShort() | GET | /api/v3/market/futures-long-short | |
| getFuturesPositionLongShort() | GET | /api/v3/market/futures-position-long-short | |
| getFuturesAccountLongShort() | GET | /api/v3/market/futures-account-long-short | |
| getMarketScoreWeights() | GET | /api/v3/market/score-weights | |
| getTickers() | GET | /api/v3/market/tickers | |
| getOrderBook() | GET | /api/v3/market/orderbook | |
| getFills() | GET | /api/v3/market/fills | |
| getProofOfReserves() | GET | /api/v3/market/proof-of-reserves | |
| getOpenInterest() | GET | /api/v3/market/open-interest | |
| getCandles() | GET | /api/v3/market/candles | |
| getHistoryCandles() | GET | /api/v3/market/history-candles | |
| getCurrentFundingRate() | GET | /api/v3/market/current-fund-rate | |
| getHistoryFundingRate() | GET | /api/v3/market/history-fund-rate | |
| getRiskReserve() | GET | /api/v3/market/risk-reserve | |
| getRiskReserveHour() | GET | /api/v3/market/risk-reserve-hour | |
| getRiskReserveAll() | GET | /api/v3/market/risk-reserve-all | |
| getDiscountRate() | GET | /api/v3/market/discount-rate | |
| getMarginLoans() | GET | /api/v3/market/margin-loans | |
| getPositionTier() | GET | /api/v3/market/position-tier | |
| getContractsOi() | GET | /api/v3/market/oi-limit | |
| getIndexComponents() | GET | /api/v3/market/index-components | |
| getCopyFuturesTradingPairs() | 🔐 | GET | /api/v3/copy/futures/trading-pairs |
| getCopyFuturesPositionSummary() | 🔐 | GET | /api/v3/copy/futures/position-summary |
| getCopyFuturesMaxTransferable() | 🔐 | GET | /api/v3/copy/futures/max-transferable |
| copyFuturesTransfer() | 🔐 | POST | /api/v3/copy/futures/transfer |
| getCopyFuturesTransferRecords() | 🔐 | GET | /api/v3/copy/futures/transfer-record |
| getBalances() | 🔐 | GET | /api/v3/account/assets |
| getFundingAssets() | 🔐 | GET | /api/v3/account/funding-assets |
| getAccountInfo() | 🔐 | GET | /api/v3/account/info |
| getAccountSettings() | 🔐 | GET | /api/v3/account/settings |
| adjustAccountMode() | 🔐 | POST | /api/v3/account/adjust-account-mode |
| getDeltaInfo() | 🔐 | GET | /api/v3/account/delta-info |
| setLeverage() | 🔐 | POST | /api/v3/account/set-leverage |
| setHoldMode() | 🔐 | POST | /api/v3/account/set-hold-mode |
| getCollateralType() | 🔐 | GET | /api/v3/account/collateral-type |
| setCollateralType() | 🔐 | POST | /api/v3/account/set-collateral-type |
| getCustomCollateralCoins() | GET | /api/v3/account/custom-collateral-coins | |
| preSetLeverage() | 🔐 | GET | /api/v3/account/pre-set-leverage |
| setMargin() | 🔐 | POST | /api/v3/account/set-margin |
| getMaxWithdrawal() | 🔐 | GET | /api/v3/account/max-withdrawal |
| getFinancialRecords() | 🔐 | GET | /api/v3/account/financial-records |
| getRepayableCoins() | 🔐 | GET | /api/v3/account/repayable-coins |
| getPaymentCoins() | 🔐 | GET | /api/v3/account/payment-coins |
| submitRepay() | 🔐 | POST | /api/v3/account/repay |
| getConvertRecords() | 🔐 | GET | /api/v3/account/convert-records |
| setDepositAccount() | 🔐 | POST | /api/v3/account/deposit-account |
| switchDeduct() | 🔐 | POST | /api/v3/account/switch-deduct |
| getDeductInfo() | 🔐 | GET | /api/v3/account/deduct-info |
| getFeeRate() | 🔐 | GET | /api/v3/account/fee-rate |
| getAllFeeRates() | 🔐 | GET | /api/v3/account/all-fee-rate |
| getMaxTransferable() | 🔐 | GET | /api/v3/account/max-transferable |
| getOpenInterestLimit() | 🔐 | GET | /api/v3/account/open-interest-limit |
| downgradeAccountToClassic() | 🔐 | POST | /api/v3/account/switch |
| getUnifiedAccountSwitchStatus() | 🔐 | GET | /api/v3/account/switch-status |
| getTaxRecords() | 🔐 | GET | /api/v3/tax/records |
| createSubAccount() | 🔐 | POST | /api/v3/user/create-sub |
| freezeSubAccount() | 🔐 | POST | /api/v3/user/freeze-sub |
| getSubUnifiedAssets() | 🔐 | GET | /api/v3/account/sub-unified-assets |
| getSubAccountList() | 🔐 | GET | /api/v3/user/sub-list |
| createSubAccountApiKey() | 🔐 | POST | /api/v3/user/create-sub-api |
| updateSubAccountApiKey() | 🔐 | POST | /api/v3/user/update-sub-api |
| deleteSubAccountApiKey() | 🔐 | POST | /api/v3/user/delete-sub-api |
| getSubAccountApiKeys() | 🔐 | GET | /api/v3/user/sub-api-list |
| getTransferableCoins() | 🔐 | GET | /api/v3/account/transferable-coins |
| submitTransfer() | 🔐 | POST | /api/v3/account/transfer |
| subAccountTransfer() | 🔐 | POST | /api/v3/account/sub-transfer |
| getSubTransferRecords() | 🔐 | GET | /api/v3/account/sub-transfer-record |
| getDepositAddress() | 🔐 | GET | /api/v3/account/deposit-address |
| getSubDepositAddress() | 🔐 | GET | /api/v3/account/sub-deposit-address |
| getDepositRecords() | 🔐 | GET | /api/v3/account/deposit-records |
| getSubDepositRecords() | 🔐 | POST | /api/v3/account/sub-deposit-records |
| submitWithdraw() | 🔐 | POST | /api/v3/account/withdraw |
| getWithdrawRecords() | 🔐 | GET | /api/v3/account/withdrawal-records |
| getWithdrawAddressBook() | 🔐 | GET | /api/v3/account/withdraw-address |
| cancelWithdrawal() | 🔐 | POST | /api/v3/account/cancel-withdrawal |
| submitNewOrder() | 🔐 | POST | /api/v3/trade/place-order |
| modifyOrder() | 🔐 | POST | /api/v3/trade/modify-order |
| placeRealityOrder() | 🔐 | POST | /api/v3/trade/place-reality-order |
| cancelRealityOrder() | 🔐 | POST | /api/v3/trade/cancel-reality-order |
| getLoanData() | 🔐 | GET | /api/v3/trade/loan-data |
| cancelOrder() | 🔐 | POST | /api/v3/trade/cancel-order |
| placeBatchOrders() | 🔐 | POST | /api/v3/trade/place-batch |
| batchModifyOrders() | 🔐 | POST | /api/v3/trade/batch-modify-order |
| cancelBatchOrders() | 🔐 | POST | /api/v3/trade/cancel-batch |
| cancelAllOrders() | 🔐 | POST | /api/v3/trade/cancel-symbol-order |
| closeAllPositions() | 🔐 | POST | /api/v3/trade/close-positions |
| getOrderInfo() | 🔐 | GET | /api/v3/trade/order-info |
| getUnfilledOrders() | 🔐 | GET | /api/v3/trade/unfilled-orders |
| getHistoryOrders() | 🔐 | GET | /api/v3/trade/history-orders |
| getTradeFills() | 🔐 | GET | /api/v3/trade/fills |
| getCurrentPosition() | 🔐 | GET | /api/v3/position/current-position |
| getPositionHistory() | 🔐 | GET | /api/v3/position/history-position |
| getMaxOpenAvailable() | 🔐 | POST | /api/v3/account/max-open-available |
| getPositionAdlRank() | 🔐 | GET | /api/v3/position/adlRank |
| countdownCancelAll() | 🔐 | POST | /api/v3/trade/countdown-cancel-all |
| getLoanTransfered() | 🔐 | GET | /api/v3/ins-loan/transfered |
| getLoanSymbols() | 🔐 | GET | /api/v3/ins-loan/symbols |
| getLoanRiskUnit() | 🔐 | GET | /api/v3/ins-loan/risk-unit |
| getLoanRepaidHistory() | 🔐 | GET | /api/v3/ins-loan/repaid-history |
| getLoanProductInfo() | 🔐 | GET | /api/v3/ins-loan/product-infos |
| getLoanOrder() | 🔐 | GET | /api/v3/ins-loan/loan-order |
| getLoanLTVConvert() | 🔐 | GET | /api/v3/ins-loan/ltv-convert |
| getLoanMarginCoinInfo() | 🔐 | GET | /api/v3/ins-loan/ensure-coins-convert |
| bindLoanUid() | 🔐 | POST | /api/v3/ins-loan/bind-uid |
| getLoanCoins() | 🔐 | GET | /api/v3/loan/coins |
| getLoanInterest() | 🔐 | GET | /api/v3/loan/interest |
| loanBorrow() | 🔐 | POST | /api/v3/loan/borrow |
| getLoanBorrowOngoing() | 🔐 | GET | /api/v3/loan/borrow-ongoing |
| getLoanBorrowHistory() | 🔐 | GET | /api/v3/loan/borrow-history |
| loanRepay() | 🔐 | POST | /api/v3/loan/repay |
| getLoanRepayHistory() | 🔐 | GET | /api/v3/loan/repay-history |
| loanRevisePledge() | 🔐 | POST | /api/v3/loan/revise-pledge |
| getLoanPledgeRateHistory() | 🔐 | GET | /api/v3/loan/pledge-rate-history |
| getLoanDebts() | 🔐 | GET | /api/v3/loan/debts |
| getLoanReduces() | 🔐 | GET | /api/v3/loan/reduces |
| submitStrategyOrder() | 🔐 | POST | /api/v3/trade/place-strategy-order |
| modifyStrategyOrder() | 🔐 | POST | /api/v3/trade/modify-strategy-order |
| cancelStrategyOrder() | 🔐 | POST | /api/v3/trade/cancel-strategy-order |
| getUnfilledStrategyOrders() | 🔐 | GET | /api/v3/trade/unfilled-strategy-orders |
| getHistoryStrategyOrders() | 🔐 | GET | /api/v3/trade/history-strategy-orders |
| createBrokerSubAccount() | 🔐 | POST | /api/v3/broker/create-sub |
| getBrokerSubAccountList() | 🔐 | GET | /api/v3/broker/sub-list |
| modifyBrokerSubAccount() | 🔐 | POST | /api/v3/broker/modify-sub |
| brokerSubWithdrawal() | 🔐 | POST | /api/v3/broker/sub-withdrawal |
| getBrokerSubDepositAddress() | 🔐 | POST | /api/v3/broker/sub-deposit-address |
| getBrokerAllSubDepositWithdrawal() | 🔐 | GET | /api/v3/broker/all-sub-deposit-withdrawal |
| getBrokerCommission() | 🔐 | GET | /api/v3/broker/commission |
| createBrokerSubApiKey() | 🔐 | POST | /api/v3/broker/create-sub-apikey |
| modifyBrokerSubApiKey() | 🔐 | POST | /api/v3/broker/modify-sub-apikey |
| deleteBrokerSubApiKey() | 🔐 | POST | /api/v3/broker/delete-sub-apikey |
| getBrokerSubApiKey() | 🔐 | GET | /api/v3/broker/query-sub-apikey |
| getP2pAdList() | 🔐 | GET | /api/v3/p2p/ad-list |
| getP2pExchangeRate() | 🔐 | GET | /api/v3/p2p/exchange-rate |
| simulateP2pFee() | 🔐 | POST | /api/v3/p2p/fee-simulate |
| getP2pAdLimit() | 🔐 | GET | /api/v3/p2p/ad-limit |
| createP2pAd() | 🔐 | POST | /api/v3/p2p/ad-create |
| updateP2pAd() | 🔐 | POST | /api/v3/p2p/ad-update |
| operateP2pAd() | 🔐 | POST | /api/v3/p2p/ad-operate |
| getP2pAdInfo() | 🔐 | GET | /api/v3/p2p/ad-info |
| getP2pMyAds() | 🔐 | GET | /api/v3/p2p/my-ads |
| getP2pPendingOrders() | 🔐 | GET | /api/v3/p2p/pending-orders |
| getP2pAllOrders() | 🔐 | GET | /api/v3/p2p/all-orders |
| getP2pOrderInfo() | 🔐 | GET | /api/v3/p2p/order-info |
| confirmP2pOrderPayment() | 🔐 | POST | /api/v3/p2p/order-pay |
| releaseP2pOrderAsset() | 🔐 | POST | /api/v3/p2p/order-release |
| getP2pUserInfo() | 🔐 | GET | /api/v3/p2p/user-info |
| getP2pCurrencies() | 🔐 | GET | /api/v3/p2p/currencies |
| getP2pPayMethods() | 🔐 | GET | /api/v3/p2p/pay-method |
| getP2pBalance() | 🔐 | GET | /api/v3/p2p/balance |
| getEarnEliteProducts() | 🔐 | GET | /api/v3/earn/elite-product |
| getEarnEliteAssets() | 🔐 | GET | /api/v3/earn/elite-assets |
| getEarnEliteRecords() | 🔐 | GET | /api/v3/earn/elite-records |
| getEarnEliteSubscribeInfo() | 🔐 | GET | /api/v3/earn/elite-subscribe-info |
| subscribeEarnElite() | 🔐 | POST | /api/v3/earn/elite-subscribe |
| getEarnEliteSubscribeResult() | 🔐 | GET | /api/v3/earn/elite-subscribe-result |
| getEarnEliteRedeemInfo() | 🔐 | GET | /api/v3/earn/elite-redeem-info |
| redeemEarnElite() | 🔐 | POST | /api/v3/earn/elite-redeem |
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 Bitget API via a WebSocket connection.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| submitNewOrder() | WS | place-order | |
| placeBatchOrders() | WS | batch-place | |
| cancelOrder() | WS | cancel-order | |
| cancelBatchOrders() | WS | batch-cancel |
Bitget JavaScript FAQ
What does the Bitget JavaScript SDK cover?
Bitget supports Spot, Copy, Futures, and WebSockets workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private Bitget API calls in JavaScript?
Install bitget-api from npm & pass API credentials into the SDK client options, as shown in the Bitget JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.
Does the Bitget 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.
Where should I start on the Bitget JavaScript page: REST or WebSocket?
Start with the REST quick start for installation, authentication, and request and response flows. Move to the WebSocket example when you need streaming market or account updates.
Direct Example Files
Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.