Eligibility
For more information, please refer to FAQ.
Supported Products:*
Unsupported Products:*
We support several types of API keys:
Ed25519 (recommended) HMAC RSA
We recommend to use Ed25519 API keys as it should provide the best performance and security out of all supported key types. We accept PKCS#8 (BEGIN PUBLIC KEY). For how to generate an RSA key pair to send API requests on Binance. Please refer to the document below FAQ .
How to use the Margin Special Key*
sapi endpoint to create your margin special API Key.symbol parameter.symbol parameter in the API Key creation request.https://api.binance.com/api/v3/*) endpoints.Read REST API or WebSocket API documentation to learn how to use different API keys
You need to enable Permits “Enable Spot & Margin Trading” option for the API Key which requests this endpoint.
Weight(UID): 1
Security Type: TRADE
Response Notes:
Error Code Description
UNSUPPORTED_OPERATION : Portfolio Margin is an unsupported product, please change the account type to a supported margin product.
Forbidden: Cross Margin Pro accounts require additional agreements, please contact your relationship manager.
Request parameters.
Deleting your Margin Special Key alone does not exit you from the Margin Special Key framework or discharge your obligations under the Margin Special Key Supplemental Product Terms. To fully exit, you must:
Only after step 4 is completed and the exit status is confirmed by Binance will your account revert to standard liquidation logic and no longer be subject to the Margin Special Key Supplemental Product Terms.
If apiKey is given, apiName will be ignored. If apiName is given with no apiKey, all apikeys with given apiName will be deleted.
You need to enable Permits “Enable Spot & Margin” option for the API Key which requests this endpoint.
Weight(UID): 1
Security Type: TRADE
Request parameters.
Edit ip restriction. This only applies to Special Key for Low Latency Trading.
You need to enable Permits “Enable Spot & Margin” option for the API Key which requests this endpoint.
Weight(UID): 1
Security Type: TRADE
Request parameters.
Exit the Margin Special Key mode for Cross Margin Classic accounts.
All outstanding liabilities under the Cross Margin Classic account must be fully repaid before calling this endpoint.* Deleting the Margin Special Key alone does not constitute a valid exit.
When a user creates a Margin Special API Key, the account enters "Special Key Mode". Upon a successful request, the following actions will be performed atomically:
For more information, please refer to FAQ.
Preconditions:*
The following conditions must be met; otherwise the request will be rejected:
You need to enable "Permits Enable Spot & Margin Trading" option for the API Key which requests this endpoint.
Weight(UID): 10
Security Type: TRADE
Request parameters.
Get Force Liquidation Record
Weight(IP): 1
Security Type: USER_DATA
Notes:
Request parameters.
Query the coins which can be small liability exchange
Weight(IP): 100
Security Type: USER_DATA
Request parameters.
Get Small liability Exchange History
Weight(UID): 100
Security Type: USER_DATA
Request parameters.
Repays the outstanding cross-margin liquidation loan from the user's spot wallet. A liquidation loan represents the account deficit incurred when account equity turns negative during liquidation (bankruptcy). The repayment amount must be greater than 0 and cannot exceed the remaining loan balance. If the Spot Account has insufficient USDC balance, the repayment will fail.
Weight(UID): 100
Security Type: MARGIN
Request parameters.
Cancels all active orders on a symbol for margin account.
This includes OCO orders.
Weight(IP): 1
Security Type: TRADE
Request parameters.
Cancel an entire Order List for a margin account.
Weight(UID): 1
Security Type: TRADE
Notes:
Request parameters.
Cancel an active order for margin account.
Weight(IP): 10
Security Type: TRADE
Notes:
Request parameters.
Send in a new OCO for a margin account
Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
Security Type: TRADE
Notes:
Request parameters.
Post a new order for margin account.
Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
Security Type: TRADE
Notes:
Request parameters.
Post a new OTO order for margin account:
An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
The first order is called the working order and must be LIMIT or
LIMIT_MAKER. Initially, only the working order goes on the order book.
The second order is called the pending order. It can be any order
type except for MARKET orders using parameter quoteOrderQty. The
pending order is only placed on the order book when the working order
gets fully filled.
If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
When the order list is placed, if the working order gets immediately
fully filled, the placement response will show the working order as
FILLED but the pending order will still appear as PENDING_NEW. You
need to query the status of the pending order again to see its updated
status.
OTOs add 2 orders to the unfilled order count,
EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.
Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
Security Type: TRADE
Notes:
pendingType or workingType, some optionalworkingType = LIMIT | workingTimeInForce | | | pendingType = LIMIT | pendingPrice, pendingTimeInForce | | | pendingType = STOP_LOSS or TAKE_PROFIT | pendingStopPrice and/or pendingTrailingDelta | | | pendingType = STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT | pendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce | | | pendingTrailingDelta is provided | pendingPrice | |Request parameters.
Post a new OTOCO order for margin account:
An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.
The first order is called the working order and must be LIMIT or
LIMIT_MAKER. Initially, only the working order goes on the order book.
The behavior of the working order is the same as the OTO.
OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.
The rules of the pending above and pending below follow the same rules as the Order List OCO.
OTOCOs add 3 orders against the unfilled order count,
EXCHANGE_MAX_NUM_ORDERS filter, and MAX_NUM_ORDERS filter.
Weight: 6(UID) or 1500(UID) when sideEffectType is MARGIN_BUY or AUTO_BORROW_REPAY
Security Type: TRADE
Notes:
pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory: | Type | Additional mandatory parameters | Additional information | | ------------------------------------ | ------------------------------------------------------------ | ---------------------- | | workingType = LIMIT | workingTimeInForce | | | pendingAboveType= LIMIT_MAKER | pendingAbovePrice | | | pendingAboveType= STOP_LOSS | pendingAboveStopPrice and/or pendingAboveTrailingDelta | | | pendingAboveType=STOP_LOSS_LIMIT | pendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce | | | pendingBelowType= LIMIT_MAKER | pendingBelowPrice | | | pendingBelowType= STOP_LOSS | pendingBelowStopPrice and/or pendingBelowTrailingDelta | | | pendingBelowType=STOP_LOSS_LIMIT | pendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce | | | pendingAboveTrailingDelta is provided | pendingAbovePrice | | | pendingBelowTrailingDelta is provided | pendingBelowPrice | |Request parameters.
Margin Manual Liquidation
Weight(UID): 3000
Security Type: TRADE
Notes:
Request parameters.
Displays the user's current margin order count usage for all intervals.
Weight(IP): 20
Security Type: TRADE
Request parameters.
Query the current user's cross-margin liquidation loan information, including the original loan amount, repaid amount, and remaining amount. When a cross-margin account is liquidated and the account equity turns negative (bankruptcy), the system generates a liquidation loan record representing the deficit. This represents the shortfall amount denominated in USDC.
Weight(UID): 100
Security Type: USER_DATA
Request parameters.
Query the repayment history of cross-margin liquidation loans (deficit caused by bankruptcy during liquidation). Supports time-range filtering and pagination.
Weight(UID): 100
Security Type: USER_DATA
Notes:
startTime is earlier than 90 days ago, it will be clamped to 90 days ago.SUCCESS or PENDING are returned. Failed repayment records are excluded.Request parameters.
Retrieves all OCO for a specific margin account based on provided optional parameters
Weight(IP): 200
Security Type: USER_DATA
Request parameters.
Query Margin Account's All Orders
Weight(IP): 200
Security Type: USER_DATA
Notes:
If orderId is set, it will get orders >= that orderId. Otherwise the orders within 24 hours are returned.
For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
Less than 24 hours between startTime and endTime.
Request parameters.
Retrieves a specific OCO based on provided optional parameters
Weight(IP): 10
Security Type: USER_DATA
Request parameters.
Query Margin Account's Open OCO
Weight(IP): 10
Security Type: USER_DATA
Request parameters.
Query Margin Account's Open Orders
Weight(IP): 10
Security Type: USER_DATA
Notes:
If the symbol is not sent, orders for all symbols will be returned in an array.
When all symbols are returned, the number of requests counted against the rate limiter is equal to the number of symbols currently trading on the exchange.
If isIsolated ="TRUE", symbol must be sent.
Request parameters.
Query Margin Account's Order
Weight(IP): 10
Security Type: USER_DATA
Notes:
Either orderId or origClientOrderId must be sent.
For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
Request parameters.
Query Margin Account's Trade List
Weight(IP): 10
Security Type: USER_DATA
Notes:
If fromId is set, it will get trades >= that fromId. Otherwise the trades within 24 hours are returned.
Less than 24 hours between startTime and endTime.
Request parameters.
Displays the list of orders that were expired due to STP. (Self-Trade Prevention).
Weight(IP): 10
Security Type: USER_DATA
Notes:
Supported parameter combinations:
symbol + preventedMatchId
symbol + orderId
symbol + orderId + fromPreventedMatchId
If orderId is provided, all prevented matches for that order will be
returned.
If preventedMatchId is provided, the specific prevented match will
be returned.
A single request returns a maximum of 500 records. If there are more
than 500 records, use symbol + orderId + fromPreventedMatchId
combination for pagination.
Request parameters.
Query Special Key Information.
This only applies to Special Key for Low Latency Trading.
Weight(UID): 1
Security Type: TRADE
Request parameters.
This only applies to Special Key for Low Latency Trading.
Weight(UID): 1
Security Type: TRADE
Request parameters.
Small Liability Exchange
Weight(UID): 3000
Security Type: MARGIN
Notes:
Request parameters.
TradeApi - object-oriented interface TradeApi