Request parameters.
Get trades for a specific account and symbol.
Weight: 20 with symbol,40 with pair (after CM migration: 5 flat)
Security Type: USER_DATA
Notes:
fromId cannot be sent with startTime or endTimeRequest parameters.
Get all account orders; active, canceled, or filled.
These orders will not be found: order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time order create time + 90 days < current time
Weight: 20 with symbol, 40 with pair (after CM migration: 5 flat)
Security Type: USER_DATA
Notes:
symbol or pair must be sent.pair can't be sent with orderIdorderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.Request parameters.
Cancel all open orders of the specified symbol at the end of the specified countdown. This rest endpoint means to ensure your open orders are canceled in case of an outage. The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and repalced by a new one. The system will check all countdowns approximately every 10 milliseconds*, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.
Example usage:
Call this endpoint at 30s intervals with an countdownTime of 120000 (120s).
If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled.
If this endpoint is called with an countdownTime of 0, the countdown timer will be stopped.
Weight(IP): 10
Security Type: TRADE
Request parameters.
Query basis
Weight(IP): 1
Notes:
Request parameters.
Cancel All Open Orders
Weight(IP): 1
Security Type: TRADE
Request parameters.
Cancel Multiple Orders
Weight(IP): 1
Security Type: TRADE
Notes:
orderIdList or origClientOrderIdList must be sent.Request parameters.
Cancel an active order.
Weight(IP): 1
Security Type: TRADE
Notes:
orderId or origClientOrderId must be sent.Request parameters.
Change user's initial leverage in the specific symbol market.
For Hedge Mode, LONG and SHORT positions of one symbol use the same initial leverage and share a total notional value.
Weight(IP): 1
Security Type: TRADE
Request parameters.
Change user's margin type in the specific symbol market.For Hedge Mode, LONG and SHORT positions of one symbol use the same margin type.
With ISOLATED margin type, margins of the LONG and SHORT positions are isolated from each other.
Weight(IP): 1
Security Type: TRADE
Request parameters.
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol.
After CM migration*, UM and CM share the same dualSidePosition setting. Calling this endpoint flips both UM and CM at once. If either side has any open order or open position, the change is rejected:
-4067 (open orders exist)-4068 (open position exists)Weight(IP): 1
Security Type: TRADE
Request parameters.
Test connectivity to the Rest API and get the current server time.
Weight(IP): 1
Close out a user data stream.
Weight(IP): 1
Security Type: USER_STREAM
Get compressed, aggregate trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.
Weight(IP): 20
Notes:
startTime and endTime are sent, time between startTime and endTime must be less than 1 hour.fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.startTime/endTime and fromId might cause response timeout, please send either fromId or startTime/endTimeRequest parameters.
Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.
Weight: based on parameter LIMIT
| LIMIT | weight |
|---|---|
| [1,100) | 1 |
| [100, 500) | 2 |
| [500, 1000] | 5 |
| > 1000 | 10 |
Notes:
startTime and endTime can only be up to 200 daysstartTime and endTime, the most recent limit data from endTime will be returned:startTime and endTime are not sent, current timestamp will be set as endTime, and the most recent data will be returned.startTime is sent only, the timestamp of 200 days after startTime will be set as endTime(up to the current time)endTime is sent only, the timestamp of 200 days before endTime will be set as startTimeRequest parameters.
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight(IP): null
Weight: 1 for a single symbol, 40 for mutltiple symbols
Security Type: USER_DATA
Request parameters.
Current exchange trading rules and symbol information
Weight(IP): 1
Check futures account balance
Weight(IP): 1
Security Type: USER_DATA
Request parameters.
Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight(IP): 30
Security Type: USER_DATA
Request parameters.
Get Download Id For Futures Order History
Weight(IP): 1000
Security Type: USER_DATA
Notes:
startTime and endTime can not be longer than 1 yearRequest parameters.
Get download id for futures trade history
Weight(IP): 1000
Security Type: USER_DATA
Notes:
startTime and endTime can not be longer than 1 yearRequest parameters.
Get download id for futures transaction history
Weight(IP): 1000
Security Type: USER_DATA
Notes:
startTime and endTime can not be longer than 1 yearRequest parameters.
Get Funding Rate History of Perpetual Futures
Weight(IP): 1
Notes:
Request parameters.
Query funding rate info for symbols that had FundingRateCap/FundingRateFloor/fundingIntervalHours adjustment
Get futures order history download link by Id
Weight(IP): 5
Security Type: USER_DATA
Notes:
Request parameters.
Get futures trade download link by Id
Weight(IP): 5
Security Type: USER_DATA
Notes:
Request parameters.
Get futures transaction history download link by Id
Weight(IP): 5
Security Type: USER_DATA
Notes:
Request parameters.
Get income history
Weight(IP): 20
Security Type: USER_DATA
Notes:
incomeType is not sent, all kinds of flow will be returnedstartTime and endTime can not be longer than 1 yearRequest parameters.
Get order modification history
Weight(IP): 1
Security Type: USER_DATA
Notes:
orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.Request parameters.
Get position margin change history
Weight(IP): 1
Security Type: TRADE
Request parameters.
Query index price and mark price
Weight(IP): 10
Request parameters.
Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time.
Weight: Based on parameter LIMIT
| LIMIT | weight |
|---|---|
| [1,100) | 1 |
| [100, 500) | 2 |
| [500, 1000] | 5 |
| > 1000 | 10 |
Notes:
startTime and endTime can only be up to 200 daysstartTime and endTime, the most recent limit data from endTime will be returned:startTime and endTime are not sent, current timestamp will be set as endTime, and the most recent data will be returned.startTime is sent only, the timestamp of 200 days after startTime will be set as endTime(up to the current time)endTime is sent only, the timestamp of 200 days before endTime will be set as startTimeRequest parameters.
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
Weight: Based on parameter LIMIT
| LIMIT | weight |
|---|---|
| [1,100) | 1 |
| [100, 500) | 2 |
| [500, 1000] | 5 |
| > 1000 | 10 |
Notes:
startTime and endTime can only be up to 200 daysstartTime and endTime, the most recent limit data from endTime will be returned:startTime and endTime are not sent, current timestamp will be set as endTime, and the most recent data will be returned.startTime is sent only, the timestamp of 200 days after startTime will be set as endTime(up to the current time)endTime is sent only, the timestamp of 200 days before endTime will be set as startTimeRequest parameters.
Query symbol Long/Short Ratio
Weight(IP): 1
Notes:
Request parameters.
Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time.
Weight: Based on parameter LIMIT
| LIMIT | weight |
|---|---|
| [1,100) | 1 |
| [100, 500) | 2 |
| [500, 1000] | 5 |
| > 1000 | 10 |
Notes:
startTime and endTime can only be up to 200 daysstartTime and endTime, the most recent limit data from endTime will be returned:startTime and endTime are not sent, current timestamp will be set as endTime, and the most recent data will be returned.startTime is sent only, the timestamp of 200 days after startTime will be set as endTime(up to the current time)endTime is sent only, the timestamp of 200 days before endTime will be set as startTimeRequest parameters.
Modify Isolated Position Margin
Weight(IP): 1
Security Type: TRADE
Notes:
Request parameters.
Modify Multiple Orders
Weight(IP): 5
Security Type: TRADE
Notes:
Modify OrderRequest parameters.
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
Weight(IP): 1
Security Type: TRADE
Notes:
orderId or origClientOrderId must be sent, and the orderId will prevail if both are sent.quantity or price must be sent. (After CM migration, both quantity and price are required.)quantity or price doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is.quantityGTX and the new price will cause it to be executed immediatelyRequest parameters.
Send in a new order.
Weight: 1 on 1min order rate limit(X-MBX-ORDER-COUNT-1M) 0 on IP rate limit(x-mbx-used-weight-1m)
Security Type: TRADE
Notes:
Additional mandatory parameters based on type:
Order with type STOP, parameter timeInForce can be sent ( default GTC).
Order with type TAKE_PROFIT, parameter timeInForce can be sent ( default GTC).
Condition orders will be triggered when:
If parameterpriceProtectis sent as true:
when price reaches the stopPrice ,the difference rate between "MARK_PRICE" and "CONTRACT_PRICE" cannot be larger than the "triggerProtect" of the symbol
"triggerProtect" of a symbol can be got from GET /dapi/v1/exchangeInfo
STOP, STOP_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
-TAKE_PROFIT, TAKE_PROFIT_MARKET:
BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE")
SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >= stopPrice
TRAILING_STOP_MARKET:
BUY: the lowest price after order placed ``= the lowest price * (1 + callbackRate)
SELL: the highest price after order placed >= activationPrice, and the latest price
For TRAILING_STOP_MARKET, if you got such error code. > {"code": -2021, "msg": "Order would immediately trigger."} > means that the parameters you send do not meet the following requirements:
BUY: activationPrice should be smaller than latest price.
SELL: activationPrice should be larger than latest price.
If newOrderRespType is sent as RESULT :
MARKET order: the final FILLED result of the order will be return directly.
LIMIT order with special timeInForce: the final status result of the order(FILLED or EXPIRED) will be returned directly.
STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:
Follow the same rules for condition orders.
If triggered,close all current long position( if SELL) or current short position( if BUY).
Cannot be used with quantity parameter
Cannot be used with reduceOnly parameter
In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side
selfTradePreventionMode is only effective when timeInForce set to IOC or GTC.
Request parameters.
Not recommended to continue using this v1 endpoint
Get the pair's default notional bracket list, may return ambiguous
values when there have been multiple different symbol brackets under
the pair, suggest using the following GET /dapi/v2/leverageBracket
query instead to get the specific symbol notional bracket list.
Weight(IP): 1
Security Type: USER_DATA
Request parameters.
Get the symbol's notional bracket list.
Weight: 1 (after CM migration: 1 with symbol / 2 without symbol)
Security Type: USER_DATA
Request parameters.
Get older market historical trades.
Weight(IP): 20
Security Type: MARKET_DATA
Notes:
Request parameters.
Get present open interest of a specific symbol.
Weight(IP): 1
Request parameters.
Query open interest stats
Weight(IP): 1
Notes:
Request parameters.
Query orderbook on specific symbol
Weight: Adjusted based on the limit:
| Limit | Weight |
|---|---|
| 5, 10, 20, 50 | 2 |
| 100 | 5 |
| 500 | 10 |
| 1000 | 20 |
Request parameters.
Place multiple orders
Parameter rules are same with New Order
Batch orders are processed concurrently, and the order of matching is not guaranteed.
The order of returned contents for batch orders is the same as the order of the order list.
Weight(IP): 5
Security Type: TRADE
Notes:
batchOrders must be a JSON array of order parameter objects./dapi/v1/batchOrders?batchOrders=[{"type":"LIMIT","timeInForce":"GTC","symbol":"BTCUSD_PERP","side":"BUY","price":"10001","quantity":"1"}]Request parameters.
Query position ADL quantile estimation
Values update every 30s. Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high. For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, "LONG", "SHORT", and "BOTH" will be returned to show the positions' adl quantiles of different position sides. If the positions of the symbol are crossed margined in Hedge Mode: "HEDGE" as a sign will be returned instead of "BOTH"; A same value caculated on unrealized pnls on long and short sides' positions will be shown for "LONG" and "SHORT" when there are positions in both of long and short sides.
Weight(IP): 5
Security Type: USER_DATA
Request parameters.
Get current account information.
Weight(IP): 1
Security Type: USER_DATA
Notes:
marginAsset nor pair is sent, positions of all symbols with TRADING status will be returned.ACCOUNT_UPDATE to meet your timeliness and accuracy needs.Request parameters.
Premium index kline bars of a symbol. Klines are uniquely identified by their open time.
Weight: Based on parameter LIMIT
| LIMIT | weight |
|---|---|
| [1,100) | 1 |
| [100, 500) | 2 |
| [500, 1000] | 5 |
| > 1000 | 10 |
Notes:
Request parameters.
Query Current Open Order
Weight(IP): 1
Security Type: USER_DATA
Notes:
orderId or origClientOrderId must be sentRequest parameters.
Query index price constituents
Weight(IP): 1
Request parameters.
Check an order's status.
These orders will not be found: order status is CANCELED or EXPIRED AND order has NO filled trade AND created time + 3 days < current time order create time + 90 days < current time
Weight(IP): 1
Security Type: USER_DATA
Notes:
orderId or origClientOrderId must be sent.Request parameters.
Get recent market trades
Weight(IP): 5
Notes:
Request parameters.
Generic function to send a request.
The API endpoint to call.
HTTP method to use (GET, POST, DELETE, etc.).
Query parameters for the request.
Body parameters for the request.
A promise resolving to the response data object.
Generic function to send a signed request.
The API endpoint to call.
HTTP method to use (GET, POST, DELETE, etc.).
Query parameters for the request.
Body parameters for the request.
A promise resolving to the response data object.
Start a new user data stream. The stream will close after 60 minutes
unless a keepalive is sent. If the account has an active listenKey,
that listenKey will be returned and its validity will be extended for
60 minutes.
Weight(IP): 1
Security Type: USER_STREAM
Best price/qty on the order book for a symbol or symbols.
Weight: 2 for a single symbol, 5 when the symbol parameter is omitted
Notes:
Request parameters.
Latest price for a symbol or symbols.
Weight: 1 for a single symbol, 2 when the symbol parameter is omitted
Notes:
Request parameters.
Taker Buy Volume: the total volume of buy orders filled by takers within the period.
Taker Sell Volume: the total volume of sell orders filled by takers within the period.
Weight(IP): 1
Notes:
Request parameters.
Test connectivity to the Rest API.
Weight(IP): 1
24 hour rolling window price change statistics.
Weight: 1 for a single symbol, 40 when the symbol parameter is omitted Careful* when accessing this with no symbol.
Notes:
Request parameters.
The proportion of net long and net short accounts to total accounts of the top 20% users with the highest margin balance. Each account is counted once only.
Long Account % = Accounts of top traders with net long positions / Total accounts of top traders with open positions
Short Account % = Accounts of top traders with net short positions / Total accounts of top traders with open positions
Long/Short Ratio (Accounts) = Long Account % / Short Account %
Weight(IP): 1
Security Type: Accounts
Notes:
Request parameters.
The proportion of net long and net short positions to total open positions of the top 20% users with the highest margin balance.
Long Position % = Long positions of top traders / Total open positions of top traders
Short Position % = Short positions of top traders / Total open positions of top traders
Long/Short Ratio (Positions) = Long Position % / Short Position %
Weight(IP): 1
Security Type: Positions
Notes:
Request parameters.
Query user commission rate
Weight(IP): 20
Security Type: USER_DATA
Request parameters.
User's Force Orders
Weight: 20 (after CM migration: 20 with symbol / 50 without symbol)
Security Type: USER_DATA
Notes:
Request parameters.
Get current account information.
Weight(IP): 5
Security Type: USER_DATA
Notes: