Request parameters. May be omitted if there are no parameters
Request id is truly arbitrary. You can use UUIDs, sequential IDs, current timestamp, etc.
The server does not interpret id in any way, simply echoing it back in the response.
You can freely reuse IDs within a session.
However, be careful to not send more than one request at a time with the same ID,
since otherwise it might be impossible to tell the responses apart.
Request method names may be prefixed with explicit version: e.g., "v3/order.place".
{"id":"e2a85d9f-07a5-4f94-8d5f-789dc3deb097","status":400,"error":{"code":-2010,"msg":"Account has insufficient balance for requested action."},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":13},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":4044},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":322}]}
Status codes in the status field are the same as in HTTP.
Here are some common status codes that you might encounter:
200 indicates a successful response.
4XX status codes indicate invalid requests; the issue is on your side.
400 – your request failed, see error for the reason.
403 – you have been blocked by the Web Application Firewall.
409 – your request partially failed but also partially succeeded, see error for details.
418 – you have been auto-banned for repeated violation of rate limits.
429 – you have exceeded API request rate limit, please slow down.
5XX status codes indicate internal errors; the issue is on Binance's side.
Important: If a response contains 5xx status code, it does not necessarily mean that your request has failed.
Execution status is unknown and the request might have actually succeeded.
Please use query methods to confirm the status.
You might also want to establish a new WebSocket connection for that.
The rateLimits array describes all currently active rate limits affected by the request.
Name
Type
Mandatory
Description
rateLimitType
ENUM
YES
Rate limit type: REQUEST_WEIGHT, ORDERS
interval
ENUM
YES
Rate limit interval: SECOND, MINUTE, HOUR, DAY
intervalNum
INT
YES
Rate limit interval multiplier
limit
INT
YES
Request limit per interval
count
INT
YES
Current usage per interval
Rate limits are accounted by intervals.
For example, a 1 MINUTE interval starts every minute.
Request submitted at 00:01:23.456 counts towards the 00:01:00 minute's limit.
Once the 00:02:00 minute starts, the count will reset to zero again.
Other intervals behave in a similar manner.
For example, 1 DAY rate limit resets at 00:00 UTC every day,
and 10 SECOND interval resets at 00, 10, 20... seconds of each minute.
APIs have multiple rate-limiting intervals.
If you exhaust a shorter interval but the longer interval still allows requests,
you will have to wait for the shorter interval to expire and reset.
If you exhaust a longer interval, you will have to wait for that interval to reset,
even if shorter rate limit count is zero.
rateLimits field is included with every response by default.
However, rate limit information can be quite bulky.
If you are not interested in detailed rate limit status of every request,
the rateLimits field can be omitted from responses to reduce their size.
Optional returnRateLimits boolean parameter in request.
Use returnRateLimits parameter to control whether to include rateLimits fields in response to individual requests.
Failed response indicating that you are banned and the ban will last until epoch 1659146400000:
{"id":"fc93a61a-a192-4cf4-bb2a-a8f0f0c51e06","status":418,"error":{"code":-1003,"msg":"Way too much request weight used; IP banned until 1659146400000. Please use WebSocket Streams for live updates to avoid bans.","data":{"serverTime":1659142907531,"retryAfter":1659146400000}},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2411}]}
If no security type is stated, the security type is NONE.
Security type
API key
Signature
Description
NONE
Public market data
TRADE
required
required
Trading on the exchange, placing and canceling orders
USER_DATA
required
required
Private account information, such as order status and your trading history
USER_STREAM
required
Managing User Data Stream subscriptions
Secure methods require a valid API key to be specified and authenticated.
API keys can be created on the API Management page of your Binance account.
Both API key and secret key are sensitive. Never share them with anyone.
If you notice unusual activity in your account, immediately revoke all the keys and contact Binance support.
API keys can be configured to allow access only to certain types of secure methods.
For example, you can have an API key with TRADE permission for trading,
while using a separate API key with USER_DATA permission to monitor your order status.
By default, an API key cannot TRADE. You need to enable trading in API Management first.
TRADE and USER_DATA requests are also known as SIGNED requests.
SIGNED requests also require a timestamp parameter which should be the current millisecond timestamp.
An additional optional parameter, recvWindow, specifies for how long the request stays valid.
If recvWindow is not sent, it defaults to 5000 milliseconds.
Maximum recvWindow is 60000 milliseconds.
Request processing logic is as follows:
if(timestamp <(serverTime +1000)&&(serverTime - timestamp)<= recvWindow){// process request}else{// reject request}
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.
It is recommended to use a small recvWindow of 5000 or less!
WARNING: DO NOT SHARE YOUR API KEY AND SECRET KEY WITH ANYONE.
The example keys are provided here only for illustrative purposes.
Example of request:
{"id":"4885f793-e5ad-4c3b-8f6c-55d891472b71","method":"order.place","params":{"symbol":"BTCUSDT","side":"SELL","type":"LIMIT","timeInForce":"GTC","quantity":"0.01000000","price":"52000.00","newOrderRespType":"ACK","recvWindow":100,"timestamp":1645423376532,"apiKey":"vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A","signature":"------ FILL ME ------"}}
As you can see, the signature parameter is currently missing.
Step 1. Construct the signature payload
Take all request params except for the signature, sort them by name in alphabetical order:
In this example, we assume the private key is stored in the test-prv-key.pem file.
WARNING: DO NOT SHARE YOUR API KEY AND PRIVATE KEY WITH ANYONE.
The example keys are provided here only for illustrative purposes.
Example of request:
{"id":"4885f793-e5ad-4c3b-8f6c-55d891472b71","method":"order.place","params":{"symbol":"BTCUSDT","side":"SELL","type":"LIMIT","timeInForce":"GTC","quantity":"0.01000000","price":"52000.00","newOrderRespType":"ACK","recvWindow":100,"timestamp":1645423376532,"apiKey":"CAvIjXy3F44yW6Pou5k8Dy1swsYDWJZLeoK2r8G4cFDnE9nosRppc2eKc1T8TRTQ","signature":"------ FILL ME ------"}}
Step 1. Construct the signature payload
Take all request params except for the signature, sort them by name in alphabetical order:
Note: It is highly recommended to use Ed25519 API keys as it should provide the best performance and security out of all supported key types.
Parameter
Value
symbol
BTCUSDT
side
SELL
type
LIMIT
timeInForce
GTC
quantity
1
price
0.2
timestamp
1668481559918
This is a sample code in Python to show how to sign the payload with an Ed25519 key.
#!/usr/bin/env python3import base64import timeimport jsonfrom cryptography.hazmat.primitives.serialization import load_pem_private_keyfrom websocket import create_connection# Set up authenticationAPI_KEY='put your own API Key here'PRIVATE_KEY_PATH='test-prv-key.pem'# Load the private key.# In this example the key is expected to be stored without encryption,# but we recommend using a strong password for improved security.withopen(PRIVATE_KEY_PATH,'rb')as f: private_key = load_pem_private_key(data=f.read(), password=None)# Set up the request parametersparams ={'apiKey': API_KEY,'symbol':'BTCUSDT','side':'SELL','type':'LIMIT','timeInForce':'GTC','quantity':'1.0000000','price':'0.20'}# Timestamp the requesttimestamp =int(time.time()*1000)# UNIX timestamp in millisecondsparams['timestamp']= timestamp# Sign the requestpayload ='&'.join([f'{param}={value}'for param, value insorted(params.items())])signature = base64.b64encode(private_key.sign(payload.encode('ASCII')))params['signature']= signature.decode('ASCII')# Send the requestrequest ={'id':'my_new_order','method':'order.place','params': params}ws = create_connection("wss://ws-api.binance.com:443/ws-api/v3")ws.send(json.dumps(request))result = ws.recv()ws.close()print(result)
Note: Only Ed25519 keys are supported for this feature.
If you do not want to specify apiKey and signature in each individual request,
you can authenticate your API key for the active WebSocket session.
Once authenticated, you no longer have to specify apiKey and signature for those requests that need them.
Requests will be performed on behalf of the account owning the authenticated API key.
Note: You still have to specify the timestamp parameter for SIGNED requests.
You can authenticate an already established connection using session authentication requests:
session.logon – authenticate, or change the API key associated with the connection
session.status – check connection status and the current API key
session.logout – forget the API key associated with the connection
Regarding API key revocation:
If during an active session the API key becomes invalid for any reason (e.g. IP address is not whitelisted, API key was deleted, API key doesn't have correct permissions, etc), after the next request the session will be revoked with the following error message:
{"id":null,"status":401,"error":{"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}}
Only one API key can be authenticated with the WebSocket connection.
The authenticated API key is used by default for requests that require an apiKey parameter.
However, you can always specify the apiKey and signature explicitly for individual requests,
overriding the authenticated API key and using a different one to authorize a specific request.
For example, you might want to authenticate your USER_DATA key to be used by default,
but specify the TRADE key with an explicit signature when placing orders.
Data sources
The API system is asynchronous. Some delay in the response is normal and expected.
Each method has a data source indicating where the data is coming from, and thus how up-to-date it is.
Data Source
Latency
Description
Matching Engine
lowest
The matching engine produces the response directly
Memory
low
Data is fetched from API server's local or external memory cache
Database
moderate
Data is retrieved from the database
Some methods have more than one data source (e.g., Memory => Database).
This means that the API will look for the latest data in that order:
first in the cache, then in the database.
The order was not accepted by the engine and not processed.
EXPIRED
The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill) or by the exchange, (e.g. orders canceled during liquidation, orders canceled during maintenance)
EXPIRED_IN_MATCH
The order was expired by the exchange due to STP. (e.g. an order with EXPIRE_TAKER will match with existing orders on the book with the same account or same tradeGroupId)
OCO Status (listStatusType):
Status
Description
RESPONSE
This is used when the ListStatus is responding to a failed action. (E.g. Orderlist placement or cancellation)
EXEC_STARTED
The order list has been placed or there is an update to the order list status.
ALL_DONE
The order list has finished executing and thus no longer active.
OCO Order Status (listOrderStatus):
Status
Description
EXECUTING
Either an order list has been placed or there is an update to the status of the list.
ALL_DONE
An order list has completed execution and thus no longer active.
REJECT
The List Status is responding to a failed action either during order placement or order canceled
Note:
You can use regular WebSocket ping frames to test connectivity as well,
WebSocket API will respond with pong frames as soon as possible.
ping request along with time is a safe way to test request-response handling in your application.
Examples of Symbol Permissions Interpretation from the Response:#
[["A","B"]] means you may place an order if your account has either permission "A" or permission "B".
[["A"],["B"]] means you can place an order if your account has permission "A" and permission "B".
[["A"],["B","C"]] means you can place an order if your account has permission "A" and permission "B" or permission "C". (Inclusive or is applied here, not exclusive or, so your account may have both permission "B" and permission "C".)
Data Source:
Memory
Response:
{"id":"5494febb-d167-46a2-996d-70533eb4d976","status":200,"result":{"timezone":"UTC","serverTime":1655969291181,// Global rate limits. See "Rate limits" section."rateLimits":[{"rateLimitType":"REQUEST_WEIGHT",// Rate limit type: REQUEST_WEIGHT, ORDERS, CONNECTIONS"interval":"MINUTE",// Rate limit interval: SECOND, MINUTE, DAY"intervalNum":1,// Rate limit interval multiplier (i.e., "1 minute")"limit":6000// Rate limit per interval},{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000},{"rateLimitType":"CONNECTIONS","interval":"MINUTE","intervalNum":5,"limit":300}],// Exchange filters are explained on the "Filters" page:// https://github.com/binance/binance-spot-api-docs/blob/master/filters.md// All exchange filters are optional."exchangeFilters":[],"symbols":[{"symbol":"BNBBTC","status":"TRADING","baseAsset":"BNB","baseAssetPrecision":8,"quoteAsset":"BTC","quotePrecision":8,"quoteAssetPrecision":8,"baseCommissionPrecision":8,"quoteCommissionPrecision":8,"orderTypes":["LIMIT","LIMIT_MAKER","MARKET","STOP_LOSS_LIMIT","TAKE_PROFIT_LIMIT"],"icebergAllowed":true,"ocoAllowed":true,"quoteOrderQtyMarketAllowed":true,"allowTrailingStop":true,"cancelReplaceAllowed":true,"isSpotTradingAllowed":true,"isMarginTradingAllowed":true,// Symbol filters are explained on the "Filters" page:// https://github.com/binance/binance-spot-api-docs/blob/master/filters.md// All symbol filters are optional."filters":[{"filterType":"PRICE_FILTER","minPrice":"0.00000100","maxPrice":"100000.00000000","tickSize":"0.00000100"},{"filterType":"LOT_SIZE","minQty":"0.00100000","maxQty":"100000.00000000","stepSize":"0.00100000"}],"permissions":[],"permissionSets":[["SPOT","MARGIN","TRD_GRP_004"]],"defaultSelfTradePreventionMode":"NONE","allowedSelfTradePreventionModes":["NONE"]}],"sors":[{"baseAsset":"BTC","symbols":["BTCUSDT","BTCUSDC"]}]},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":20}]}
{"id":"51e2affb-0aba-4821-ba75-f2625006eb43","status":200,"result":{"lastUpdateId":2731179239,// Bid levels are sorted from highest to lowest price."bids":[["0.01379900",// Price"3.43200000"// Quantity],["0.01379800","3.24300000"],["0.01379700","10.45500000"],["0.01379600","3.82100000"],["0.01379500","10.26200000"]],// Ask levels are sorted from lowest to highest price."asks":[["0.01380000","5.91700000"],["0.01380100","6.01400000"],["0.01380200","0.26800000"],["0.01380300","0.33800000"],["0.01380400","0.26800000"]]},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
An aggregate trade (aggtrade) represents one or more individual trades.
Trades that fill at the same time, from the same taker order, with the same price –
those trades are collected into an aggregate trade with total quantity of the individual trades.
If you need access to real-time trading activity, please consider using WebSocket Streams:
If you need historical aggregate trade data,
please consider using data.binance.vision.
Weight:
2
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
fromId
INT
NO
Aggregate trade ID to begin at
startTime
INT
NO
endTime
INT
NO
limit
INT
NO
Default 500; max 1000
Notes:
If fromId is specified, return aggtrades with aggregate trade ID >= fromId.
Use fromId and limit to page through all aggtrades.
If startTime and/or endTime are specified, aggtrades are filtered by execution time (T).
fromId cannot be used together with startTime and endTime.
If no condition is specified, the most recent aggregate trades are returned.
Data Source:
Database
Response:
{"id":"189da436-d4bd-48ca-9f95-9f613d621717","status":200,"result":[{"a":50000000,// Aggregate trade ID"p":"0.00274100",// Price"q":"57.19000000",// Quantity"f":59120167,// First trade ID"l":59120170,// Last trade ID"T":1565877971222,// Timestamp"m":true,// Was the buyer the maker?"M":true// Was the trade the best price match?}],"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
If you need historical kline data,
please consider using data.binance.vision.
Weight:
2
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
interval
ENUM
YES
startTime
INT
NO
endTime
INT
NO
timeZone
STRING
NO
Default: 0 (UTC)
limit
INT
NO
Default 500; max 1000
Supported kline intervals (case-sensitive):
Interval
interval value
seconds
1s
minutes
1m, 3m, 5m, 15m, 30m
hours
1h, 2h, 4h, 6h, 8h, 12h
days
1d, 3d
weeks
1w
months
1M
Notes:
If startTime, endTime are not specified, the most recent klines are returned.
Supported values for timeZone:
Hours and minutes (e.g. -1:00, 05:45)
Only hours (e.g. 0, 8, 4)
Accepted range is strictly [-12:00 to +14:00] inclusive
If timeZone provided, kline intervals are interpreted in that timezone instead of UTC.
Note that startTime and endTime are always interpreted in UTC, regardless of timeZone.
Data Source:
Database
Response:
{"id":"1dbbeb56-8eea-466a-8f6e-86bdcfa2fc0b","status":200,"result":[[1655971200000,// Kline open time"0.01086000",// Open price"0.01086600",// High price"0.01083600",// Low price"0.01083800",// Close price"2290.53800000",// Volume1655974799999,// Kline close time"24.85074442",// Quote asset volume2283,// Number of trades"1171.64000000",// Taker buy base asset volume"12.71225884",// Taker buy quote asset volume"0"// Unused field, ignore]],"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
Get klines (candlestick bars) optimized for presentation.
This request is similar to klines, having the same parameters and response.
uiKlines return modified kline data, optimized for presentation of candlestick charts.
If startTime, endTime are not specified, the most recent klines are returned.
Supported values for timeZone:
Hours and minutes (e.g. -1:00, 05:45)
Only hours (e.g. 0, 8, 4)
Accepted range is strictly [-12:00 to +14:00] inclusive
If timeZone provided, kline intervals are interpreted in that timezone instead of UTC.
Note that startTime and endTime are always interpreted in UTC, regardless of timeZone.
Data Source:
Database
Response:
{"id":"b137468a-fb20-4c06-bd6b-625148eec958","status":200,"result":[[1655971200000,// Kline open time"0.01086000",// Open price"0.01086600",// High price"0.01083600",// Low price"0.01083800",// Close price"2290.53800000",// Volume1655974799999,// Kline close time"24.85074442",// Quote asset volume2283,// Number of trades"1171.64000000",// Taker buy base asset volume"12.71225884",// Taker buy quote asset volume"0"// Unused field, ignore]],"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
{"id":"ddbfb65f-9ebf-42ec-8240-8f0f91de0867","status":200,"result":{"mins":5,// Average price interval (in minutes)"price":"9.35751834",// Average price"closeTime":1694061154503// Last trade time},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
If you need different window sizes,
use the ticker request.
Weight:
Adjusted based on the number of requested symbols:
Symbols
Weight
1–20
2
21–100
40
101 or more
80
all symbols
80
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
NO
Query ticker for a single symbol
symbols
ARRAY of STRING
Query ticker for multiple symbols
type
ENUM
NO
Ticker type: FULL (default) or MINI
Notes:
symbol and symbols cannot be used together.
If no symbol is specified, returns information about all symbols currently trading on the exchange.
Data Source:
Memory
Response:
FULL type, for a single symbol:
{"id":"93fb61ef-89f8-4d6e-b022-4f035a3fadad","status":200,"result":{"symbol":"BNBBTC","priceChange":"0.00013900","priceChangePercent":"1.020","weightedAvgPrice":"0.01382453","prevClosePrice":"0.01362800","lastPrice":"0.01376700","lastQty":"1.78800000","bidPrice":"0.01376700","bidQty":"4.64600000","askPrice":"0.01376800","askQty":"14.31400000","openPrice":"0.01362800","highPrice":"0.01414900","lowPrice":"0.01346600","volume":"69412.40500000","quoteVolume":"959.59411487","openTime":1660014164909,"closeTime":1660100564909,"firstId":194696115,// First trade ID"lastId":194968287,// Last trade ID"count":272173// Number of trades},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
MINI type, for a single symbol:
{"id":"9fa2a91b-3fca-4ed7-a9ad-58e3b67483de","status":200,"result":{"symbol":"BNBBTC","openPrice":"0.01362800","highPrice":"0.01414900","lowPrice":"0.01346600","lastPrice":"0.01376700","volume":"69412.40500000","quoteVolume":"959.59411487","openTime":1660014164909,"closeTime":1660100564909,"firstId":194696115,// First trade ID"lastId":194968287,// Last trade ID"count":272173// Number of trades},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":2}]}
If more than one symbol is requested, response returns an array:
{"id":"f4b3b507-c8f2-442a-81a6-b2f12daa030f","status":200,"result":{"symbol":"BTCUSDT","openPrice":"26304.80000000","highPrice":"26397.46000000","lowPrice":"26088.34000000","lastPrice":"26221.67000000","volume":"18495.35066000",// Volume in base asset"quoteVolume":"485217905.04210480",// Volume in quote asset"openTime":1695686400000,"closeTime":1695772799999,"firstId":3220151555,// Trade ID of the first trade in the interval"lastId":3220849281,// Trade ID of the last trade in the interval"count":697727// Number of trades in the interval},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":4}]}
Get rolling window price change statistics with a custom window.
This request is similar to ticker.24hr,
but statistics are computed on demand using the arbitrary window you specify.
Note: Window size precision is limited to 1 minute.
While the closeTime is the current time of the request, openTime always start on a minute boundary.
As such, the effective window might be up to 59999 ms wider than the requested windowSize.
Window computation example
For example, a request for "windowSize": "7d" might result in the following window:
Time of the request – closeTime – is 1660184865291 (August 11, 2022 02:27:45.291).
Requested window size should put the openTime 7 days before that – August 4, 02:27:45.291 –
but due to limited precision it ends up a bit earlier: 1659580020000 (August 4, 2022 02:27:00),
exactly at the start of a minute.
If you need to continuously monitor trading statistics, please consider using WebSocket Streams:
Weight:
Adjusted based on the number of requested symbols:
Symbols
Weight
1–50
4 per symbol
51–100
200
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
Query ticker of a single symbol
symbols
ARRAY of STRING
Query ticker for multiple symbols
type
ENUM
NO
Ticker type: FULL (default) or MINI
windowSize
ENUM
NO
Default 1d
Supported window sizes:
Unit
windowSize value
minutes
1m, 2m ... 59m
hours
1h, 2h ... 23h
days
1d, 2d ... 7d
Notes:
Either symbol or symbols must be specified.
Maximum number of symbols in one request: 200.
Window size units cannot be combined.
E.g., 1d 2h is not supported.
Data Source:
Database
Response:
FULL type, for a single symbol:
{"id":"f4b3b507-c8f2-442a-81a6-b2f12daa030f","status":200,"result":{"symbol":"BNBBTC","priceChange":"0.00061500","priceChangePercent":"4.735","weightedAvgPrice":"0.01368242","openPrice":"0.01298900","highPrice":"0.01418800","lowPrice":"0.01296000","lastPrice":"0.01360400","volume":"587179.23900000","quoteVolume":"8034.03382165","openTime":1659580020000,"closeTime":1660184865291,"firstId":192977765,// First trade ID"lastId":195365758,// Last trade ID"count":2387994// Number of trades},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":4}]}
MINI type, for a single symbol:
{"id":"bdb7c503-542c-495c-b797-4d2ee2e91173","status":200,"result":{"symbol":"BNBBTC","openPrice":"0.01298900","highPrice":"0.01418800","lowPrice":"0.01296000","lastPrice":"0.01360400","volume":"587179.23900000","quoteVolume":"8034.03382165","openTime":1659580020000,"closeTime":1660184865291,"firstId":192977765,// First trade ID"lastId":195365758,// Last trade ID"count":2387994// Number of trades},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":4}]}
If more than one symbol is requested, response returns an array:
Query the status of the WebSocket connection,
inspecting which API key (if any) is used to authorize requests.
Weight:
2
Parameters:
NONE
Data Source:
Memory
Response:
{"id":"b50c16cd-62c9-4e29-89e4-37f10111f5bf","status":200,"result":{// if the connection is not authenticated, "apiKey" and "authorizedSince" will be shown as null"apiKey":"vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A","authorizedSince":1649729878532,"connectedSince":1649729873021,"returnRateLimits":false,"serverTime":1649730611671}}
Forget the API key previously authenticated.
If the connection is not authenticated, this request does nothing.
Note that the WebSocket connection stays open after session.logout request.
You can continue using the connection,
but now you will have to explicitly provide the apiKey and signature parameters where needed.
Buy or sell quantity at the specified price or better.
LIMIT_MAKER
LIMIT order that will be rejected if it immediately matches and trades as a taker.
This order type is also known as a POST-ONLY order.
MARKET
Buy or sell at the best available market price.
MARKET order with quantity parameter specifies the amount of the base asset you want to buy or sell. Actually executed quantity of the quote asset will be determined by available market liquidity.
E.g., a MARKET BUY order on BTCUSDT for "quantity": "0.1000"specifies that you want to buy 0.1 BTC at the best available price. If there is not enough BTC at the best price, keep buying at the next best price, until either your order is filled, or you run out of USDT, or market runs out of BTC.
MARKET order with quoteOrderQty parameter specifies the amount of the quote asset you want to spend (when buying) or receive (when selling). Actually executed quantity of the base asset will be determined by available market liquidity.
E.g., a MARKET BUY on BTCUSDT for "quoteOrderQty": "100.00"specifies that you want to buy as much BTC as you can for 100 USDT at the best available price. Similarly, a SELL order will sell as much available BTC as needed for you to receive 100 USDT (before commission).
STOP_LOSS
Execute a MARKET order for given quantity when specified conditions are met.
I.e., when stopPrice is reached, or when trailingDelta is activated.
STOP_LOSS_LIMIT
Place a LIMIT order with given parameters when specified conditions are met.
TAKE_PROFIT
Like STOP_LOSS but activates when market price moves in the favorable direction.
TAKE_PROFIT_LIMIT
Like STOP_LOSS_LIMIT but activates when market price moves in the favorable direction.
Available timeInForce options,
setting how long the order should be active before expiration:
TIF
Description
GTC
Good 'til Canceled – the order will remain on the book until you cancel it, or the order is completely filled.
IOC
Immediate or Cancel – the order will be filled for as much as possible, the unfilled quantity immediately expires.
FOK
Fill or Kill – the order will expire unless it cannot be immediately filled for the entire quantity.
Notes:
newClientOrderId specifies clientOrderId value for the order.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
Any LIMIT or LIMIT_MAKER order can be made into an iceberg order by specifying the icebergQty.
An order with an icebergQty must have timeInForce set to GTC.
Trigger order price rules for STOP_LOSS/TAKE_PROFIT orders:
stopPrice must be above market price: STOP_LOSS BUY, TAKE_PROFIT SELL
stopPrice must be below market price: STOP_LOSS SELL, TAKE_PROFIT BUY
MARKET orders using quoteOrderQty follow LOT_SIZE filter rules.
The order will execute a quantity that has notional value as close as possible to requested quoteOrderQty.
Data Source:
Matching Engine
Response:
Response format is selected by using the newOrderRespType parameter.
ACK response type:
{"id":"56374a46-3061-486b-a311-99ee972eb648","status":200,"result":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,// always -1 for singular orders"clientOrderId":"4d96324ff9d44481926157ec08158a40","transactTime":1660801715639},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
RESULT response type:
{"id":"56374a46-3061-486b-a311-99ee972eb648","status":200,"result":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,// always -1 for singular orders"clientOrderId":"4d96324ff9d44481926157ec08158a40","transactTime":1660801715639,"price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"SELL","workingTime":1660801715639,"selfTradePreventionMode":"NONE"},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
FULL response type:
{"id":"56374a46-3061-486b-a311-99ee972eb648","status":200,"result":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,"clientOrderId":"4d96324ff9d44481926157ec08158a40","transactTime":1660801715793,"price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00847000","cummulativeQuoteQty":"198.33521500","status":"FILLED","timeInForce":"GTC","type":"LIMIT","side":"SELL","workingTime":1660801715793,// FULL response is identical to RESULT response, with the same optional fields// based on the order type and parameters. FULL response additionally includes// the list of trades which immediately filled the order."fills":[{"price":"23416.10000000","qty":"0.00635000","commission":"0.000000","commissionAsset":"BNB","tradeId":1650422481},{"price":"23416.50000000","qty":"0.00212000","commission":"0.000000","commissionAsset":"BNB","tradeId":1650422482}]},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
{"id":"6ffebe91-01d9-43ac-be99-57cf062e0e30","status":200,"result":{"standardCommissionForOrder":{//Standard commission rates on trades from the order."maker":"0.00000112","taker":"0.00000114"},"taxCommissionForOrder":{//Tax commission rates for trades from the order"maker":"0.00000112","taker":"0.00000114"},"discount":{//Discount on standard commissions when paying in BNB."enabledForAccount":true,"enabledForSymbol":true,"discountAsset":"BNB","discount":"0.25000000"//Standard commission is reduced by this rate when paying in BNB.}},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":20}]}
If both orderId and origClientOrderId parameters are specified,
only orderId is used and origClientOrderId is ignored.
For some historical orders the cummulativeQuoteQty response field may be negative,
meaning the data is not available at this time.
Data Source:
Memory => Database
Response:
{"id":"aa62318a-5a97-4f3b-bdc7-640bbe33b291","status":200,"result":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,// set only for legs of an OCO"clientOrderId":"4d96324ff9d44481926157","price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00847000","cummulativeQuoteQty":"198.33521500","status":"FILLED","timeInForce":"GTC","type":"LIMIT","side":"SELL","stopPrice":"0.00000000",// always present, zero if order type does not use stopPrice"trailingDelta":10,// present only if trailingDelta set for the order"trailingTime":-1,// present only if trailingDelta set for the order"icebergQty":"0.00000000",// always present, zero for non-iceberg orders"time":1660801715639,// time when the order was placed"updateTime":1660801717945,// time of the last update to the order"isWorking":true,"workingTime":1660801715639,"origQuoteOrderQty":"0.00000000"// always present, zero if order type does not use quoteOrderQty"strategyId":37463720,// present only if strategyId set for the order"strategyType":1000000,// present only if strategyType set for the order"selfTradePreventionMode":"NONE","preventedMatchId":0,// present only if the order expired due to STP"preventedQuantity":"1.200000"// present only if the order expired due to STP},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":4}]}
New ID for the canceled order. Automatically generated if not sent
cancelRestrictions
ENUM
NO
Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED.
apiKey
STRING
YES
recvWindow
INT
NO
The value cannot be greater than 60000
signature
STRING
YES
timestamp
INT
YES
Notes:
If both orderId and origClientOrderId parameters are specified,
only orderId is used and origClientOrderId is ignored.
newClientOrderId will replace clientOrderId of the canceled order, freeing it up for new orders.
If you cancel an order that is a part of an OCO pair, the entire OCO is canceled.
Data Source:
Matching Engine
Response:
When an individual order is canceled:
{"id":"5633b6a2-90a9-4192-83e7-925c90b6a2fd","status":200,"result":{"symbol":"BTCUSDT","origClientOrderId":"4d96324ff9d44481926157",// clientOrderId that was canceled"orderId":12569099453,"orderListId":-1,// set only for legs of an OCO"clientOrderId":"91fe37ce9e69c90d6358c0",// newClientOrderId from request"transactTime":1684804350068,"price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00001000","cummulativeQuoteQty":"0.23416100","status":"CANCELED","timeInForce":"GTC","type":"LIMIT","side":"SELL","stopPrice":"0.00000000",// present only if stopPrice set for the order"trailingDelta":0,// present only if trailingDelta set for the order"icebergQty":"0.00000000",// present only if icebergQty set for the order"strategyId":37463720,// present only if strategyId set for the order"strategyType":1000000,// present only if strategyType set for the order"selfTradePreventionMode":"NONE"},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
When an OCO is canceled:
{"id":"16eaf097-bbec-44b9-96ff-e97e6e875870","status":200,"result":{"orderListId":19431,"contingencyType":"OCO","listStatusType":"ALL_DONE","listOrderStatus":"ALL_DONE","listClientOrderId":"iuVNVJYYrByz6C4yGOPPK0","transactionTime":1660803702431,"symbol":"BTCUSDT","orders":[{"symbol":"BTCUSDT","orderId":12569099453,"clientOrderId":"bX5wROblo6YeDwa9iTLeyY"},{"symbol":"BTCUSDT","orderId":12569099454,"clientOrderId":"Tnu2IP0J5Y4mxw3IATBfmW"}],// OCO leg status format is the same as for individual orders."orderReports":[{"symbol":"BTCUSDT","origClientOrderId":"bX5wROblo6YeDwa9iTLeyY","orderId":12569099453,"orderListId":19431,"clientOrderId":"OFFXQtxVFZ6Nbcg4PgE2DA","transactTime":1684804350068,"price":"23450.50000000","origQty":"0.00850000""executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"CANCELED","timeInForce":"GTC","type":"STOP_LOSS_LIMIT","side":"BUY","stopPrice":"23430.00000000","selfTradePreventionMode":"NONE"},{"symbol":"BTCUSDT","origClientOrderId":"Tnu2IP0J5Y4mxw3IATBfmW","orderId":12569099454,"orderListId":19431,"clientOrderId":"OFFXQtxVFZ6Nbcg4PgE2DA","transactTime":1684804350068,"price":"23400.00000000","origQty":"0.00850000""executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"CANCELED","timeInForce":"GTC","type":"LIMIT_MAKER","side":"BUY","selfTradePreventionMode":"NONE"}]},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
Arbitrary numeric value identifying the order within an order strategy.
strategyType
INT
NO
Arbitrary numeric value identifying the order strategy.
Values smaller than 1000000 are reserved and cannot be used.
selfTradePreventionMode
ENUM
NO
The allowed enums is dependent on what is configured on the symbol.
The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
cancelRestrictions
ENUM
NO
Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED. For more information please refer to Regarding cancelRestrictions.
apiKey
STRING
YES
recvWindow
INT
NO
The value cannot be greater than 60000
signature
STRING
YES
timestamp
INT
YES
Similar to the order.place request,
additional mandatory parameters (*) are determined by the new order type.
Available cancelReplaceMode options:
STOP_ON_FAILURE – if cancellation request fails, new order placement will not be attempted
ALLOW_FAILURE – new order placement will be attempted even if the cancel request fails
Request
Response
cancelReplaceMode
cancelResult
newOrderResult
status
STOP_ON_FAILURE
✅ SUCCESS
✅ SUCCESS
200
❌ FAILURE
➖ NOT_ATTEMPTED
400
✅ SUCCESS
❌ FAILURE
409
ALLOW_FAILURE
✅ SUCCESS
✅ SUCCESS
200
❌ FAILURE
❌ FAILURE
400
❌ FAILURE
✅ SUCCESS
409
✅ SUCCESS
❌ FAILURE
409
Notes:
If both cancelOrderId and cancelOrigClientOrderId parameters are specified,
only cancelOrderId is used and cancelOrigClientOrderId is ignored.
cancelNewClientOrderId will replace clientOrderId of the canceled order, freeing it up for new orders.
newClientOrderId specifies clientOrderId value for the placed order.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
The new order can reuse old clientOrderId of the canceled order.
This cancel-replace operation is not transactional.
If one operation succeeds but the other one fails, the successful operation is still executed.
For example, in STOP_ON_FAILURE mode, if the new order placement fails, the old order is still canceled.
Filters and order count limits are evaluated before cancellation and order placement occurs.
If new order placement is not attempted, your order count is still incremented.
Like order.cancel, if you cancel a leg of an OCO, the entire OCO is canceled.
Data Source:
Matching Engine
Response:
If both cancel and placement succeed, you get the following response with "status": 200:
{"id":"99de1036-b5e2-4e0f-9b5c-13d751c93a1a","status":200,"result":{"cancelResult":"SUCCESS","newOrderResult":"SUCCESS",// Format is identical to "order.cancel" format.// Some fields are optional and are included only for orders that set them."cancelResponse":{"symbol":"BTCUSDT","origClientOrderId":"4d96324ff9d44481926157",// cancelOrigClientOrderId from request"orderId":125690984230,"orderListId":-1,"clientOrderId":"91fe37ce9e69c90d6358c0",// cancelNewClientOrderId from request"transactTime":1684804350068,"price":"23450.00000000","origQty":"0.00847000","executedQty":"0.00001000","cummulativeQuoteQty":"0.23450000","status":"CANCELED","timeInForce":"GTC","type":"LIMIT","side":"SELL","selfTradePreventionMode":"NONE"},// Format is identical to "order.place" format, affected by "newOrderRespType".// Some fields are optional and are included only for orders that set them."newOrderResponse":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,"clientOrderId":"bX5wROblo6YeDwa9iTLeyY",// newClientOrderId from request"transactTime":1660813156959,"price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"SELL","selfTradePreventionMode":"NONE"}},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
In STOP_ON_FAILURE mode, failed order cancellation prevents new order from being placed
and returns the following response with "status": 400:
{"id":"27e1bf9f-0539-4fb0-85c6-06183d36f66c","status":400,"error":{"code":-2022,"msg":"Order cancel-replace failed.","data":{"cancelResult":"FAILURE","newOrderResult":"NOT_ATTEMPTED","cancelResponse":{"code":-2011,"msg":"Unknown order sent."},"newOrderResponse":null}},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
If cancel-replace mode allows failure and one of the operations fails,
you get a response with "status": 409,
and the "data" field detailing which operation succeeded, which failed, and why:
{"id":"b220edfe-f3c4-4a3a-9d13-b35473783a25","status":409,"error":{"code":-2021,"msg":"Order cancel-replace partially failed.","data":{"cancelResult":"SUCCESS","newOrderResult":"FAILURE","cancelResponse":{"symbol":"BTCUSDT","origClientOrderId":"4d96324ff9d44481926157","orderId":125690984230,"orderListId":-1,"clientOrderId":"91fe37ce9e69c90d6358c0","price":"23450.00000000","origQty":"0.00847000","executedQty":"0.00001000","cummulativeQuoteQty":"0.23450000","status":"CANCELED","timeInForce":"GTC","type":"LIMIT","side":"SELL","selfTradePreventionMode":"NONE"},"newOrderResponse":{"code":-2010,"msg":"Order would immediately match and take."}}},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
{"id":"ce641763-ff74-41ac-b9f7-db7cbe5e93b1","status":409,"error":{"code":-2021,"msg":"Order cancel-replace partially failed.","data":{"cancelResult":"FAILURE","newOrderResult":"SUCCESS","cancelResponse":{"code":-2011,"msg":"Unknown order sent."},"newOrderResponse":{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,"clientOrderId":"bX5wROblo6YeDwa9iTLeyY","transactTime":1660813156959,"price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00000000","cummulativeQuoteQty":"0.00000000","status":"NEW","timeInForce":"GTC","type":"LIMIT","side":"SELL","workingTime":1669693344508,"fills":[],"selfTradePreventionMode":"NONE"}}},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
If both operations fail, response will have "status": 400:
{"id":"3b3ac45c-1002-4c7d-88e8-630c408ecd87","status":400,"error":{"code":-2022,"msg":"Order cancel-replace failed.","data":{"cancelResult":"FAILURE","newOrderResult":"FAILURE","cancelResponse":{"code":-2011,"msg":"Unknown order sent."},"newOrderResponse":{"code":-2010,"msg":"Order would immediately match and take."}}},"rateLimits":[{"rateLimitType":"ORDERS","interval":"SECOND","intervalNum":10,"limit":50,"count":1},{"rateLimitType":"ORDERS","interval":"DAY","intervalNum":1,"limit":160000,"count":1},{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":1}]}
Send in a new one-cancels-the-other (OCO) pair:
LIMIT_MAKER + STOP_LOSS/STOP_LOSS_LIMIT orders (called legs),
where activation of one order immediately cancels the other.
Weight:
1
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
side
ENUM
YES
BUY or SELL
price
DECIMAL
YES
Price for the limit order
quantity
DECIMAL
YES
listClientOrderId
STRING
NO
Arbitrary unique ID among open OCOs. Automatically generated if not sent
limitClientOrderId
STRING
NO
Arbitrary unique ID among open orders for the limit order. Automatically generated if not sent
limitIcebergQty
DECIMAL
NO
limitStrategyId
INT
NO
Arbitrary numeric value identifying the limit order within an order strategy.
limitStrategyType
INT
NO
Arbitrary numeric value identifying the limit order strategy.
Values smaller than 1000000 are reserved and cannot be used.
stopPrice
DECIMAL
YES *
Either stopPrice or trailingDelta, or both must be specified
Arbitrary numeric value identifying the stop order within an order strategy.
stopStrategyType
INT
NO
Arbitrary numeric value identifying the stop order strategy.
Values smaller than 1000000 are reserved and cannot be used.
newOrderRespType
ENUM
NO
Select response format: ACK, RESULT, FULL (default)
selfTradePreventionMode
ENUM
NO
The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
apiKey
STRING
YES
recvWindow
INT
NO
The value cannot be greater than 60000
signature
STRING
YES
timestamp
INT
YES
Notes:
listClientOrderId parameter specifies listClientOrderId for the OCO pair.
A new OCO with the same listClientOrderId is accepted only when the previous one is filled or completely expired.
listClientOrderId is distinct from clientOrderId of individual orders.
limitClientOrderId and stopClientOrderId specify clientOrderId values for both legs of the OCO.
A new order with the same clientOrderId is accepted only when the previous one is filled or expired.
Price restrictions on the legs:
side
Price relation
BUY
price < market price < stopPrice
SELL
price > market price > stopPrice
Both legs have the same quantity.
However, you can set different iceberg quantity for individual legs.
If stopIcebergQty is used, stopLimitTimeInForce must be GTC.
trailingDelta applies only to the STOP_LOSS/STOP_LOSS_LIMIT leg of the OCO.
OCO counts as 2 orders against the order rate limit.
Data Source:
Matching Engine
Response:
Response format for orderReports is selected using the newOrderRespType parameter.
The following example is for RESULT response type.
See order.place for more examples.
Send in an one-cancels the other (OCO) pair, where activation of one order immediately cancels the other.
An OCO has 2 legs called the above leg and below leg.
One of the legs must be a LIMIT_MAKER order and the other leg must be STOP_LOSS or STOP_LOSS_LIMIT order.
Price restrictions:
If the OCO is on the SELL side: LIMIT_MAKERprice > Last Traded Price > stopPrice
If the OCO is on the BUY side: LIMIT_MAKERprice < Last Traded Price < stopPrice
OCO counts as 2 orders against the order rate limit.
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
listClientOrderId
STRING
NO
Arbitrary unique ID among open OCOs. Automatically generated if not sent. A new order list with the same listClientOrderId is accepted only when the previous one is filled or completely expired. listClientOrderId is distinct from the aboveClientOrderId and the belowCLientOrderId.
Arbitrary numeric value identifying the below leg order within an order strategy.
belowStrategyType
INT
NO
Arbitrary numeric value identifying the below leg order strategy. Values smaller than 1000000 are reserved and cannot be used.
newOrderRespType
ENUM
NO
Select response format: ACK, RESULT, FULL
selfTradePreventionMode
ENUM
NO
The allowed enums is dependent on what is configured on the symbol. The possible supported values are EXPIRE_TAKER, EXPIRE_MAKER, EXPIRE_BOTH, NONE.
apiKey
STRING
YES
recvWindow
LONG
NO
The value cannot be greater than 60000.
timestamp
LONG
YES
signature
STRING
YES
Data Source:
Matching Engine
Response:
Response format for orderReports is selected using the newOrderRespType parameter.
The following example is for RESULT response type.
See order.place for more examples.
Test new order creation and signature/recvWindow using smart order routing (SOR).
Creates and validates a new order but does not send it into the matching engine.
Weight:
Condition
Request Weight
Without computeCommissionRates
1
With computeCommissionRates
20
Parameters:
In addition to all parameters accepted by sor.order.place,
the following optional parameters are also accepted:
{"id":"3a4437e2-41a3-4c19-897c-9cadc5dce8b6","status":200,"result":{"standardCommissionForOrder":{//Commission rates for the order depending on its role (e.g. maker or taker)"maker":"0.00000112","taker":"0.00000114"},"taxCommissionForOrder":{//Tax deduction rates for the order depending on its role (e.g. maker or taker)"maker":"0.00000112","taker":"0.00000114"},"discount":{//Discount on standard commissions when paying in BNB."enabledForAccount":true,"enabledForSymbol":true,"discountAsset":"BNB","discount":"0.25"//Standard commission is reduced by this rate when paying in BNB.}},"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":20}]}
Query information about all your orders – active, canceled, filled – filtered by time range.
Weight:
20
Parameters:
Name
Type
Mandatory
Description
symbol
STRING
YES
orderId
INT
NO
Order ID to begin at
startTime
INT
NO
endTime
INT
NO
limit
INT
NO
Default 500; max 1000
apiKey
STRING
YES
recvWindow
INT
NO
The value cannot be greater than 60000
signature
STRING
YES
timestamp
INT
YES
Notes:
If startTime and/or endTime are specified, orderId is ignored.
Orders are filtered by time of the last execution status update.
If orderId is specified, return orders with order ID >= orderId.
If no condition is specified, the most recent orders are returned.
For some historical orders the cummulativeQuoteQty response field may be negative,
meaning the data is not available at this time.
Data Source:
Database
Response:
Status reports for orders are identical to order.status.
Note that some fields are optional and included only for orders that set them.
{"id":"734235c2-13d2-4574-be68-723e818c08f3","status":200,"result":[{"symbol":"BTCUSDT","orderId":12569099453,"orderListId":-1,"clientOrderId":"4d96324ff9d44481926157","price":"23416.10000000","origQty":"0.00847000","executedQty":"0.00847000","cummulativeQuoteQty":"198.33521500","status":"FILLED","timeInForce":"GTC","type":"LIMIT","side":"SELL","stopPrice":"0.00000000","icebergQty":"0.00000000","time":1660801715639,"updateTime":1660801717945,"isWorking":true,"workingTime":1660801715639,"origQuoteOrderQty":"0.00000000","selfTradePreventionMode":"NONE","preventedMatchId":0,// This field only appears if the order expired due to STP."preventedQuantity":"1.200000"// This field only appears if the order expired due to STP.}],"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":20}]}
{"id":"d3df8a61-98ea-4fe0-8f4e-0fcea5d418b0","status":200,"result":[{"symbol":"BTCUSDT","standardCommission"://Standard commission rates on trades from the order.{"maker":"0.00000010","taker":"0.00000020","buyer":"0.00000030","seller":"0.00000040"},"taxCommission"://Tax commission rates on trades from the order.{"maker":"0.00000112","taker":"0.00000114","buyer":"0.00000118","seller":"0.00000116"},"discount"://Discount on standard commissions when paying in BNB.{"enabledForAccount":true,"enabledForSymbol":true,"discountAsset":"BNB","discount":"0.25000000"//Standard commission is reduced by this rate when paying commission in BNB.}}],"rateLimits":[{"rateLimitType":"REQUEST_WEIGHT","interval":"MINUTE","intervalNum":1,"limit":6000,"count":20}]}
User data streams close automatically after 60 minutes,
even if you're listening to them on WebSocket Streams.
In order to keep the stream open, you have to regularly send pings using the userDataStream.ping request.
It is recommended to send a ping once every 30 minutes.