- Added
Data Source
in the documentation to explain where each endpoint is retrieving its data. - Added field
Data Source
to each API endpoint in the documentation - GET
api/v3/exchangeInfo
now supports single or multi-symbol query
On April 28, 2021 00:00 UTC the weights to the following endpoints will be adjusted:
GET /api/v3/order
weight increased to 2GET /api/v3/openOrders
weight increased to 3GET /api/v3/allOrders
weight increased to 10GET /api/v3/orderList
weight increased to 2GET /api/v3/openOrderList
weight increased to 3GET /api/v3/account
weight increased to 10GET /api/v3/myTrades
weight increased to 10GET /api/v3/exchangeInfo
weight increased to 10
USER DATA STREAM
outboundAccountInfo
has been removed.
New API clusters have been added in order to improve performance.
Users can access any of the following API clusters, in addition to api.binance.com
If there are any performance issues with accessing api.binance.com
please try any of the following instead:
- https://api1.binance.com/api/v3/*
- https://api2.binance.com/api/v3/*
- https://api3.binance.com/api/v3/*
USER DATA STREAM
outboundAccountInfo
has been deprecated.outboundAccountInfo
will be removed in the future. (Exact date unknown) Please useoutboundAccountPosition
instead.outboundAccountInfo
will now only show the balance of non-zero assets and assets that have been reduced to 0.
- From 2020-05-01 UTC 00:00, all symbols will have a limit of 200 open orders using the MAX_NUM_ORDERS filter.
- No existing orders will be removed or canceled.
- Accounts that have 200 or more open orders on a symbol will not be able to place new orders on that symbol until the open order count is below 200.
- OCO orders count as 2 open orders before the
LIMIT
order is touched or theSTOP_LOSS
(orSTOP_LOSS_LIMIT
) order is triggered; once this happens the other order is canceled and will no longer count as an open order.
- New field
permissions
- Defines the trading permissions that are allowed on accounts and symbols.
permissions
is an enum array; values:SPOT
MARGIN
permissions
will replaceisSpotTradingAllowed
andisMarginTradingAllowed
onGET api/v3/exchangeInfo
in future API versions (v4+).- For an account to trade on a symbol, the account and symbol must share at least 1 permission in common.
- Updates to
GET api/v3/exchangeInfo
- New field
permissions
added. - New field
quoteAssetPrecision
added; a duplicate of thequotePrecision
field.quotePrecision
will be removed in future API versions (v4+).
- New field
- Updates to
GET api/v3/account
- New field
permissions
added.
- New field
- New endpoint
DELETE api/v3/openOrders
- This will allow a user to cancel all open orders on a single symbol.
- This endpoint will cancel all open orders including OCO orders.
- Orders can be canceled via the API on symbols in the
BREAK
orHALT
status.
OutboundAccountInfo
has new fieldP
which shows the trading permissions of the account.
WEB SOCKET STREAM
- WebSocket connections have a limit of 5 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 1024 streams.
MAX_POSITION
filter added.-
This filter defines the allowed maximum position an account can have on the base asset of a symbol. An account's position defined as the sum of the account's:
- free balance of the base asset
- locked balance of the base asset
- sum of the qty of all open BUY orders
-
BUY
orders will be rejected if the account's position is greater than the maximum position allowed.
-
- Quote Order Qty Market orders have been enabled on all symbols.
- Quote Order Qty
MARKET
orders allow a user to specify the totalquoteOrderQty
spent or received in theMARKET
order. - Quote Order Qty
MARKET
orders will not breakLOT_SIZE
filter rules; the order will execute a quantity that will have the notional value as close as possible toquoteOrderQty
. - Using
BNBBTC
as an example:- On the
BUY
side, the order will buy as many BNB asquoteOrderQty
BTC can. - On the
SELL
side, the order will sell as much BNB as needed to receivequoteOrderQty
BTC.
- On the
- Quote Order Qty
- api/v3/exchangeInfo has new fields:
quoteOrderQtyMarketAllowed
baseCommissionDecimalPlaces
quoteCommissionDecimalPlaces
MARKET
orders have a new optional field:quoteOrderQty
used to specify the quote quantity to BUY or SELL. This cannot be used in combination withquantity
.- The exact timing that
quoteOrderQty
MARKET orders will be enabled is TBD. There will be a separate announcement and further details at that time.
- The exact timing that
- All order query endpoints will return a new field
origQuoteOrderQty
in the JSON payload. (e.g. GET api/v3/allOrders) - Updated error messages for -1128
- Sending an
OCO
with astopLimitPrice
but without astopLimitTimeInForce
will return the error:
{ "code": -1128, "msg": "Combination of optional parameters invalid. Recommendation: 'stopLimitTimeInForce' should also be sent." }
- Sending an
- Updated error messages for -1003 to specify the limit is referring to the request weight, not to the number of requests.
Deprecation of v1 endpoints:
By end of Q1 2020, the following endpoints will be removed from the API. The documentation has been updated to use the v3 versions of these endpoints.
- GET api/v1/depth
- GET api/v1/historicalTrades
- GET api/v1/aggTrades
- GET api/v1/klines
- GET api/v1/ticker/24hr
- GET api/v1/ticker/price
- GET api/v1/exchangeInfo
- POST api/v1/userDataStream
- PUT api/v1/userDataStream
- GET api/v1/ping
- GET api/v1/time
- GET api/v1/ticker/bookTicker
These endpoints however, will NOT be migrated to v3. Please use the following endpoints instead moving forward.
Old V1 Endpoints | New V3 Endpoints |
---|---|
GET api/v1/ticker/allPrices | GET api/v3/ticker/price |
GET api/v1/ticker/allBookTickers | GET api/v3/ticker/bookTicker |
-
Changes to
executionReport
event- If the C field is empty, it will now properly return
null
, instead of"null"
. - New field Q which represents the
quoteOrderQty
.
- If the C field is empty, it will now properly return
-
balanceUpdate
event type added- This event occurs when funds are deposited or withdrawn from your account.
- WSS now supports live subscribing/unsubscribing to streams.
- New WebSocket streams for bookTickers added:
<symbol>@bookTicker
and!bookTicker
. Seeweb-socket-streams.md
for details.
- Faster order book data with 100ms updates:
<symbol>@depth@100ms
and<symbol>@depth#@100ms
- Added "Update Speed:" to
web-socket-streams.md
- Removed deprecated v1 endpoints as per previous announcement:
- GET api/v1/order
- GET api/v1/openOrders
- POST api/v1/order
- DELETE api/v1/order
- GET api/v1/allOrders
- GET api/v1/account
- GET api/v1/myTrades
- GET api/v1/depth
limit
of 10000 has been temporarily removed
-
In Q4 2017, the following endpoints were deprecated and removed from the API documentation. They have been permanently removed from the API as of this version. We apologize for the omission from the original changelog:
- GET api/v1/order
- GET api/v1/openOrders
- POST api/v1/order
- DELETE api/v1/order
- GET api/v1/allOrders
- GET api/v1/account
- GET api/v1/myTrades
-
Streams, endpoints, parameters, payloads, etc. described in the documents in this repository are considered official and supported. The use of any other streams, endpoints, parameters, or payloads, etc. is not supported; use them at your own risk and with no guarantees.
-
New order type: OCO ("One Cancels the Other")
-
An OCO has 2 orders: (also known as legs in financial terms)
STOP_LOSS
orSTOP_LOSS_LIMIT
legLIMIT_MAKER
leg
-
Price Restrictions:
SELL Orders
: Limit Price > Last Price > Stop PriceBUY Orders
: Limit Price < Last Price < Stop Price- As stated, the prices must "straddle" the last traded price on the symbol. EX: If the last price is 10:
- A SELL OCO must have the limit price greater than 10, and the stop price less than 10.
- A BUY OCO must have a limit price less than 10, and the stop price greater than 10.
-
Quantity Restrictions:
- Both legs must have the same quantity.
ICEBERG
quantities however, do not have to be the same.
-
Execution Order:
- If the
LIMIT_MAKER
is touched, the limit maker leg will be executed first BEFORE canceling the Stop Loss Leg. - if the Market Price moves such that the
STOP_LOSS
orSTOP_LOSS_LIMIT
will trigger, the Limit Maker leg will be canceled BEFORE executing theSTOP_LOSS
Leg.
- If the
-
Canceling an OCO
- Canceling either order leg will cancel the entire OCO.
- The entire OCO can be canceled via the
orderListId
or thelistClientOrderId
.
-
New Enums for OCO:
ListStatusType
RESPONSE
- used when ListStatus is responding to a failed action. (either order list placement or cancellation)EXEC_STARTED
- used when an order list has been placed or there is an update to a list's status.ALL_DONE
- used when an order list has finished executing and is no longer active.
ListOrderStatus
EXECUTING
- used when an order list has been placed or there is an update to a list's status.ALL_DONE
- used when an order list has finished executing and is no longer active.REJECT
- used when ListStatus is responding to a failed action. (either order list placement or cancellation)
ContingencyType
OCO
- specifies the type of order list.
-
New Endpoints:
- POST api/v3/order/oco
- DELETE api/v3/orderList
- GET api/v3/orderList
-
-
recvWindow
cannot exceed 60000. -
New
intervalLetter
values for headers:- SECOND => S
- MINUTE => M
- HOUR => H
- DAY => D
-
New Headers
X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter)
will give your current used request weight for the (intervalNum)(intervalLetter) rate limiter. For example, if there is a one minute request rate weight limiter set, you will get aX-MBX-USED-WEIGHT-1M
header in the response. The legacy headerX-MBX-USED-WEIGHT
will still be returned and will represent the current used weight for the one minute request rate weight limit. -
New Header
X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter)
that is updated on any valid order placement and tracks your current order count for the interval; rejected/unsuccessful orders are not guaranteed to haveX-MBX-ORDER-COUNT-**
headers in the response.- Eg.
X-MBX-ORDER-COUNT-1S
for "orders per 1 second" andX-MBX-ORDER-COUNT-1D
for orders per "one day"
- Eg.
-
GET api/v1/depth now supports
limit
5000 and 10000; weights are 50 and 100 respectively. -
GET api/v1/exchangeInfo has a new parameter
ocoAllowed
.
executionReport
event now contains "g" which has theorderListId
; it will be set to -1 for non-OCO orders.- New Event Type
listStatus
;listStatus
is sent on an update to any OCO order. - New Event Type
outboundAccountPosition
;outboundAccountPosition
is sent any time an account's balance changes and contains the assets that could have changed by the event that generated the balance change (a deposit, withdrawal, trade, order placement, or cancellation).
- -1131 BAD_RECV_WINDOW
recvWindow
must be less than 60000
- -1099 Not found, authenticated, or authorized
- This replaces error code -1999
- OCO_BAD_ORDER_PARAMS
- A parameter for one of the orders is incorrect.
- OCO_BAD_PRICES
- The relationship of the prices for the orders is not correct.
- UNSUPPORTED_ORD_OCO
- OCO orders are not supported for this symbol.
- X-MBX-USED-WEIGHT header added to Rest API responses.
- Retry-After header added to Rest API 418 and 429 responses.
- When canceling the Rest API can now return
errorCode
-1013 OR -2011 if the symbol'sstatus
isn'tTRADING
. api/v1/depth
no longer has the ignored and empty[]
.api/v3/myTrades
now returnsquoteQty
; the price * qty of for the trade.
<symbol>@depth
and<symbol>@depthX
streams no longer have the ignored and empty[]
.
- Matching Engine stability/reliability improvements.
- Rest API performance improvements.
- Can now cancel orders through the Rest API during a trading ban.
- New filters:
PERCENT_PRICE
,MARKET_LOT_SIZE
,MAX_NUM_ICEBERG_ORDERS
. - Added
RAW_REQUST
rate limit. Limits based on the number of requests over X minutes regardless of weight. - /api/v3/ticker/price increased to weight of 2 for a no symbol query.
- /api/v3/ticker/bookTicker increased weight of 2 for a no symbol query.
- DELETE /api/v3/order will now return an execution report of the final state of the order.
MIN_NOTIONAL
filter has two new parameters:applyToMarket
(whether or not the filter is applied to MARKET orders) andavgPriceMins
(the number of minutes over which the price averaged for the notional estimation).intervalNum
added to /api/v1/exchangeInfo limits.intervalNum
describes the amount of the interval. For example:intervalNum
5, withinterval
minute, means "every 5 minutes".
-
(qty * price) of all trades / numTrades of the trades over previous 5 minutes.
-
If there is no trade in the last 5 minutes, it takes the first trade that happened outside of the 5min window. For example if the last trade was 20 minutes ago, that trade's price is the 5 min average.
-
If there is no trade on the symbol, there is no average price and market orders cannot be placed. On a new symbol with
applyToMarket
enabled on theMIN_NOTIONAL
filter, market orders cannot be placed until there is at least 1 trade. -
The current average price can be checked here:
https://api.binance.com/api/v3/avgPrice?symbol=<symbol>
For example: https://api.binance.com/api/v3/avgPrice?symbol=BNBUSDT
Last quote asset transacted quantity
(as variableY
) added to execution reports. Represents thelastPrice
*lastQty
(L
*l
).
- New filter:
ICEBERG_PARTS
POST api/v3/order
new defaults fornewOrderRespType
.ACK
,RESULT
, orFULL
;MARKET
andLIMIT
order types default toFULL
, all other orders default toACK
.- POST api/v3/order
RESULT
andFULL
responses now havecummulativeQuoteQty
- GET api/v3/openOrders with no symbol weight reduced to 40.
- GET api/v3/ticker/24hr with no symbol weight reduced to 40.
- Max amount of trades from GET /api/v1/trades increased to 1000.
- Max amount of trades from GET /api/v1/historicalTrades increased to 1000.
- Max amount of aggregate trades from GET /api/v1/aggTrades increased to 1000.
- Max amount of aggregate trades from GET /api/v1/klines increased to 1000.
- Rest API Order lookups now return
updateTime
which represents the last time the order was updated;time
is the order creation time. - Order lookup endpoints will now return
cummulativeQuoteQty
. IfcummulativeQuoteQty
is < 0, it means the data isn't available for this order at this time. REQUESTS
rate limit type changed toREQUEST_WEIGHT
. This limit was always logically request weight and the previous name for it caused confusion.
cummulativeQuoteQty
field added to order responses and execution reports (as variableZ
). Represents the cummulative amount of thequote
that has been spent (with aBUY
order) or received (with aSELL
order). Historical orders will have a value < 0 in this field indicating the data is not available at this time.cummulativeQuoteQty
divided bycummulativeQty
will give the average price for an order.O
(order creation time) added to execution reports
- GET /api/v1/historicalTrades weight decreased to 5
- GET /api/v1/aggTrades weight decreased to 1
- GET /api/v1/klines weight decreased to 1
- GET /api/v1/ticker/24hr all symbols weight decreased to number of trading symbols / 2
- GET /api/v3/allOrders weight decreased to 5
- GET /api/v3/myTrades weight decreased to 5
- GET /api/v3/account weight decreased to 5
- GET /api/v1/depth limit=500 weight decreased to 5
- GET /api/v1/depth limit=1000 weight decreased to 10
- -1003 error message updated to direct users to websockets
- GET /api/v1/ticker/24hr single symbol weight decreased to 1
- GET /api/v3/openOrders all symbols weight decreased to number of trading symbols / 2
- GET /api/v3/allOrders weight decreased to 15
- GET /api/v3/myTrades weight decreased to 15
- GET /api/v3/order weight decreased to 1
- myTrades will now return both sides of a self-trade/wash-trade
- GET /api/v1/aggTrades weight changed to 2
- GET /api/v1/klines weight changed to 2
- GET /api/v3/order weight changed to 2
- GET /api/v3/allOrders weight changed to 20
- GET /api/v3/account weight changed to 20
- GET /api/v3/myTrades weight changed to 20
- GET /api/v3/historicalTrades weight changed to 20