Change Log
WEBSOCKET
- Add user data stream:
- new event
CONDITIONAL_ORDER_TRIGGER_REJECT
to the order reject reason for triggered TP/SL order
- new event
**2023-05-24**
REST
GET /fapi/v1/pmExchangeInfo
will be deprecated on 5/29 due to removingnotionalLimit
restriction.
**2023-05-05**
REST
- New endpoints
PUT /fapi/v1/order
andPUT /fapi/v1/batchOrders
to support limit order modify - New endpoint
GET /fapi/v1/orderAmendment
to get order modify history
WEBSOCKET
- New type "AMENDMENT" as order modify in Execution Type
x
of Order Update eventORDER_TRADE_UPDATE
**2023-04-17**
RELEASE DATE 2023-04-18
The recvWindow
check will also be performed when orders reach matching engine. The recvWindow
will be checked more precisely on order placing endpoints.
recvWindow Logic Before Release:
- The order placing requests are valid if
recvWindow
+timestamp
=> REST API service servertimestamp
recvWindow Logic After Release:
Add new recwWindow check: the order placing requests are valid if
recvWindow
+timestamp
=> matching enginetimestamp
Impacted Endpoints:
- POST /fapi/v1/order (HMAC SHA256)
- PUT /fapi/v1/order (HMAC SHA256)
- POST /fapi/v1/batchOrders (HMAC SHA256)
- PUT /fapi/v1/batchOrders (HMAC SHA256)
**2023-03-28**
Referal Rebate Logic Before Release
- For every trade,the referal rebate balance change will be reflected in
ACCOUNT_UPDATE
event of USER-DATA-STREAM in real time:
Referal Rebate Logic After Release
- Referral rebates are aggregated every 20 minutes and reflected as a single push in the
ACCOUNT_UPDATE
event of the USER-DATA-STREAM, showing the total sum of rebates earned from multiple referrals.
**2023-03-08**
RELEASE DATE 2023-03-22
Order Logic Before Release:
- When placing order with
timeInForce
FOK
orGTX
(Post-only), user will get order response withstatus
= “NEW“ and correspondingorder_trade_update
withx
= “NEW”,X
= “NEW”. If the orders can't meet execution criteria, user will receive another websocketorder_trade_update
messagex
= “EXPIRED”,X
= “EXPIRED”. The order can be found inGET /fapi/v1/order
orGET /fapi/v1/allOrders
.
Order Logic After Release:
- When placing order with
timeInForce
FOK
orGTX
(Post-only), if the order can't meet execution criteria, order will get rejected directly and receive error response, noorder_trade_update
message in websocket. The order can't be found inGET /fapi/v1/order
orGET /fapi/v1/allOrders
.
- Impacted Endpoints:
- POST /fapi/v1/order (HMAC SHA256)
- POST /fapi/v1/batchOrders (HMAC SHA256)
- GET /fapi/v1/order (HMAC SHA256)
- GET /fapi/v1/allOrders (HMAC SHA256)
**2023-01-04**
WEBSOCKET
- Delete Order Status
NEW_INSURANCE
andNEW_ADL
in Order Update Event
**2022-12-16**
WEBSOCKET
- New WebSocket stream
!contractInfo
for symbol information update
**2022-11-29**
WEB SOCKET USER DATA STREAM
- New WebSocket stream
STRATEGY_UPDATE
in USER-DATA-STREAM: update when a strategy is created/cancelled/expired, ...etc. - New WebSocket stream
GRID_UPDATE
in USER-DATA-STREAM: update when a sub order of a grid is filled or partially filled.
**2022-10-13**
Note: This change will be effictive on 2022-10-17
REST RATE LIMIT WEIGHT
Endpoint GET /fapi/v1/ticker/bookTicker
Weight Update:
2 for a single symbol;
5 when the symbol parameter is omitted
**2022-09-22**
- Update endpoint for Account/Trade:
GET /fapi/v1/income
: Support more incomeType
- Add new endpoint for Portfolio Margin:
GET /fapi/v1/pmAccountInfo
: Get Portfolio Margin current account information.
**2022-07-27**
REST RATE LIMIT WEIGHT
- The weight of endpoint
GET /fapi/v1/trades
is updated to 5
**2022-06-28**
REST
- New endpoint
GET /fapi/v1/pmExchangeInfo
to get current Portfolio Margin exchange trading rules.
**2022-04-08**
WEBSOCKET
- New base url
wss://nbstream.binance.com/lvt-p
for BLVT streams<tokenName>@tokenNav
and<tokenName>@nav_kline_<interval>
. More details: Websocket BLVT Info Streams and Websocket BLVT NAV Kline/Candlestick Streams
**2022-03-01**
REST
- New endpoint
GET /fapi/v1/income/asyn
to get Download Id For Futures Transaction History - New endpoint
GET /fapi/v1/income/asyn/id
to get Futures Transaction History Download Link by Id
**2022-02-10**
REST
- Update
GET /fapi/v2/account
endpoints:- If user is in multiAssetsMargin mode, all assets will be included in calculation for fields
totalInitialMargin``totalMaintMargin``totalWalletBalance``totalUnrealizedProfit``totalMarginBalance``totalPositionInitialMargin``totalOpenOrderInitialMargin``totalCrossWalletBalance``totalCrossUnPnl``availableBalance``maxWithdrawAmount
and the results will be show as value in USD - If user is in singleAssetsMargin mode, only USDT assets are included in the calculation(same as before)
- If user is in multiAssetsMargin mode, all assets will be included in calculation for fields
**2021-12-30**
WEBSOCKET
- New connection method for WEBSOCKET.
- Base Url is
wss://fstream-auth.binance.com
- Streams can be access either in a single raw stream or a combined stream
- Raw streams are accessed at
/ws/<streamName>?listenKey=<validateListenKey>
- Combined streams are accessed at
/stream?streams=<streamName1>/<streamName2>/<streamName3>&listenKey=<validateListenKey>
<validateListenKey>
must be a valid listenKey when you establish a connection.
- Base Url is
- More details: Websocket Market Streams and User Data Streams
**2021-11-02**
REST
- New endpoint
GET /fapi/v1/assetIndex
to get asset index for Multi-Assets mode margin asset
**2021-07-06**
REST
- New field
updateTime
as last update time of asset and position in response ofGET /fapi/v2/account
andGET /fapi/v2/positionRisk
- New fields in the response of
GET /fapi/v1/exchangeInfo
:- "liquidationFee" for liquidation fee rate
- "marketTakeBound" for he max price difference rate( from mark price) a market order can make
**2021-06-15**
WEBSOCKET
- New fields "q" and "i" for quote asset and index price added in stream
<symbol>@compositeIndex
REST
- Update endpoints:
- New fields
component
andquoteAsset
as component asset and quote asset added in response ofGET /fapi/v1/indexInfo
- New fields
**2021-05-06**
WEBSOCKET
- Update streams:
- Previous Leverage Update event
ACCOUNT_CONFIG_UPDATE
expanded as account configuration update event, including leverage update and Multi-Assets margin status update. - Balance and Position Update event
ACCOUNT_UPDATE
add new event reason typem
asAUTO_EXCHANGE
to represent Multi-Assets margin auto-exchange event
- Previous Leverage Update event
REST
New endpoints:
POST /fapi/v1/multiAssetsMargin
to change Multi-Assets margin modeGET /fapi/v1/multiAssetsMargin
to check Multi-Assets margin mode
Update endpoints:
- New object
assets
as asset information in response ofGET /fapi/v1/exchangeInfo
. - New field
marginAvailable
in response ofGET /fapi/v2/balance
andGET /fapi/v2/account
to indicate whether the asset can be used as margin in Multi-Assets mode.
- New object
**2021-04-27**
WEBSOCKET
- The following liquidation orders streams do not push realtime order data anymore. Instead, they push snapshot order data at a maximum frequency of 1 order push per second.:
<symbol>@forceOrder
!forceOrder@arr
REST
- The endpoint
GET /fapi/v1/allForceOrders
stop being maintained and no longer accepts request.
**2021-04-22**
WEBSOCKET
- New field "bc" for balance change in event "ACCOUNT_UPDATE"
**2021-03-02**
New endpoint
GET /fapi/v1/indexPriceKlines
to get index price kline/candlestick data.New endpoint
GET /fapi/v1/markPriceKlines
to get mark price kline/candlestick data.
**2021-02-24**
REST RATE LIMIT WEIGHT
- The weight of endpoint
GET /fapi/v2/balance
is updated to 5 - The weight of endpoint
GET /fapi/v2/positionRisk
is updated to 5
**2021-02-22**
REST RATE LIMIT WEIGHT
- The weight of endpoint
GET /fapi/v1/income
is updated to 30
REST
- The query time period for endpoint
GET /fapi/v1/allOrders
must be less than 7 days. - The query time period for endpoint
GET /fapi/v1/allForceOrders
must be within the recent 7 days.
**2021-01-26**
WEB SOCKET USER DATA STREAM
- New WebSocket stream
ACCOUNT_CONFIG_UPDATE
in USER-DATA-STREAM for leverage changed update
REST RATE LIMIT WEIGHT
- Following endpoints' weights will be updated to 20 with symbol and 50 without symbol:
GET /fapi/v1/allForceOrders
GET /fapi/v1/forceOrders
REST
- New filter "MIN_NOTIONAL" whicht defines the minimum notional value allowed for an order on a symbol, and shown in the
/fapi/v1/exchangeInfo
**2021-01-21**
The regular expression rule for newClientOrderId
updated as ^[\.A-Z\:/a-z0-9_-]{1,36}$
**2021-01-04**
REST RATE LIMIT WEIGHT
- Following endpoints will use new weight rule based on the paremeter "LIMIT" in the request:
GET /fapi/v1/klines
GET /fapi/v1/continuousKlines
- Following endpoints' weights will be updated to 20:
GET /fapi/v1/historicalTrades
GET /fapi/v1/allForceOrders
GET /fapi/v1/forceOrders
GET /fapi/v1/aggTrades
**2020-12-08**
WEBSOCKET
- New field
e
for event type in payload of streams<symbol>@bookTicker
and!bookTicker
- New field
P
for estimated settle price in payload of streams<symbol>@markPrice
,<symbol>@markPrice@1s
,!markPrice@arr
, and!markPrice@arr@1s
. - New stream
<pair>_<contractType>@continuousKline_<interval>
for continuous contract kline
REST API
New field "estimatedSettlePrice" in response to
GET /fapi/v1/premiumIndex
New fields in response to
GET /fapi/v1/exchangeInfo
:- "pair"
- "contractType"
- "deliveryDate"
- "onboardDate"
New endpoint
GET /fapi/v1/continuousKlines
to get continuous contract kline data
ENUM
- Contract types:
- PERPETUAL
- CURRENT_MONTH
- NEXT_MONTH
- CURRENT_QUARTER
- NEXT_QUARTER
**2020-11-27**
- New endpoint
GET /fapi/v1/commissionRate
to get user commission rate.
**2020-11-13**
WEB SOCKET STREAM
- In order to provide users with more secure and stable services, the update time of
<symbol>depth@0ms
and<symbol>@depth<level>@0ms
is dynamically adjusted according to the total amount of data traffic and other objective conditions.
**2020-11-10**
- New field "marginAsset" for margin asset in the response to
GET /fapi/v1/exchangeInfo
. - New field "positionAmt" for position amount in the response to
GET /fapi/v2/account
.
**2020-11-09**
WEB SOCKET USER DATA STREAM
Please notice: new streamlined and optimized push rules on event ACCOUNT_UPDATE
in USER-DATA-STREAM
When an asset of a user is changed:
- Only this asset and its balance information will be pushed
- Other assets and information will no longer be pushed even the balances may not be 0
- If none of the open positions change, the position "P" will only return an empty
[]
When a position or the margin type of a symbol is changed:
- "P" will push the details in the "BOTH" position of this symbol
- If the change happens in "LONG" or "SHORT" position, the changed "LONG" or "SHORT" position of this symbol will be pushed
- Initialized "LONG" or "SHORT" isolated position of this symbol will also be pushed
- Position information of other symbols will no longer be pushed, even their positions may not be 0
In short, the full information of assets and positions should be obtained via the related RESTful endpoints(
GET /fapi/v2/account
andGET /fapi/v2/positionRisk
), and the locally cached asset or position data can be updated via the eventACCOUNT_UPDATE
in Websocket USER-DATA-STREAM with the information of changed asset or position.
- Please visit here to get examples for helping to understand the upgrade.
**2020-10-27**
WEB SOCKET STREAM
- The maximum stream number that a single connection can listen to changes as 200.
**2020-10-10**
WEBSOCKET
- New WebSocket streams
<symbol>@compositeIndex
for composite index symbol information.
**2020-10-09**
- New endpoint
GET /fapi/v1/indexInfo
to get information of composite index.
**2020-09-18**
- New endpoint
GET /fapi/v1/apiTradingStatus
to get futures API trading quantitative rules indicators
**2020-09-16**
- New endpoint
GET /fapi/v1/lvtKlines
to get gistorical BLVT Kline.
The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on fapi.
WEBSOCKET
- New WebSocket streams for BLVT
The BLVT NAV system is working relatively with Binance Futures, so the endpoint is based on futures websocket service.
**2020-09-09**
- Some orders that were cancelled/expired will be removed gradually from API endpoints.
- Orders that meet criteria
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
- created time + 7 days < current time
- order status is
- These endpoints are affected:
GET /fapi/v1/order
GET /fapi/v1/allOrders
- Orders that meet criteria
**2020-08-14**
- New field "indexPrice" in response to endpoint
GET /fapi/v1/premiumIndex
. - New field "i" for indexPrice in payload of ws streams:
<symbol>@markPrice
,<symbol>@markPrice@1s
,!markPrice@arr
,!markPrice@arr@1s
**2020-08-12**
- New endpoint
GET /fapi/v1/forceOrders
to get the user's force orderes.
**2020-07-30**
- New endpoint
GET /fapi/v1/adlQuantile
to get the positions' ADL quantile estimation values
**2020-07-17**
- Weights of endpoint
GET /fapi/v1/income
has been changed as 20
**2020-07-02**
WEBSOCKET
- New field "m" for event reason type in event "ACCOUNT_UPDATE"
- New field "rp" for the realized profit of the trade in event "ORDER_TRADE_UPDATE"
**2020-06-15**
- New fields in responses to
GET /fapi/v2/account
andGET /fapi/v2/balance
:availableBalance
maxWithdrawAmount
**2020-06-04**
- New endpoints of version 2 of fapi, having better performance than the v1 endpoints:
GET /fapi/v2/account
GET /fapi/v2/balance
**2020-06-02**
- New endpoint
GET /fapi/v2/positionRisk
in version 2 of fapi:- User can choose to send specific "symbol".
- All symbols in the market can be returned.
- Different responses for "One-way" or "Hedge" position mode.
- Better performance than the v1 endpoint.
**2020-05-18**
- New parameter
closePosition
for endpointPOST /fapi/v1/order
:
If aSTOP_MARKET
orTAKE_PROFIT_MARKET
order withclosePosition=true
is triggered,all of the current long position( ifSELL
order) or current short position( ifBUY
order) will be closed. - New field
closePosition
in response to endpoints:POST /fapi/v1/order
POST /fapi/v1/batchOrders
GET /fapi/v1/order
DELETE /fapi/v1/order
DELETE /fapi/v1/batchOrders
GET /fapi/v1/openOrder
GET /fapi/v1/openOrders
GET /fapi/v1/allOrders
**2020-05-18**
- Some orders that were cancelled/expired will be removed gradually from API endpoints, but they are still available from Web UI.
- Orders that meet criteria
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
- created time + 30 days < current time
- order status is
- These endpoints are affected:
GET /fapi/v1/order
GET /fapi/v1/allOrders
- Orders that meet criteria
**2020-05-15**
- New fields in payloads of
<symbol>@bookTicker
and!bookTicker
:E
for event timeT
for transaction time
**2020-05-14**
- New field
time
for transaction time in response to endpoints:GET /fapi/v1/ticker/price
GET /fapi/v1/ticker/bookTicker
GET /fapi/v1/openInterest
**2020-05-11**
- New endpoint
POST /fapi/v1/countdownCancelAll
to 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.
**2020-05-06**
REST
- Endpoint
GET /fapi/v1/leverageBracket
is changed as "USER-DATA". It need to be signed, and timestamp is needed.
WEB SOCKET USER DATA STREAM
- Please notice: event
ACCOUNT_UPDATE
in USER-DATA-STREAM will be pushed with only account balance or relative position when "FUNDING FEE" occurs.- When "FUNDING FEE" occurs in a crossed position,
ACCOUNT_UPDATE
will be pushed with only the balanceB
(including the "FUNDING FEE" asset only), without any positionP
message. - When "FUNDING FEE" occurs in an isolated position,
ACCOUNT_UPDATE
will be pushed with only the balanceB
(including the "FUNDING FEE" asset only) and the relative position messageP
( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message).
- When "FUNDING FEE" occurs in a crossed position,
**2020-04-25**
New fields in USER DATA STREAM event
ORDER_TRADE_UPDATE
:cp
stands for Close-All conditional orderAP
for Activation Price withTRAILING_STOP_MARKET
ordercr
for Callback Rate withTRAILING_STOP_MARKET
order
New USER DATA STREAM event
MARGIN_CALL
.
**2020-04-17**
- New parameter
newOrderRespType
for response type in endpointPOST /fapi/v1/order
.ACK
andRESULT
are supported. And fornewOrderRespType= RESULT
:
**2020-04-14**
WEB SOCKET STREAM
- WebSocket connections have a limit of 10 incoming messages per second. A message is considered:
- A PING frame
- A PONG frame
- A JSON control message (e.g. subscribe, unsubscribe)
- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
- A single connection can listen to a maximum of 200 streams.
**2020-04-09**
- New endpoint of futures trading data:
GET /futures/data/takerlongshortRatio
**2020-04-08**
- New endpoint
GET /fapi/v1/positionSide/dual
to get current position mode. - New endpoint
POST /fapi/v1/batchOrders
to place multiple orders.
**2020-04-06**
Please notice: event
ACCOUNT_UPDATE
in USER-DATA-STREAM will not be pushed without update of account balances or positions.ACCOUNT_UPDATE
will be pushed only when update happens on user's account, including changes on balances, positions, or margin type.- Unfilled orders or cancelled orders will not make the event
ACCOUNT_UPDATE
pushed, since there's no change on positions. - Only positions of symbols with non-zero isolatd wallet or non-zero position amount will be pushed in the "position" part of the event
ACCOUNT_UPDATE
.
New endpoint
POST /fapi/v1/positionSide/dual
to change position mode: Hedge Mode or One-way Mode.New parameter
positionSide
in the following endpoints:POST /fapi/v1/order
POST /fapi/v1/positionMargin
New field
positionSide
in the responses to the following endpoints:POST /fapi/v1/order
GET /fapi/v1/order
DELETE /fapi/v1/order
DELETE /fapi/v1/batchOrders
GET /fapi/v1/openOrder
GET /fapi/v1/openOrders
GET /fapi/v1/allOrders
GET /fapi/v1/account
GET /fapi/v1/positionMargin/history
GET /fapi/v1/positionRisk
GET /fapi/v1/userTrades
New field
ps
for "position side"in USER_DATA_STREAM eventsACCOUNT_UPDATE
andORDER_TRADE_UPDATE
.
**2020-03-30**
- New endpoints of futures trading data:
GET /futures/data/openInterestHist
GET /futures/data/topLongShortAccountRatio
GET /futures/data/topLongShortPositionRatio
GET /futures/data/globalLongShortAccountRatio
- New order type:
TRAILING_STOP_MARKET
**2020-02-20**
- New endpoint to query specific current open order:
GET /fapi/v1/openOrder
**2020-02-17**
- Update time changed as 1000ms for streams
<symbol>@ticker
and!ticker@arr
- New diff depth data with 500ms updates:
<symbol>@depth@500ms
- New partial depth data with 500ms updates:
<symbol>@depth<level>@500ms
**2020-02-12**
New SDK and Code Demonstration on Java
Faster mark price websocket data with 1s updates:
<symbol>@markPrice@1s
and!markPrice@arr@1s
**2020-02-05**
- New market data endpoint
GET /fapi/v1/leverageBracket
to check notional and leverage brackets.
**2020-01-19**
- "cumQty" is going to be removed from the responses to
DELETE /fapi/v1/order
,DELETE /fapi/v1/batchOrders
and otherorder
relatived endpoints in the coming weeks.
Please use "executedQty" instead.
**2020-01-17**
- New SDK and Code Demonstration on Python
**2020-01-06**
- Faster diff data with real time updates:
<symbol>@depth@0ms
**2020-01-03**
New endpoints related to isolated position:
POST /fapi/v1/marginType
POST /fapi/v1/positionMargin
GET /fapi/v1/positionMargin/history
New field in response to
GET /fapi/v1/positionRisk
related to isolated position:marginType
isolatedMargin
New field in response to
GET /fapi/v1/account
related to isolated position:isolated
New field in event
ACCOUNT_UPDATE
:- "cw" for cross wallet
- "mt" for margin type
- "iw" for isolated wallet (if isolated)
**2019-12-19**
- New endpoint
GET /fapi/v1/openInterest
to get present open interest of a specific symbol.
**2019-12-18**
- New event type in user data stream:
listenKeyExpired
.
**2019-12-12**
- New endpoint
DELETE /fapi/v1/allOpenOrders
to cancel all open orders of a specific symbol. - New endpoint
DELETE /fapi/v1/batchOrders
to cancel a list of open orders. reduceOnly
has been supported in orders with type:TAKE_PROFIT
TAKE_PROFIT_MARKET
STOP
STOP_MARKET
**2019-11-29**
- New endpoint
GET /fapi/v1/allForceOrders
to get all liquidation orders. - New websocket streams:
<symbol>@forceOrder
for liquidation order streams!forceOrder@arr
for all market liquidation order streams
**2019-11-25**
GET /fapi/v1/account
has new field:positions
- Added new field
time
for order creation time in:GET /fapi/v1/openOrders
GET /fapi/v1/order
GET /fapi/v1/allOrders
**2019-11-15**
- New websocket streams:
!miniTicker@arr
: All market 24hr mini-tickers stream.!ticker@arr
: : All market 24hr tickers stream.
**2019-11-12**
- WSS now supports live subscribing/unsubscribing to streams.
**2019-11-05**
- New order type:
STOP_MARKET
,TAKE_PROFIT_MARKET
.
- New parameter
workingType
inPOST /fapi/v1/order
:
order with stop price can be triggered by "CONTRACT_PRICE" or "MARK_PRICE" - New keys in USER-DATA-STREAMS:
- in
ORDER_TRADE_UPDATE
:- "T" as transaction time
- "wt" as workingType
- in
ACCOUNT_UPDATE
:- "T" as transaction time
- in
**2019-10-28**
- New rest endpoint for income flow history
GET /fapi/v1/income
**2019-10-25**
- Added "up" in event
ACCOUNT_UPDATE
in user data stream: the unrealized PnL of the position. - Added "R" in event
ORDER_TRADE_UPDATE
in user data stream, showing if the trade is reduce only.
**2019-10-24**
- New WebSocket streams for booktickers added:
<symbol>@bookTicker
and!bookTicker
. - New WebSocket streams for partial orderbook added:
<symbol>@depth<levels>
and<symbol>@depth<levels>@100ms
- Faster diff data with 100ms updates:
<symbol>@depth@100ms
- Added
Update Speed
: toWebsocket Market Streams
**2019-10-18**
- New endpoint
POST /fapi/v1/leverage
for changing user's initial leverage in specific symbol market. - Added "leverage" for current initial leverage and "maxNotionalValue" for notional value limit of current initial leverage in response to
GET /fapi/v1/positionRisk
. reduceOnly
now is supported in theMARKET
orders.
**2019-10-14**
- Added
GET /fapi/v1/fundingRate
for getting funding fee rate history.
**2019-10-11**
- Added "m" in event
ORDER_TRADE_UPDATE
in user data stream, showing if the trade is the maker side.
**2019-10-08**
- New order parameter
reduceOnly
forLIMIT
orders. - New order type
TAKE_PROFIT
.
**2019-09-20**
New retured values in response to GET /fapi/v1/account:
maxWithdrawAmount
,openOrderInitialMargin
,positionInitialMargin
New retured values in response to GET /fapi/v1/positionRisk:
liquidationPrice
General Info
#
testnet- Most of the endpoints can be used in the testnet platform.
- The REST baseurl for testnet is "https://testnet.binancefuture.com"
- The Websocket baseurl for testnet is "wss://stream.binancefuture.com"
#
SDK and Code DemonstrationDisclaimer:
- The following SDKs are provided by partners and users, and are not officially produced. They are only used to help users become familiar with the API endpoint. Please use it with caution and expand R&D according to your own situation.
- Binance does not make any commitment to the safety and performance of the SDKs, nor will be liable for the risks or even losses caused by using the SDKs.
#
Python3SDK 1:
To get the provided SDK for Binance Futures Connector,
please visit https://github.com/Binance-docs/binance-futures-connector-python,
or use the command below:
pip install binance-futures-connector
SDK 2:
To get the provided SDK for Binance Futures,
please visit https://github.com/Binance-docs/Binance_Futures_python,
or use the command below:
git clone https://github.com/Binance-docs/Binance_Futures_python.git
#
JavaTo get the provided SDK for Binance Futures,
please visit https://github.com/Binance-docs/Binance_Futures_Java,
or use the command below:
git clone https://github.com/Binance-docs/Binance_Futures_Java.git
#
General API Information- Some endpoints will require an API Key. Please refer to this page
- The base endpoint is: https://fapi.binance.com
- All endpoints return either a JSON object or array.
- Data is returned in ascending order. Oldest first, newest last.
- All time and timestamp related fields are in milliseconds.
- All data types adopt definition in JAVA.
#
HTTP Return Codes- HTTP
4XX
return codes are used for for malformed requests; the issue is on the sender's side. - HTTP
403
return code is used when the WAF Limit (Web Application Firewall) has been violated. - HTTP
429
return code is used when breaking a request rate limit. - HTTP
418
return code is used when an IP has been auto-banned for continuing to send requests after receiving429
codes. - HTTP
5XX
return codes are used for internal errors; the issue is on Binance's side.- If there is an error message "Request occur unknown error.", please retry later.
- HTTP
503
return code is used when:- If there is an error message "Unknown error, please check your request or try again later." returned in the response, the API successfully sent the request but not get a response within the timeout period.
It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success; - If there is an error message "Service Unavailable." returned in the response, it means this is a failure API operation and the service might be unavailable at the moment, you need to retry later.
- If there is an error message "Internal error; unable to process your request. Please try again." returned in the response, it means this is a failure API operation and you can resend your request if you need.
- If there is an error message "Unknown error, please check your request or try again later." returned in the response, the API successfully sent the request but not get a response within the timeout period.
#
Error Codes and Messages- Any endpoint can return an ERROR
The error payload is as follows:
- Specific error codes and messages defined in Error Codes.
#
General Information on Endpoints- For
GET
endpoints, parameters must be sent as aquery string
. - For
POST
,PUT
, andDELETE
endpoints, the parameters may be sent as aquery string
or in therequest body
with content typeapplication/x-www-form-urlencoded
. You may mix parameters between both thequery string
andrequest body
if you wish to do so. - Parameters may be sent in any order.
- If a parameter sent in both the
query string
andrequest body
, thequery string
parameter will be used.
#
LIMITS- The
/fapi/v1/exchangeInfo
rateLimits
array contains objects related to the exchange'sRAW_REQUEST
,REQUEST_WEIGHT
, andORDER
rate limits. These are further defined in theENUM definitions
section underRate limiters (rateLimitType)
. - A
429
will be returned when either rate limit is violated.
#
IP Limits- Every request will contain
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
in the response headers which has the current used weight for the IP for all request rate limiters defined. - Each route has a
weight
which determines for the number of requests each endpoint counts for. Heavier endpoints and endpoints that do operations on multiple symbols will have a heavierweight
. - When a 429 is received, it's your obligation as an API to back off and not spam the API.
- Repeatedly violating rate limits and/or failing to back off after receiving 429s will result in an automated IP ban (HTTP status 418).
- IP bans are tracked and scale in duration for repeat offenders, from 2 minutes to 3 days.
- The limits on the API are based on the IPs, not the API keys.
#
Order Rate Limits- Every order response will contain a
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)
header which has the current order count for the account for all order rate limiters defined. - Rejected/unsuccessful orders are not guaranteed to have
X-MBX-ORDER-COUNT-**
headers in the response. - The order rate limit is counted against each account.
#
Endpoint Security Type- Each endpoint has a security type that determines the how you will interact with it.
- API-keys are passed into the Rest API via the
X-MBX-APIKEY
header. - API-keys and secret-keys are case sensitive.
- API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.
- By default, API-keys can access all secure routes.
Security Type | Description |
---|---|
NONE | Endpoint can be accessed freely. |
TRADE | Endpoint requires sending a valid API-Key and signature. |
USER_DATA | Endpoint requires sending a valid API-Key and signature. |
USER_STREAM | Endpoint requires sending a valid API-Key. |
MARKET_DATA | Endpoint requires sending a valid API-Key. |
TRADE
andUSER_DATA
endpoints areSIGNED
endpoints.
#
SIGNED (TRADE and USER_DATA) Endpoint SecuritySIGNED
endpoints require an additional parameter,signature
, to be sent in thequery string
orrequest body
.- Endpoints use
HMAC SHA256
signatures. TheHMAC SHA256 signature
is a keyedHMAC SHA256
operation. Use yoursecretKey
as the key andtotalParams
as the value for the HMAC operation. - The
signature
is not case sensitive. - Please make sure the
signature
is the end part of yourquery string
orrequest body
. totalParams
is defined as thequery string
concatenated with therequest body
.
#
Timing Security- A
SIGNED
endpoint also requires a parameter,timestamp
, to be sent which should be the millisecond timestamp of when the request was created and sent. - An additional parameter,
recvWindow
, may be sent to specify the number of milliseconds aftertimestamp
the request is valid for. IfrecvWindow
is not sent, it defaults to 5000.
The logic is as follows:
Serious trading is about timing. Networks can be unstable and unreliable,
which can lead to requests taking varying amounts of time to reach the
servers. With recvWindow
, you can specify that the request must be
processed within a certain number of milliseconds or be rejected by the
server.
#
SIGNED Endpoint Examples for POST /fapi/v1/order - HMAC KeysHere is a step-by-step example of how to send a vaild signed payload from the
Linux command line using echo
, openssl
, and curl
.
Key | Value |
---|---|
apiKey | dbefbc809e3e83c283a984c3a1459732ea7db1360ca80c5c2c8867408d28cc83 |
secretKey | 2b5eb11e18796d12d88f13dc27dbbd02c2cc51ff7059765ed9821957d82bb4d9 |
Parameter | Value |
---|---|
symbol | BTCUSDT |
side | BUY |
type | LIMIT |
timeInForce | GTC |
quantity | 1 |
price | 9000 |
recvWindow | 5000 |
timestamp | 1591702613943 |
#
Example 1: As a query stringExample 1
HMAC SHA256 signature:
curl command:
queryString:
symbol=BTCUSDT
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=9000
&recvWindow=5000
×tamp=1591702613943
#
Example 2: As a request bodyExample 2
HMAC SHA256 signature:
curl command:
requestBody:
symbol=BTCUSDT
&side=BUY
&type=LIMIT
&timeInForce=GTC
&quantity=1
&price=9000
&recvWindow=5000
×tamp=1591702613943
#
Example 3: Mixed query string and request bodyExample 3
HMAC SHA256 signature:
curl command:
- queryString: symbol=BTCUSDT&side=BUY&type=LIMIT&timeInForce=GTC
- requestBody: quantity=1&price=9000&recvWindow=5000×tamp= 1591702613943
Note that the signature is different in example 3.
There is no & between "GTC" and "quantity=1".
#
SIGNED Endpoint Examples for POST /fapi/v1/order - RSA Keys- This will be a step by step process how to create the signature payload to send a valid signed payload.
- We support
PKCS#8
currently. - To get your API key, you need to upload your RSA Public Key to your account and a corresponding API key will be provided for you.
For this example, the private key will be referenced as test-prv-key.pem
Key | Value |
---|---|
apiKey | vE3BDAL1gP1UaexugRLtteaAHg3UO8Nza20uexEuW1Kh3tVwQfFHdAiyjjY428o2 |
Parameter | Value |
---|---|
symbol | BTCUSDT |
side | SELL |
type | MARKET |
quantity | 1.23 |
recvWindow | 9999999 |
timestamp | 1671090801999 |
Signature payload (with the listed parameters):
Step 1: Construct the payload
Arrange the list of parameters into a string. Separate each parameter with a &
.
Step 2: Compute the signature:
2.1 - Encode signature payload as ASCII data.
Step 2.2
2.2 - Sign payload using RSASSA-PKCS1-v1_5 algorithm with SHA-256 hash function.
Step 2.3
2.3 - Encode output as base64 string.
Step 2.4
2.4 - Delete any newlines in the signature.
Step 2.5
2.5 - Since the signature may contain /
and =
, this could cause issues with sending the request. So the signature has to be URL encoded.
Step 2.6
2.6 - curl command
Bash script
A sample Bash script containing similar steps is available in the right side.
#
Public Endpoints Info#
Terminologybase asset
refers to the asset that is thequantity
of a symbol.quote asset
refers to the asset that is theprice
of a symbol.
#
ENUM definitionsSymbol type:
- FUTURE
Contract type (contractType):
- PERPETUAL
- CURRENT_MONTH
- NEXT_MONTH
- CURRENT_QUARTER
- NEXT_QUARTER
- PERPETUAL_DELIVERING
Contract status(contractStatus,status):
- PENDING_TRADING
- TRADING
- PRE_DELIVERING
- DELIVERING
- DELIVERED
- PRE_SETTLE
- SETTLING
- CLOSE
Order status (status):
- NEW
- PARTIALLY_FILLED
- FILLED
- CANCELED
- REJECTED
- EXPIRED
Order types (orderTypes, type):
- LIMIT
- MARKET
- STOP
- STOP_MARKET
- TAKE_PROFIT
- TAKE_PROFIT_MARKET
- TRAILING_STOP_MARKET
Order side (side):
- BUY
- SELL
Position side (positionSide):
- BOTH
- LONG
- SHORT
Time in force (timeInForce):
- GTC - Good Till Cancel
- IOC - Immediate or Cancel
- FOK - Fill or Kill
- GTX - Good Till Crossing (Post Only)
Working Type (workingType)
- MARK_PRICE
- CONTRACT_PRICE
Response Type (newOrderRespType)
- ACK
- RESULT
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Rate limiters (rateLimitType)
REQUEST_WEIGHT
ORDERS
REQUEST_WEIGHT
ORDERS
Rate limit intervals (interval)
- MINUTE
#
FiltersFilters define trading rules on a symbol or an exchange.
#
Symbol filters#
PRICE_FILTER/exchangeInfo format:
The PRICE_FILTER
defines the price
rules for a symbol. There are 3 parts:
minPrice
defines the minimumprice
/stopPrice
allowed; disabled onminPrice
== 0.maxPrice
defines the maximumprice
/stopPrice
allowed; disabled onmaxPrice
== 0.tickSize
defines the intervals that aprice
/stopPrice
can be increased/decreased by; disabled ontickSize
== 0.
Any of the above variables can be set to 0, which disables that rule in the price filter
. In order to pass the price filter
, the following must be true for price
/stopPrice
of the enabled rules:
price
>=minPrice
price
<=maxPrice
- (
price
-minPrice
) %tickSize
== 0
#
LOT_SIZE/exchangeInfo format:
The LOT_SIZE
filter defines the quantity
(aka "lots" in auction terms) rules for a symbol. There are 3 parts:
minQty
defines the minimumquantity
allowed.maxQty
defines the maximumquantity
allowed.stepSize
defines the intervals that aquantity
can be increased/decreased by.
In order to pass the lot size
, the following must be true for quantity
:
quantity
>=minQty
quantity
<=maxQty
- (
quantity
-minQty
) %stepSize
== 0
#
MARKET_LOT_SIZE/exchangeInfo format:
The MARKET_LOT_SIZE
filter defines the quantity
(aka "lots" in auction terms) rules for MARKET
orders on a symbol. There are 3 parts:
minQty
defines the minimumquantity
allowed.maxQty
defines the maximumquantity
allowed.stepSize
defines the intervals that aquantity
can be increased/decreased by.
In order to pass the market lot size
, the following must be true for quantity
:
quantity
>=minQty
quantity
<=maxQty
- (
quantity
-minQty
) %stepSize
== 0
#
MAX_NUM_ORDERS/exchangeInfo format:
The MAX_NUM_ORDERS
filter defines the maximum number of orders an account is allowed to have open on a symbol.
Note that both "algo" orders and normal orders are counted for this filter.
#
MAX_NUM_ALGO_ORDERS/exchangeInfo format:
The MAX_NUM_ALGO_ORDERS
filter defines the maximum number of all kinds of algo orders an account is allowed to have open on a symbol.
The algo orders include STOP
, STOP_MARKET
, TAKE_PROFIT
, TAKE_PROFIT_MARKET
, and TRAILING_STOP_MARKET
orders.
#
PERCENT_PRICE/exchangeInfo format:
The PERCENT_PRICE
filter defines valid range for a price based on the mark price.
In order to pass the percent price
, the following must be true for price
:
- BUY:
price
<=markPrice
*multiplierUp
- SELL:
price
>=markPrice
*multiplierDown
#
MIN_NOTIONAL/exchangeInfo format:
The MIN_NOTIONAL
filter defines the minimum notional value allowed for an order on a symbol.
An order's notional value is the price
* quantity
.
Since MARKET
orders have no price, the mark price is used.
#
Postman CollectionsThere is now a Postman collection containing the API endpoints for quick and easy use.
For more information please refer to this page: Binance API Postman
Market Data Endpoints
#
Test ConnectivityResponse:
GET /fapi/v1/ping
Test connectivity to the Rest API.
Weight: 1
Parameters: NONE
#
Check Server TimeResponse:
GET /fapi/v1/time
Test connectivity to the Rest API and get the current server time.
Weight: 1
Parameters: NONE
#
Exchange InformationResponse:
GET /fapi/v1/exchangeInfo
Current exchange trading rules and symbol information
Weight: 1
Parameters: NONE
#
Order BookResponse:
GET /fapi/v1/depth
Weight:
Adjusted based on the limit:
Limit | Weight |
---|---|
5, 10, 20, 50 | 2 |
100 | 5 |
500 | 10 |
1000 | 20 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; Valid limits:[5, 10, 20, 50, 100, 500, 1000] |
#
Recent Trades ListResponse:
GET /fapi/v1/trades
Get recent market trades
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
- Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned.
#
Old Trades Lookup (MARKET_DATA)Response:
GET /fapi/v1/historicalTrades
Get older market historical trades.
Weight: 20
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default 500; max 1000. |
fromId | LONG | NO | TradeId to fetch from. Default gets most recent trades. |
- Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won't be returned.
#
Compressed/Aggregate Trades ListResponse:
GET /fapi/v1/aggTrades
Get compressed, aggregate market trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.
Weight: 20
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
fromId | LONG | NO | ID to get aggregate trades from INCLUSIVE. |
startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE. |
limit | INT | NO | Default 500; max 1000. |
- If both
startTime
andendTime
are sent, time betweenstartTime
andendTime
must be less than 1 hour. - If
fromId
,startTime
, andendTime
are not sent, the most recent aggregate trades will be returned. - Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won't be aggregated.
- Sending both
startTime
/endTime
andfromId
might cause response timeout, please send eitherfromId
orstartTime
/endTime
#
Kline/Candlestick DataResponse:
GET /fapi/v1/klines
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 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1500. |
- If startTime and endTime are not sent, the most recent klines are returned.
#
Continuous Contract Kline/Candlestick DataResponse:
GET /fapi/v1/continuousKlines
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 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
pair | STRING | YES | |
contractType | ENUM | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1500. |
If startTime and endTime are not sent, the most recent klines are returned.
Contract type:
- PERPETUAL
- CURRENT_QUARTER
- NEXT_QUARTER
#
Index Price Kline/Candlestick DataResponse:
GET /fapi/v1/indexPriceKlines
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 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
pair | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1500. |
- If startTime and endTime are not sent, the most recent klines are returned.
#
Mark Price Kline/Candlestick DataResponse:
GET /fapi/v1/markPriceKlines
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 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1500. |
- If startTime and endTime are not sent, the most recent klines are returned.
#
Mark PriceResponse:
OR (when symbol not sent)
GET /fapi/v1/premiumIndex
Mark Price and Funding Rate
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
#
Get Funding Rate HistoryResponse:
GET /fapi/v1/fundingRate
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
startTime | LONG | NO | Timestamp in ms to get funding rate from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get funding rate until INCLUSIVE. |
limit | INT | NO | Default 100; max 1000 |
- If
startTime
andendTime
are not sent, the most recentlimit
datas are returned. - If the number of data between
startTime
andendTime
is larger thanlimit
, return asstartTime
+limit
. - In ascending order.
#
24hr Ticker Price Change StatisticsResponse:
OR
GET /fapi/v1/ticker/24hr
24 hour rolling window price change statistics.
Careful when accessing this with no symbol.
Weight:
1 for a single symbol;
40 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, tickers for all symbols will be returned in an array.
#
Symbol Price TickerResponse:
OR
GET /fapi/v1/ticker/price
Latest price for a symbol or symbols.
Weight:
1 for a single symbol;
2 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, prices for all symbols will be returned in an array.
#
Symbol Order Book TickerResponse:
OR
GET /fapi/v1/ticker/bookTicker
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
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- If the symbol is not sent, bookTickers for all symbols will be returned in an array.
- The field
X-MBX-USED-WEIGHT-1M
in response header is not accurate from this endpoint, please ignore.
#
Open InterestResponse:
GET /fapi/v1/openInterest
Get present open interest of a specific symbol.
Weight:
1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES |
#
Open Interest StatisticsResponse:
GET /futures/data/openInterestHist
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
limit | LONG | NO | default 30, max 500 |
startTime | LONG | NO | |
endTime | LONG | NO |
- If startTime and endTime are not sent, the most recent data is returned.
- Only the data of the latest 30 days is available.
#
Top Trader Long/Short Ratio (Accounts)Response:
GET /futures/data/topLongShortAccountRatio
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
limit | LONG | NO | default 30, max 500 |
startTime | LONG | NO | |
endTime | LONG | NO |
- If startTime and endTime are not sent, the most recent data is returned.
- Only the data of the latest 30 days is available.
#
Top Trader Long/Short Ratio (Positions)Response:
GET /futures/data/topLongShortPositionRatio
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
limit | LONG | NO | default 30, max 500 |
startTime | LONG | NO | |
endTime | LONG | NO |
- If startTime and endTime are not sent, the most recent data is returned.
- Only the data of the latest 30 days is available.
#
Long/Short RatioResponse:
GET /futures/data/globalLongShortAccountRatio
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
limit | LONG | NO | default 30, max 500 |
startTime | LONG | NO | |
endTime | LONG | NO |
- If startTime and endTime are not sent, the most recent data is returned.
- Only the data of the latest 30 days is available.
#
Taker Buy/Sell VolumeResponse:
GET /futures/data/takerlongshortRatio
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
period | ENUM | YES | "5m","15m","30m","1h","2h","4h","6h","12h","1d" |
limit | LONG | NO | default 30, max 500 |
startTime | LONG | NO | |
endTime | LONG | NO |
- If startTime and endTime are not sent, the most recent data is returned.
- Only the data of the latest 30 days is available.
#
Historical BLVT NAV Kline/CandlestickResponse:
GET /fapi/v1/lvtKlines
The BLVT NAV system is based on Binance Futures, so the endpoint is based on fapi
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | token name, e.g. "BTCDOWN", "BTCUP" |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | default 500, max 1000 |
#
Composite Index Symbol InformationResponse:
GET /fapi/v1/indexInfo
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
- Only for composite index symbols
#
Multi-Assets Mode Asset IndexResponse:
Or(without symbol)
GET /fapi/v1/assetIndex
asset index for Multi-Assets mode
Weight: 1 for a single symbol; 10 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | Asset pair |
Websocket Market Streams
There are two connection methods for Websocket:
Base Url 1: wss://fstream.binance.com
Streams can be access either in a single raw stream or a combined stream
Raw streams are accessed at /ws/\<streamName>
Combined streams are accessed at /stream?streams=\<streamName1>/\<streamName2>/\<streamName3>
Example:
wss://fstream.binance.com/ws/bnbusdt@aggTrade
wss://fstream.binance.com/stream?streams=bnbusdt@aggTrade/btcusdt@markPrice
Base Url 2: wss://fstream-auth.binance.com
Streams can be access either in a single raw stream or a combined stream
Raw streams are accessed at /ws/\<streamName>?listenKey=\<validateListenKey>
Combined streams are accessed at /stream?streams=\<streamName1>/\<streamName2>/\<streamName3>&listenKey=\<validateListenKey>
\<validateListenKey> must be a valid listenKey when you establish a connection
Example:
wss://fstream-auth.binance.com/ws/btcusdt@markPrice?listenKey=XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
wss://fstream-auth.binance.com/stream?streams=btcusdt@markPrice@1s/bnbusdt@markPrice&listenKey=XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
- Combined stream events are wrapped as follows: {"stream":"\<streamName>","data":\<rawPayload>}
- All symbols for streams are lowercase
- A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark
- The websocket server will send a
ping frame
every 5 minutes. If the websocket server does not receive apong frame
back from the connection within a 15 minute period, the connection will be disconnected. Unsolicitedpong frames
are allowed. - WebSocket connections have a limit of 10 incoming messages per second.
- A connection that goes beyond the limit will be disconnected; IPs that are repeatedly disconnected may be banned.
- A single connection can listen to a maximum of 200 streams.
- Considering the possible data latency from RESTful endpoints during an extremely volatile market, it is highly recommended to get the order status, position, etc from the Websocket user data stream.
#
Live Subscribing/Unsubscribing to streams- The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below.
- The
id
used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth.
#
Subscribe to a streamResponse
Request
"method": "SUBSCRIBE",
"params":
[
"btcusdt@aggTrade",
"btcusdt@depth"
],
"id": 1
}
#
Unsubscribe to a streamResponse
Request
{
"method": "UNSUBSCRIBE",
"params":
[
"btcusdt@depth"
],
"id": 312
}
#
Listing SubscriptionsResponse
Request
{
"method": "LIST_SUBSCRIPTIONS",
"id": 3
}
#
Setting PropertiesCurrently, the only property can be set is to set whether combined
stream payloads are enabled are not.
The combined property is set to false
when connecting using /ws/
("raw streams") and true
when connecting using /stream/
.
Response
Request
{
"method": "SET_PROPERTY",
"params":
[
"combined",
true
],
"id": 5
}
#
Retrieving PropertiesResponse
Request
{
"method": "GET_PROPERTY",
"params":
[
"combined"
],
"id": 2
}
#
Error MessagesError Message | Description |
---|---|
{"code": 0, "msg": "Unknown property"} | Parameter used in the SET_PROPERTY or GET_PROPERTY was invalid |
{"code": 1, "msg": "Invalid value type: expected Boolean"} | Value should only be true or false |
{"code": 2, "msg": "Invalid request: property name must be a string"} | Property name provided was invalid |
{"code": 2, "msg": "Invalid request: request ID must be an unsigned integer"} | Parameter id had to be provided or the value provided in the id parameter is an unsupported type |
{"code": 2, "msg": "Invalid request: unknown variant %s, expected one of SUBSCRIBE , UNSUBSCRIBE , LIST_SUBSCRIPTIONS , SET_PROPERTY , GET_PROPERTY at line 1 column 28"} | Possible typo in the provided method or provided method was neither of the expected values |
{"code": 2, "msg": "Invalid request: too many parameters"} | Unnecessary parameters provided in the data |
{"code": 2, "msg": "Invalid request: property name must be a string"} | Property name was not provided |
{"code": 2, "msg": "Invalid request: missing field method at line 1 column 73"} | method was not provided in the data |
{"code":3,"msg":"Invalid JSON: expected value at line %s column %s"} | JSON data sent has incorrect syntax. |
#
Aggregate Trade StreamsPayload:
The Aggregate Trade Streams push market trade information that is aggregated for fills with same price and taking side every 100 milliseconds.
Stream Name:
<symbol>@aggTrade
Update Speed: 100ms
- Only market trades will be aggregated, which means the insurance fund trades and ADL trades won't be aggregated.
#
Mark Price StreamPayload:
Mark price and funding rate for a single symbol pushed every 3 seconds or every second.
Stream Name:
<symbol>@markPrice
or <symbol>@markPrice@1s
Update Speed: 3000ms or 1000ms
#
Mark Price Stream for All marketPayload:
Mark price and funding rate for all symbols pushed every 3 seconds or every second.
Stream Name:
!markPrice@arr
or !markPrice@arr@1s
Update Speed: 3000ms or 1000ms
#
Kline/Candlestick StreamsPayload:
The Kline/Candlestick Stream push updates to the current klines/candlestick every 250 milliseconds (if existing).
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Stream Name:
<symbol>@kline_<interval>
Update Speed: 250ms
#
Continuous Contract Kline/Candlestick StreamsPayload:
Contract type:
- perpetual
- current_quarter
- next_quarter
Kline/Candlestick chart intervals:
m -> minutes; h -> hours; d -> days; w -> weeks; M -> months
- 1m
- 3m
- 5m
- 15m
- 30m
- 1h
- 2h
- 4h
- 6h
- 8h
- 12h
- 1d
- 3d
- 1w
- 1M
Stream Name:
<pair>_<contractType>@continuousKline_<interval>
Update Speed: 250ms
#
Individual Symbol Mini Ticker StreamPayload:
24hr rolling window mini-ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.
Stream Name:
<symbol>@miniTicker
Update Speed: 500ms
#
All Market Mini Tickers StreamPayload:
24hr rolling window mini-ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array.
Stream Name:
!miniTicker@arr
Update Speed: 1000ms
#
Individual Symbol Ticker StreamsPayload:
24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before.
Stream Name:
<symbol>@ticker
Update Speed: 500ms
#
All Market Tickers StreamsPayload:
24hr rolling window ticker statistics for all symbols. These are NOT the statistics of the UTC day, but a 24hr rolling window from requestTime to 24hrs before. Note that only tickers that have changed will be present in the array.
Stream Name:
!ticker@arr
Update Speed: 1000ms
#
Individual Symbol Book Ticker StreamsPayload:
Pushes any update to the best bid or ask's price or quantity in real-time for a specified symbol.
Stream Name: <symbol>@bookTicker
Update Speed: Real-time
#
All Book Tickers StreamPayload:
Pushes any update to the best bid or ask's price or quantity in real-time for all symbols.
Stream Name: !bookTicker
Update Speed: Real-time
##Liquidation Order Streams
Payload:
The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol.
For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed.
Stream Name: <symbol>@forceOrder
Update Speed: 1000ms
##All Market Liquidation Order Streams
Payload:
The All Liquidation Order Snapshot Streams push force liquidation order information for all symbols in the market.
For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed.
Stream Name: !forceOrder@arr
Update Speed: 1000ms
#
Partial Book Depth StreamsPayload:
Top <levels> bids and asks, Valid <levels> are 5, 10, or 20.
Stream Names: <symbol>@depth<levels>
OR <symbol>@depth<levels>@500ms
OR <symbol>@depth<levels>@100ms
.
Update Speed: 250ms, 500ms or 100ms
#
Diff. Book Depth StreamsPayload:
Bids and asks, pushed every 250 milliseconds, 500 milliseconds, 100 milliseconds (if existing)
Stream Name:
<symbol>@depth
OR <symbol>@depth@500ms
OR <symbol>@depth@100ms
Update Speed: 250ms, 500ms, 100ms
#
How to manage a local order book correctly- Open a stream to wss://fstream.binance.com/stream?streams=btcusdt@depth.
- Buffer the events you receive from the stream. For same price, latest received update covers the previous one.
- Get a depth snapshot from https://fapi.binance.com/fapi/v1/depth?symbol=BTCUSDT&limit=1000 .
- Drop any event where
u
is <lastUpdateId
in the snapshot. - The first processed event should have
U
<=lastUpdateId
ANDu
>=lastUpdateId
- While listening to the stream, each new event's
pu
should be equal to the previous event'su
, otherwise initialize the process from step 3. - The data in each event is the absolute quantity for a price level.
- If the quantity is 0, remove the price level.
- Receiving an event that removes a price level that is not in your local order book can happen and is normal.
#
Composite Index Symbol Information StreamsPayload:
Composite index information for index symbols pushed every second.
Stream Name: <symbol>@compositeIndex
Update Speed: 1000ms
#
Contract Info StreamPayload:
ContractInfo stream pushes when contract info updates(listing/settlement/contract bracket update). bks
field only shows up when bracket gets updated.
Stream Name: !contractInfo
Update Speed: Real-time
Account/Trades Endpoints
#
New Future Account TransferPlease find details from here.
#
Get Future Account Transaction History List (USER_DATA)Please find details from here.
#
Change Position Mode(TRADE)Response:
POST /fapi/v1/positionSide/dual (HMAC SHA256)
Change user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
dualSidePosition | STRING | YES | "true": Hedge Mode; "false": One-way Mode |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Current Position Mode(USER_DATA)Response:
GET /fapi/v1/positionSide/dual (HMAC SHA256)
Get user's position mode (Hedge Mode or One-way Mode ) on EVERY symbol
Weight: 30
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Change Multi-Assets Mode (TRADE)Response:
POST /fapi/v1/multiAssetsMargin (HMAC SHA256)
Change user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
multiAssetsMargin | STRING | YES | "true": Multi-Assets Mode; "false": Single-Asset Mode |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Current Multi-Assets Mode (USER_DATA)Response:
GET /fapi/v1/multiAssetsMargin (HMAC SHA256)
Get user's Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on Every symbol
Weight: 30
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
New Order (TRADE)Response:
POST /fapi/v1/order (HMAC SHA256)
Send in a new order.
Weight: 0
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | |
positionSide | ENUM | NO | Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent in Hedge Mode. |
type | ENUM | YES | |
timeInForce | ENUM | NO | |
quantity | DECIMAL | NO | Cannot be sent with closePosition =true (Close-All) |
reduceOnly | STRING | NO | "true" or "false". default "false". Cannot be sent in Hedge Mode; cannot be sent with closePosition =true |
price | DECIMAL | NO | |
newClientOrderId | STRING | NO | A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: ^[\.A-Z\:/a-z0-9_-]{1,36}$ |
stopPrice | DECIMAL | NO | Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
closePosition | STRING | NO | true , false ;Close-All,used with STOP_MARKET or TAKE_PROFIT_MARKET . |
activationPrice | DECIMAL | NO | Used with TRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType ) |
callbackRate | DECIMAL | NO | Used with TRAILING_STOP_MARKET orders, min 0.1, max 5 where 1 for 1% |
workingType | ENUM | NO | stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE" |
priceProtect | STRING | NO | "TRUE" or "FALSE", default "FALSE". Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
newOrderRespType | ENUM | NO | "ACK", "RESULT", default "ACK" |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Additional mandatory parameters based on type
:
Type | Additional mandatory parameters |
---|---|
LIMIT | timeInForce , quantity , price |
MARKET | quantity |
STOP/TAKE_PROFIT | quantity , price , stopPrice |
STOP_MARKET/TAKE_PROFIT_MARKET | stopPrice |
TRAILING_STOP_MARKET | callbackRate |
Order with type
STOP
, parametertimeInForce
can be sent ( defaultGTC
).Order with type
TAKE_PROFIT
, parametertimeInForce
can be sent ( defaultGTC
).Condition orders will be triggered when:
- If parameter
priceProtect
is 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 /fapi/v1/exchangeInfo
- when price reaches the
STOP
,STOP_MARKET
:- BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >=
stopPrice
- SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <=
stopPrice
- BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >=
TAKE_PROFIT
,TAKE_PROFIT_MARKET
:- BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <=
stopPrice
- SELL: latest price ("MARK_PRICE" or "CONTRACT_PRICE") >=
stopPrice
- BUY: latest price ("MARK_PRICE" or "CONTRACT_PRICE") <=
TRAILING_STOP_MARKET
:- BUY: the lowest price after order placed <=
activationPrice
, and the latest price >= the lowest price * (1 +callbackRate
) - SELL: the highest price after order placed >=
activationPrice
, and the latest price <= the highest price * (1 -callbackRate
)
- BUY: the lowest price after order placed <=
- If parameter
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.
- BUY:
If
newOrderRespType
is sent asRESULT
:MARKET
order: the final FILLED result of the order will be return directly.LIMIT
order with specialtimeInForce
: the final status result of the order(FILLED or EXPIRED) will be returned directly.
STOP_MARKET
,TAKE_PROFIT_MARKET
withclosePosition
=true
:- Follow the same rules for condition orders.
- If triggered,close all current long position( if
SELL
) or current short position( ifBUY
). - Cannot be used with
quantity
paremeter - Cannot be used with
reduceOnly
parameter - In Hedge Mode,cannot be used with
BUY
orders inLONG
position side. and cannot be used withSELL
orders inSHORT
position side
#
Modify Order (TRADE)Response:
PUT /fapi/v1/order (HMAC SHA256)
Order modify function, currently only LIMIT order modification is supported, modified orders will be reordered in the match queue
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
symbol | STRING | YES | |
side | ENUM | YES | SELL , BUY |
quantity | DECIMAL | YES | Order quantity, cannot be sent with closePosition=true |
price | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Either
orderId
ororigClientOrderId
must be sent, and theorderId
will prevail if both are sent. - Both
quantity
andprice
must be sent, which is different from dapi modify order endpoint. - When the new
quantity
orprice
doesn't satisfy PRICE_FILTER / PERCENT_FILTER / LOT_SIZE, amendment will be rejected and the order will stay as it is. - However the order will be cancelled by the amendment in the following situations:
- when the order is in partially filled status and the new
quantity
<=executedQty
- When the order is
GTX
and the new price will cause it to be executed immediately
- when the order is in partially filled status and the new
- One order can only be modfied for less than 10000 times
#
Place Multiple Orders (TRADE)Response:
POST /fapi/v1/batchOrders (HMAC SHA256)
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
batchOrders | LIST\<JSON> | YES | order list. Max 5 orders |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Where batchOrders
is the list of order parameters in JSON
- Example: /fapi/v1/batchOrders?batchOrders=[{"type":"LIMIT","timeInForce":"GTC",
"symbol":"BTCUSDT","side":"BUY","price":"10001","quantity":"0.001"}]
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
side | ENUM | YES | |
positionSide | ENUM | NO | Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent with Hedge Mode. |
type | ENUM | YES | |
timeInForce | ENUM | NO | |
quantity | DECIMAL | YES | |
reduceOnly | STRING | NO | "true" or "false". default "false". |
price | DECIMAL | NO | |
newClientOrderId | STRING | NO | A unique id among open orders. Automatically generated if not sent. Can only be string following the rule: ^[\.A-Z\:/a-z0-9_-]{1,36}$ |
stopPrice | DECIMAL | NO | Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
activationPrice | DECIMAL | NO | Used with TRAILING_STOP_MARKET orders, default as the latest price(supporting different workingType ) |
callbackRate | DECIMAL | NO | Used with TRAILING_STOP_MARKET orders, min 0.1, max 4 where 1 for 1% |
workingType | ENUM | NO | stopPrice triggered by: "MARK_PRICE", "CONTRACT_PRICE". Default "CONTRACT_PRICE" |
priceProtect | STRING | NO | "TRUE" or "FALSE", default "FALSE". Used with STOP/STOP_MARKET or TAKE_PROFIT/TAKE_PROFIT_MARKET orders. |
newOrderRespType | ENUM | NO | "ACK", "RESULT", default "ACK" |
- Paremeter 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.
#
Modify Multiple Orders (TRADE)Response:
PUT /fapi/v1/batchOrders (HMAC SHA256)
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
batchOrders | list\<JSON> | YES | order list. Max 5 orders |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Where batchOrders
is the list of order parameters in JSON
Name | Type | Mandatory | Description |
---|---|---|---|
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
symbol | STRING | YES | |
side | ENUM | YES | SELL , BUY |
quantity | DECIMAL | YES | Order quantity, cannot be sent with closePosition=true |
price | DECIMAL | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Parameter rules are same with
Modify Order
- Batch modify orders are processed concurrently, and the order of matching is not guaranteed.
- The order of returned contents for batch modify orders is the same as the order of the order list.
- One order can only be modfied for less than 10000 times
#
Get Order Modify History (USER_DATA)Response:
GET /fapi/v1/orderAmendment (HMAC SHA256)
Get order modification history
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
startTime | LONG | NO | Timestamp in ms to get modification history from INCLUSIVE |
endTime | LONG | NO | Timestamp in ms to get modification history until INCLUSIVE |
limit | INT | NO | Default 50; max 100 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Notes:
- Either
orderId
ororigClientOrderId
must be sent, and theorderId
will prevail if both are sent.
#
Query Order (USER_DATA)Response:
GET /fapi/v1/order (HMAC SHA256)
Check an order's status.
Weight: 1
- These orders will not be found:
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
- created time + 3 days < current time
- order status is
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Notes:
- Either
orderId
ororigClientOrderId
must be sent. orderId
is self-increment for each specificsymbol
#
Cancel Order (TRADE)Response:
DELETE /fapi/v1/order (HMAC SHA256)
Cancel an active order.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Either orderId
or origClientOrderId
must be sent.
#
Cancel All Open Orders (TRADE)Response:
DELETE /fapi/v1/allOpenOrders (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Cancel Multiple Orders (TRADE)Response:
DELETE /fapi/v1/batchOrders (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderIdList | LIST\<LONG> | NO | max length 10 e.g. [1234567,2345678] |
origClientOrderIdList | LIST\<STRING> | NO | max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Either orderIdList
or origClientOrderIdList
must be sent.
#
Auto-Cancel All Open Orders (TRADE)Response:
Cancel all open orders of the specified symbol at the end of the specified countdown.
POST /fapi/v1/countdownCancelAll (HMAC SHA256)
Weight: 10
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
countdownTime | LONG | YES | countdown time, 1000 for 1 second. 0 to cancel the timer |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and replaced by a new one.
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.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.
#
Query Current Open Order (USER_DATA)Response:
GET /fapi/v1/openOrder (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
origClientOrderId | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Either
orderId
ororigClientOrderId
must be sent - If the queried order has been filled or cancelled, the error message "Order does not exist" will be returned.
#
Current All Open Orders (USER_DATA)Response:
GET /fapi/v1/openOrders (HMAC SHA256)
Get all open orders on a symbol. Careful when accessing this with no symbol.
Weight: 1 for a single symbol; 40 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If the symbol is not sent, orders for all symbols will be returned in an array.
#
All Orders (USER_DATA)Response:
GET /fapi/v1/allOrders (HMAC SHA256)
Get all account orders; active, canceled, or filled.
- These orders will not be found:
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
- created time + 3 days < current time
- order status is
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Notes:
- If
orderId
is set, it will get orders >= thatorderId
. Otherwise most recent orders are returned. - The query time period must be less then 7 days( default as the recent 7 days).
#
Futures Account Balance V2 (USER_DATA)Response:
GET /fapi/v2/balance (HMAC SHA256)
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Account Information V2 (USER_DATA)Response:
single-asset mode
OR multi-assets mode
GET /fapi/v2/account (HMAC SHA256)
Get current account information. User in single-asset/ multi-assets mode will see different value, see comments in response section for detail.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Change Initial Leverage (TRADE)Response:
POST /fapi/v1/leverage (HMAC SHA256)
Change user's initial leverage of specific symbol market.
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
leverage | INT | YES | target initial leverage: int from 1 to 125 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Change Margin Type (TRADE)Response:
POST /fapi/v1/marginType (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
marginType | ENUM | YES | ISOLATED, CROSSED |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Modify Isolated Position Margin (TRADE)Response:
POST /fapi/v1/positionMargin (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
positionSide | ENUM | NO | Default BOTH for One-way Mode ; LONG or SHORT for Hedge Mode. It must be sent with Hedge Mode. |
amount | DECIMAL | YES | |
type | INT | YES | 1: Add position margin,2: Reduce position margin |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Only for isolated symbol
#
Get Position Margin Change History (TRADE)Response:
GET /fapi/v1/positionMargin/history (HMAC SHA256)
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
type | INT | NO | 1: Add position margin,2: Reduce position margin |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default: 500 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Position Information V2 (USER_DATA)Response:
For One-way position mode:
For Hedge position mode:
GET /fapi/v2/positionRisk (HMAC SHA256)
Get current position information.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
Note
Please use with user data stream ACCOUNT_UPDATE
to meet your timeliness and accuracy needs.
#
Account Trade List (USER_DATA)Response:
GET /fapi/v1/userTrades (HMAC SHA256)
Get trades for a specific account and symbol.
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
orderId | LONG | NO | This can only be used in combination with symbol |
startTime | LONG | NO | |
endTime | LONG | NO | |
fromId | LONG | NO | Trade id to fetch from. Default gets most recent trades. |
limit | INT | NO | Default 500; max 1000. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If
startTime
andendTime
are both not sent, then the last 7 days' data will be returned. - The time between
startTime
andendTime
cannot be longer than 7 days. - The parameter
fromId
cannot be sent withstartTime
orendTime
.
#
Get Income History (USER_DATA)Response:
GET /fapi/v1/income (HMAC SHA256)
Weight: 30
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
incomeType | STRING | NO | TRANSFER, WELCOME_BONUS, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK, COMMISSION_REBATE, API_REBATE, CONTEST_REWARD, CROSS_COLLATERAL_TRANSFER, OPTIONS_PREMIUM_FEE, OPTIONS_SETTLE_PROFIT, INTERNAL_TRANSFER, AUTO_EXCHANGE, DELIVERED_SETTELMENT, COIN_SWAP_DEPOSIT, COIN_SWAP_WITHDRAW, POSITION_LIMIT_INCREASE_FEE |
startTime | LONG | NO | Timestamp in ms to get funding from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get funding until INCLUSIVE. |
limit | INT | NO | Default 100; max 1000 |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If neither
startTime
norendTime
is sent, the recent 7-day data will be returned. - If
incomeType
is not sent, all kinds of flow will be returned - "trandId" is unique in the same incomeType for a user
- Income history only contains data for the last three months
#
Notional and Leverage Brackets (USER_DATA)Response:
OR (if symbol sent)
GET /fapi/v1/leverageBracket
Weight: 1
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Position ADL Quantile Estimation (USER_DATA)Response:
GET /fapi/v1/adlQuantile
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
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.
#
User's Force Orders (USER_DATA)Response:
GET /fapi/v1/forceOrders
Weight: 20 with symbol, 50 without symbol
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
autoCloseType | ENUM | NO | "LIQUIDATION" for liquidation orders, "ADL" for ADL orders. |
startTime | LONG | NO | |
endTime | LONG | NO | |
limit | INT | NO | Default 50; max 100. |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- If "autoCloseType" is not sent, orders with both of the types will be returned
- If "startTime" is not sent, data within 7 days before "endTime" can be queried
#
Futures Trading Quantitative Rules Indicators (USER_DATA)- For more information on this, please refer to the Futures Trading Quantitative Rules
Response:
Or (account violation triggered)
GET /fapi/v1/apiTradingStatus
Weight:
- 1 for a single symbol
- 10 when the symbol parameter is omitted
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
User Commission Rate (USER_DATA)Response:
GET /fapi/v1/commissionRate (HMAC SHA256)
Weight: 20
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
#
Get Download Id For Futures Transaction History (USER_DATA)Response:
GET /fapi/v1/income/asyn (HMAC SHA256)
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
startTime | LONG | YES | |
endTime | LONG | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Request Limitation is 5 times per month, shared by front end download page and rest api
#
Get Futures Transaction History Download Link by Id (USER_DATA)Response:
OR (Response when server is processing)
GET /fapi/v1/income/asyn/id (HMAC SHA256)
Weight: 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
downloadId | STRING | YES | get by download id api |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- Download link expiration: 24h
User Data Streams
The base API endpoint is: https://fapi.binance.com
A User Data Stream
listenKey
is valid for 60 minutes after creation.Doing a
PUT
on alistenKey
will extend its validity for 60 minutes, if response-1125
error "This listenKey does not exist." Please usePOST /fapi/v1/listenKey
to recreatelistenKey
.Doing a
DELETE
on alistenKey
will close the stream and invalidate thelistenKey
.Doing a
POST
on an account with an activelistenKey
will return the currently activelistenKey
and extend its validity for 60 minutes.There are two connection methods for Websocket:
Base Url 1: wss://fstream.binance.com
User Data Streams are accessed at /ws/\<listenKey>
Example:
wss://fstream.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
Base Url 2: wss://fstream-auth.binance.com
User Data Streams are accessed at /ws/\<listenKey>?listenKey=\<validateListenKey>
\<validateListenKey> must be a valid listenKey when you establish a connection
Example:
wss://fstream-auth.binance.com/ws/XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh?listenKey=XaEAKTsQSRLZAGH9tuIu37plSRsdjmlAVBoNYPUITlTAko1WI22PgmBMpI1rS8Yh
For one connection(one user data), the user data stream payloads can guaranteed to be in order during heavy periods; Strongly recommend you order your updates using E
A single connection is only valid for 24 hours; expect to be disconnected at the 24 hour mark
#
Start User Data Stream (USER_STREAM)Response:
POST /fapi/v1/listenKey
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: 1
Parameters:
None
#
Keepalive User Data Stream (USER_STREAM)Response:
PUT /fapi/v1/listenKey
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It's recommended to send a ping about every 60 minutes.
Weight: 1
Parameters:
None
#
Close User Data Stream (USER_STREAM)Response:
DELETE /fapi/v1/listenKey
Close out a user data stream.
Weight: 1
Parameters:
None
#
Event: User Data Stream ExpiredPayload:
When the listenKey
used for the user data stream turns expired, this event will be pushed.
Notice:
- This event is not related to the websocket disconnection.
- This event will be received only when a valid
listenKey
in connection got expired. - No more user data event will be updated after this event received until a new valid
listenKey
used.
#
Event: Margin CallPayload:
- When the user's position risk ratio is too high, this stream will be pushed.
- This message is only used as risk guidance information and is not recommended for investment strategies.
- In the case of a highly volatile market, there may be the possibility that the user's position has been liquidated at the same time when this stream is pushed out.
#
Event: Balance and Position UpdatePayload:
Event type is ACCOUNT_UPDATE
.
When balance or position get updated, this event will be pushed.
ACCOUNT_UPDATE
will be pushed only when update happens on user's account, including changes on balances, positions, or margin type.- Unfilled orders or cancelled orders will not make the event
ACCOUNT_UPDATE
pushed, since there's no change on positions. - "position" in
ACCOUNT_UPDATE
: Only symbols of changed positions will be pushed.
When "FUNDING FEE" changes to the user's balance, the event will be pushed with the brief message:
- When "FUNDING FEE" occurs in a crossed position,
ACCOUNT_UPDATE
will be pushed with only the balanceB
(including the "FUNDING FEE" asset only), without any positionP
message. - When "FUNDING FEE" occurs in an isolated position,
ACCOUNT_UPDATE
will be pushed with only the balanceB
(including the "FUNDING FEE" asset only) and the relative position messageP
( including the isolated position on which the "FUNDING FEE" occurs only, without any other position message).
- When "FUNDING FEE" occurs in a crossed position,
The field "m" represents the reason type for the event and may shows the following possible types:
- DEPOSIT
- WITHDRAW
- ORDER
- FUNDING_FEE
- WITHDRAW_REJECT
- ADJUSTMENT
- INSURANCE_CLEAR
- ADMIN_DEPOSIT
- ADMIN_WITHDRAW
- MARGIN_TRANSFER
- MARGIN_TYPE_CHANGE
- ASSET_TRANSFER
- OPTIONS_PREMIUM_FEE
- OPTIONS_SETTLE_PROFIT
- AUTO_EXCHANGE
- COIN_SWAP_DEPOSIT
- COIN_SWAP_WITHDRAW
The field "bc" represents the balance change except for PnL and commission.
#
Event: Order UpdatePayload:
When new order created, order status changed will push such event.
event type is ORDER_TRADE_UPDATE
.
Side
- BUY
- SELL
Order Type
- MARKET
- LIMIT
- STOP
- TAKE_PROFIT
- LIQUIDATION
Execution Type
- NEW
- CANCELED
- CALCULATED - Liquidation Execution
- EXPIRED
- TRADE
- AMENDMENT - Order Modified
Order Status
- NEW
- PARTIALLY_FILLED
- FILLED
- CANCELED
- EXPIRED
Time in force
- GTC
- IOC
- FOK
- GTX
Working Type
- MARK_PRICE
- CONTRACT_PRICE
Liquidation and ADL:
If user gets liquidated due to insufficient margin balance:
c
shows as "autoclose-XXX",X
shows as "NEW"
If user has enough margin balance but gets ADL:
c
shows as “adl_autoclose”,X
shows as “NEW”
#
Event: Account Configuration Update previous Leverage UpdatePayload:
Or
When the account configuration is changed, the event type will be pushed as ACCOUNT_CONFIG_UPDATE
When the leverage of a trade pair changes, the payload will contain the object ac
to represent the account configuration of the trade pair, where s
represents the specific trade pair and l
represents the leverage
When the user Multi-Assets margin mode changes the payload will contain the object ai
representing the user account configuration, where j
represents the user Multi-Assets margin mode
#
Event: STRATEGY_UPDATEPayload:
STRATEGY_UPDATE
update when a strategy is created/cancelled/expired, ...etc.
Strategy Status
- NEW
- WORKING
- CANCELLED
- EXPIRED
opCode
- 8001: The strategy params have been updated
- 8002: User cancelled the strategy
- 8003: User manually placed or cancelled an order
- 8004: The stop limit of this order reached
- 8005: User position liquidated
- 8006: Max open order limit reached
- 8007: New grid order
- 8008: Margin not enough
- 8009: Price out of bounds
- 8010: Market is closed or paused
- 8011: Close position failed, unable to fill
- 8012: Exceeded the maximum allowable notional value at current leverage
- 8013: Grid expired due to incomplete KYC verification or access from a restricted jurisdiction
- 8014: Violated Futures Trading Quantitative Rules. Strategy stopped
- 8015: User position empty or liquidated
#
Event: GRID_UPDATEPayload:
GRID_UPDATE
update when a sub order of a grid is filled or partially filled.
Strategy Status
- NEW
- WORKING
- CANCELLED
- EXPIRED
#
Event: Conditional_Order_Trigger_Reject_UpdatePayload:
CONDITIONAL_ORDER_TRIGGER_REJECT
update when a triggered TP/SL order got rejected.
Classic Portfolio Margin Endpoints
The Binance Classic Portfolio Margin Program is a cross-asset margin program supporting consolidated margin balance across trading products with over 200+ effective crypto collaterals. It is designed for professional traders, market makers, and institutional users looking to actively trade & hedge cross-asset and optimize risk-management in a consolidated setup.
FAQ: Classic Portfolio Margin Program
Only Classic Portfolio Margin Account is accessible to these endpoints. To enroll, kindly refer to: How to Enroll into the Binance Classic Portfolio Margin Program
#
Classic Portfolio Margin Exchange InformationResponse:
GET /fapi/v1/pmExchangeInfo
Current Classic Portfolio Margin exchange trading rules.
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | NO |
#
Classic Portfolio Margin Account Information (USER_DATA)Response:
GET /fapi/v1/pmAccountInfo
Get Classic Portfolio Margin current account information.
Weight(IP): 5
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
asset | STRING | YES | |
recvWindow | LONG | NO | |
timestamp | LONG | YES |
- maxWithdrawAmount is for asset transfer out to the spot wallet.
Error Codes
Here is the error JSON payload:
Errors consist of two parts: an error code and a message.
Codes are universal,but messages can vary.
#
10xx - General Server or Network issues#
-1000 UNKNOWN- An unknown error occured while processing the request.
#
-1001 DISCONNECTED- Internal error; unable to process your request. Please try again.
#
-1002 UNAUTHORIZED- You are not authorized to execute this request.
#
-1003 TOO_MANY_REQUESTS- Too many requests queued.
- Too many requests; please use the websocket for live updates.
- Too many requests; current limit is %s requests per minute. Please use the websocket for live updates to avoid polling the API.
- Way too many requests; IP banned until %s. Please use the websocket for live updates to avoid bans.
#
-1004 DUPLICATE_IP- This IP is already on the white list
#
-1005 NO_SUCH_IP- No such IP has been white listed
#
-1006 UNEXPECTED_RESP- An unexpected response was received from the message bus. Execution status unknown.
#
-1007 TIMEOUT- Timeout waiting for response from backend server. Send status unknown; execution status unknown.
#
-1010 ERROR_MSG_RECEIVED- ERROR_MSG_RECEIVED.
#
-1011 NON_WHITE_LIST- This IP cannot access this route.
#
-1013 INVALID_MESSAGE- INVALID_MESSAGE.
#
-1014 UNKNOWN_ORDER_COMPOSITION- Unsupported order combination.
#
-1015 TOO_MANY_ORDERS- Too many new orders.
- Too many new orders; current limit is %s orders per %s.
#
-1016 SERVICE_SHUTTING_DOWN- This service is no longer available.
#
-1020 UNSUPPORTED_OPERATION- This operation is not supported.
#
-1021 INVALID_TIMESTAMP- Timestamp for this request is outside of the recvWindow.
- Timestamp for this request was 1000ms ahead of the server's time.
#
-1022 INVALID_SIGNATURE- Signature for this request is not valid.
#
-1023 START_TIME_GREATER_THAN_END_TIME- Start time is greater than end time.
#
11xx - Request issues#
-1100 ILLEGAL_CHARS- Illegal characters found in a parameter.
- Illegal characters found in parameter '%s'; legal range is '%s'.
#
-1101 TOO_MANY_PARAMETERS- Too many parameters sent for this endpoint.
- Too many parameters; expected '%s' and received '%s'.
- Duplicate values for a parameter detected.
#
-1102 MANDATORY_PARAM_EMPTY_OR_MALFORMED- A mandatory parameter was not sent, was empty/null, or malformed.
- Mandatory parameter '%s' was not sent, was empty/null, or malformed.
- Param '%s' or '%s' must be sent, but both were empty/null!
#
-1103 UNKNOWN_PARAM- An unknown parameter was sent.
#
-1104 UNREAD_PARAMETERS- Not all sent parameters were read.
- Not all sent parameters were read; read '%s' parameter(s) but was sent '%s'.
#
-1105 PARAM_EMPTY- A parameter was empty.
- Parameter '%s' was empty.
#
-1106 PARAM_NOT_REQUIRED- A parameter was sent when not required.
- Parameter '%s' sent when not required.
#
-1108 BAD_ASSET- Invalid asset.
#
-1109 BAD_ACCOUNT- Invalid account.
#
-1110 BAD_INSTRUMENT_TYPE- Invalid symbolType.
#
-1111 BAD_PRECISION- Precision is over the maximum defined for this asset.
#
-1112 NO_DEPTH- No orders on book for symbol.
#
-1113 WITHDRAW_NOT_NEGATIVE- Withdrawal amount must be negative.
#
-1114 TIF_NOT_REQUIRED- TimeInForce parameter sent when not required.
#
-1115 INVALID_TIF- Invalid timeInForce.
#
-1116 INVALID_ORDER_TYPE- Invalid orderType.
#
-1117 INVALID_SIDE- Invalid side.
#
-1118 EMPTY_NEW_CL_ORD_ID- New client order ID was empty.
#
-1119 EMPTY_ORG_CL_ORD_ID- Original client order ID was empty.
#
-1120 BAD_INTERVAL- Invalid interval.
#
-1121 BAD_SYMBOL- Invalid symbol.
#
-1125 INVALID_LISTEN_KEY- This listenKey does not exist. Please use
POST /fapi/v1/listenKey
to recreatelistenKey
#
-1127 MORE_THAN_XX_HOURS- Lookup interval is too big.
- More than %s hours between startTime and endTime.
#
-1128 OPTIONAL_PARAMS_BAD_COMBO- Combination of optional parameters invalid.
#
-1130 INVALID_PARAMETER- Invalid data sent for a parameter.
- Data sent for parameter '%s' is not valid.