Bitget JavaScript SDK
Use bitget-api to read Bitget market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.
Choose a client
- RestClientV3
- Current V3/UTA REST API
- WebsocketClientV3
- V3 public and private streams
- WebsocketAPIClient
- Awaitable order commands
- RestClientV2
- Classic REST fallback
- WebsocketClientV2
- Classic stream fallback
Make a first public request
In a Node.js project, install the package once. The REST and WebSocket API examples below use .mjs files so Node.js can run their imports directly.
npm install bitget-api
REST walkthrough
Read the public BTCUSDT Spot ticker with RestClientV3. These public requests require no credentials.
Save the code as rest-public.mjs and run:
node rest-public.mjs
import { RestClientV3 } from 'bitget-api'; const client = new RestClientV3(); const response = await client.getTickers({ category: 'SPOT', symbol: 'BTCUSDT',});console.log(response);Expected response
Market values change on each run. These are the fields to check in the logged output.
| Field | Expected result |
|---|---|
| code | 00000 means success. |
| data[0] | A ticker object with symbol: BTCUSDT, category: SPOT, and decimal-string lastPrice, bid, ask, and size fields. |
| requestTime | The response timestamp in Unix milliseconds. |
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
WebSocket API commands require API credentials. Set the environment variables shown in the code using credentials for the live environment. This example only constructs the client; it sends no request and places no order. Continue with the maintained example below for supported commands and connection handling.
Save the code as ws-api-setup.mjs and run:
node ws-api-setup.mjs
import { WebsocketAPIClient } from 'bitget-api'; const credentials = { apiKey: process.env.BITGET_API_KEY, apiSecret: process.env.BITGET_API_SECRET, apiPass: process.env.BITGET_API_PASS,}; if (Object.values(credentials).some((value) => !value)) { throw new Error('Set BITGET_API_KEY, BITGET_API_SECRET, BITGET_API_PASS before running.');} const wsApi = new WebsocketAPIClient(credentials);console.log('Client configured. No request sent.');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, proxies, 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 |
| getAllTradeRates() | 🔐 | GET | /api/v2/common/all-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 |
| getSpotCallAuction() | GET | /api/v2/spot/market/auction | |
| 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 | |
| getFuturesOiLimit() | GET | /api/v2/mix/market/oi-limit | |
| 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 |
| getFuturesPositionAdlRank() | 🔐 | GET | /api/v2/mix/position/adlRank |
| 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 |
| futuresSubmitPositionTPSL() | 🔐 | POST | /api/v2/mix/order/place-pos-tpsl |
| 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 |
| deleteSubaccountApiKey() | 🔐 | POST | /api/v2/broker/manage/delete-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 |
| getSubAffiliateInfo() | 🔐 | GET | /api/v2/broker/sub-affiliate-info |
| 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 |
| getLoanProductInfo() | 🔐 | GET | /api/v2/spot/ins-loan/product-infos |
| getLoanSymbols() | 🔐 | GET | /api/v2/spot/ins-loan/symbols |
| getLoanMarginCoinInfo() | 🔐 | GET | /api/v2/spot/ins-loan/ensure-coins-convert |
| getLoanRiskUnit() | 🔐 | GET | /api/v2/spot/ins-loan/risk-unit |
| getLoanLTVConvert() | 🔐 | GET | /api/v2/spot/ins-loan/ltv-convert |
| getLoanRepaidHistory() | 🔐 | GET | /api/v2/spot/ins-loan/repaid-history |
| getLoanOrder() | 🔐 | GET | /api/v2/spot/ins-loan/loan-order |
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 | |
| getSplitRecords() | GET | /api/v3/market/split-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 | |
| getRealityOrderBook() | 🔐 | GET | /api/v3/account/reality-orderbook |
| getRealityFills() | 🔐 | GET | /api/v3/account/reality-fills |
| getRealityCompanyOverview() | GET | /api/v3/reality/market/company-overview | |
| getRealityValuationIndicators() | GET | /api/v3/reality/market/valuation-indicators | |
| getRealityEarningsForecast() | GET | /api/v3/reality/market/earnings-forecast | |
| getRealitySuspensionResumptionInfo() | GET | /api/v3/reality/market/suspension-resumption-info | |
| getRealityDividends() | GET | /api/v3/reality/market/dividends | |
| getRealityShareCapitalChange() | GET | /api/v3/reality/market/share-capital-change | |
| getRealityInnerTrades() | GET | /api/v3/reality/market/inner-trades | |
| getRealityExecutiveShareholdings() | GET | /api/v3/reality/market/executive-shareholdings | |
| getRealityShareholdDetail() | GET | /api/v3/reality/market/sharehold-detail | |
| getRealityStockInfo() | GET | /api/v3/reality/market/stock-info | |
| getRealityMarketStates() | GET | /api/v3/reality/market/states | |
| getRealityMarketCalendar() | GET | /api/v3/reality/market/calendar | |
| 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 |
| getCopyFuturesCurrentFollowers() | 🔐 | GET | /api/v3/copy/futures/current-follower |
| getCopyFuturesHistoryFollowers() | 🔐 | GET | /api/v3/copy/futures/history-follower |
| getCopyFuturesProfitSummary() | 🔐 | GET | /api/v3/copy/futures/profit-summary |
| getCopyFuturesProfitDetails() | 🔐 | GET | /api/v3/copy/futures/profit-details |
| getCopyFuturesPortfolioOverview() | 🔐 | GET | /api/v3/copy/futures/portfolio-overview |
| createCopyFutures() | 🔐 | POST | /api/v3/copy/futures/follower-settings |
| modifyCopyFuturesFollowerSettings() | 🔐 | POST | /api/v3/copy/futures/modify-follower-settings |
| unfollowCopyFutures() | 🔐 | POST | /api/v3/copy/futures/unfollow |
| getCopyFuturesCopySettings() | 🔐 | GET | /api/v3/copy/futures/copy-settings |
| copyFuturesFollowerTransfer() | 🔐 | POST | /api/v3/copy/futures/copy-transfer |
| getCopyFuturesFollowerTransferRecords() | 🔐 | GET | /api/v3/copy/futures/copy-transfer-record |
| getCopyFuturesCurrentCopy() | 🔐 | GET | /api/v3/copy/futures/current-copy |
| getCopyFuturesCopyProfitDetails() | 🔐 | GET | /api/v3/copy/futures/copy-profit-details |
| closeCopyFuturesPositions() | 🔐 | POST | /api/v3/copy/futures/close-positions |
| closeAllCopyFuturesPositions() | 🔐 | POST | /api/v3/copy/futures/close-all |
| getCopyFuturesCurrentPositions() | 🔐 | GET | /api/v3/copy/futures/current-positions |
| placeCopyFuturesTpSl() | 🔐 | POST | /api/v3/copy/futures/place-tpsl |
| modifyCopyFuturesTpSl() | 🔐 | POST | /api/v3/copy/futures/modify-tpsl |
| cancelCopyFuturesTpSl() | 🔐 | POST | /api/v3/copy/futures/cancel-tpsl |
| getCopyFuturesCurrentTpSlOrders() | 🔐 | GET | /api/v3/copy/futures/current-tpsl-orders |
| getCopyFuturesTpSlOrderHistory() | 🔐 | GET | /api/v3/copy/futures/tpsl-order-history |
| getStockPlusOptionQuote() | 🔐 | GET | /api/v3/stockplus/market/option-quote |
| getStockPlusOptionChainInfo() | 🔐 | GET | /api/v3/stockplus/market/option-chain-info |
| getStockPlusOptionExpiryDate() | 🔐 | GET | /api/v3/stockplus/market/option-expiry-date |
| getStockPlusOptionVolume() | 🔐 | GET | /api/v3/stockplus/market/option-volume |
| getStockPlusStaticInfo() | 🔐 | GET | /api/v3/stockplus/market/static |
| getStockPlusQuote() | 🔐 | GET | /api/v3/stockplus/market/quote |
| getStockPlusTradeDetail() | 🔐 | GET | /api/v3/stockplus/market/trade |
| getStockPlusIntraday() | 🔐 | GET | /api/v3/stockplus/market/intraday |
| getStockPlusHistoryCandlestick() | 🔐 | GET | /api/v3/stockplus/market/history-candlestick |
| getStockPlusCandlestick() | 🔐 | GET | /api/v3/stockplus/market/candlestick |
| getStockPlusDepth() | 🔐 | GET | /api/v3/stockplus/market/depth |
| placeStockPlusOrder() | 🔐 | POST | /api/v3/stockplus/trade/place-order |
| cancelStockPlusOrder() | 🔐 | POST | /api/v3/stockplus/trade/cancel-order |
| modifyStockPlusOrder() | 🔐 | POST | /api/v3/stockplus/trade/modify-order |
| getStockPlusTodayOrders() | 🔐 | GET | /api/v3/stockplus/trade/today-orders |
| getStockPlusHistoryOrders() | 🔐 | GET | /api/v3/stockplus/trade/history-orders |
| getStockPlusOrderDetail() | 🔐 | GET | /api/v3/stockplus/trade/order-detail |
| getStockPlusTodayExecutions() | 🔐 | GET | /api/v3/stockplus/trade/today-executions |
| getStockPlusHistoryExecutions() | 🔐 | GET | /api/v3/stockplus/trade/history-executions |
| getStockPlusAccount() | 🔐 | GET | /api/v3/stockplus/asset/account |
| getStockPlusCashFlow() | 🔐 | GET | /api/v3/stockplus/asset/cash-flow |
| getStockPlusStockPosition() | 🔐 | GET | /api/v3/stockplus/asset/stock-position |
| stockPlusTransfer() | 🔐 | POST | /api/v3/stockplus/asset/transfer |
| getStockPlusTransferRecords() | 🔐 | GET | /api/v3/stockplus/asset/transfer-records |
| getCfdTickers() | 🔐 | GET | /api/v3/cfd/market/tickers |
| getCfdHistoryCandlestick() | 🔐 | GET | /api/v3/cfd/market/history-candlestick |
| placeCfdOrder() | 🔐 | POST | /api/v3/cfd/trade/place-order |
| modifyCfdOrder() | 🔐 | POST | /api/v3/cfd/trade/modify-order |
| cancelCfdOrder() | 🔐 | POST | /api/v3/cfd/trade/cancel-order |
| cancelAllCfdOrders() | 🔐 | POST | /api/v3/cfd/trade/cancel-all |
| closeCfdPositions() | 🔐 | POST | /api/v3/cfd/trade/close-positions |
| closeAllCfdPositions() | 🔐 | POST | /api/v3/cfd/trade/close-all-positions |
| getCfdUnfilledOrders() | 🔐 | GET | /api/v3/cfd/trade/unfilled-order |
| getCfdOrderHistory() | 🔐 | GET | /api/v3/cfd/trade/history-order |
| getCfdCurrentPositions() | 🔐 | GET | /api/v3/cfd/trade/current-positions |
| getCfdFundDetail() | 🔐 | GET | /api/v3/cfd/account/fund-detail |
| cfdTransfer() | 🔐 | POST | /api/v3/cfd/account/transfer |
| getCfdTransferRecords() | 🔐 | GET | /api/v3/cfd/account/transfer-records |
| getCfdFinancialRecords() | 🔐 | GET | /api/v3/cfd/account/financial-records |
| getCfdInstruments() | 🔐 | GET | /api/v3/cfd/account/instruments |
| 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 |
| getFundingFinancialRecords() | 🔐 | GET | /api/v3/account/funding-financial-records |
| getRepayableCoins() | 🔐 | GET | /api/v3/account/repayable-coins |
| getPaymentCoins() | 🔐 | GET | /api/v3/account/payment-coins |
| submitRepay() | 🔐 | POST | /api/v3/account/repay |
| borrow() | 🔐 | POST | /api/v3/account/borrow |
| getMaxBorrowable() | 🔐 | GET | /api/v3/account/max-borrowable |
| setRepayMode() | 🔐 | POST | /api/v3/account/set-repay-mode |
| getConvertRecords() | 🔐 | GET | /api/v3/account/convert-records |
| getSmallAssets() | 🔐 | GET | /api/v3/convert/small-assets |
| tradeSmallAssets() | 🔐 | POST | /api/v3/convert/small-assets-trade |
| getSmallAssetsHistory() | 🔐 | GET | /api/v3/convert/small-assets-history |
| 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 |
| getEligibleSymbols() | 🔐 | GET | /api/v3/account/eligible-symbols |
| getEligibleMarginTier() | 🔐 | GET | /api/v3/account/eligible-margin-tier |
| getEligibleLoanInfo() | 🔐 | GET | /api/v3/account/eligible-loan-info |
| getEligibleDiscountRate() | 🔐 | GET | /api/v3/account/eligible-discount-rate |
| 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 |
| createAgentSubAccount() | 🔐 | POST | /api/v3/user/sub-account/agent-create |
| freezeSubAccount() | 🔐 | POST | /api/v3/user/freeze-sub |
| deleteSubAccount() | 🔐 | POST | /api/v3/user/delete-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 |
| getRateLimitQuota() | 🔐 | GET | /api/v3/user/rate-limit-quota |
| setRateLimitQuota() | 🔐 | POST | /api/v3/user/set-rate-limit-quota |
| 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 |
| subMasterTransfer() | 🔐 | POST | /api/v3/account/sub-master-transfer |
| 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 |
| movePositions() | 🔐 | POST | /api/v3/account/move-positions |
| getMovePositionHistory() | 🔐 | GET | /api/v3/account/move-position-history |
| 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 |
| getStrategySubOrders() | 🔐 | GET | /api/v3/trade/strategy-sub-orders |
| validateGridBot() | 🔐 | POST | /api/v3/trade/grid/validate |
| createGridBot() | 🔐 | POST | /api/v3/trade/grid/create-bot |
| modifyGridBot() | 🔐 | POST | /api/v3/trade/grid/modify-bot |
| modifyGridInterval() | 🔐 | POST | /api/v3/trade/grid/modify-grid-interval |
| addGridInvestment() | 🔐 | POST | /api/v3/trade/grid/add-investment |
| closeGridBot() | 🔐 | POST | /api/v3/trade/grid/close-bot |
| getGridBotDetail() | 🔐 | GET | /api/v3/trade/grid/bot-detail |
| getGridBotOrderDetails() | 🔐 | GET | /api/v3/trade/grid/list-details |
| validateNeutralGridBot() | 🔐 | POST | /api/v3/trade/grid/validate-neutral |
| createNeutralGridBot() | 🔐 | POST | /api/v3/trade/grid/create-neutral-bot |
| modifyNeutralGridBot() | 🔐 | POST | /api/v3/trade/grid/modify-neutral-bot |
| modifyNeutralGridInterval() | 🔐 | POST | /api/v3/trade/grid/modify-neutral-grid-interval |
| getNeutralGridBotDetail() | 🔐 | GET | /api/v3/trade/grid/neutral-bot-detail |
| getNeutralGridBotOrderDetails() | 🔐 | GET | /api/v3/trade/grid/neutral-list-details |
| 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 | |
| updateOrder() | WS | modify-order | |
| batchUpdateOrders() | WS | batch-modify |
Bitget JavaScript FAQ
What does the Bitget JavaScript SDK cover?
Bitget supports Spot, Futures, Margin, Copy, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private Bitget API calls in JavaScript?
The public REST example above needs no credentials. For private calls, follow the authentication setup for bitget-api in the full tutorial, including the credentials or signer required by your exchange.
Bitget authentication and setupDoes 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.
When should I use the Bitget 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 for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.