Skip to main content

Public API Endpoints

General endpoints

Terminology

These terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.

  • base asset refers to the asset that is the quantity of a symbol. For the symbol BTCUSDT, BTC would be the base asset.
  • quote asset refers to the asset that is the price of a symbol. For the symbol BTCUSDT, USDT would be the quote asset.

Test connectivity

GET /api/v3/ping

Test connectivity to the Rest API.

Weight: 1

Parameters: NONE

Data Source: Memory

Response:

{}

Check server time

GET /api/v3/time

Test connectivity to the Rest API and get the current server time.

Weight: 1

Parameters: NONE

Data Source: Memory

Response:

{
"serverTime": 1499827319559
}

Exchange information

GET /api/v3/exchangeInfo

Current exchange trading rules and symbol information

Weight: 20

Parameters:

NameTypeMandatoryDescription
symbolSTRINGNoExample: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbol=BNBBTC"
symbolsARRAY OF STRINGNoExamples: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?symbols=%5B%22BNBBTC%22,%22BTCUSDT%22%5D"
or
curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?symbols=["BTCUSDT","BNBBTC"]'
permissionsENUMNoExamples: curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=SPOT"
or
curl -X GET "https://api.binance.com/api/v3/exchangeInfo?permissions=%5B%22MARGIN%22%2C%22LEVERAGED%22%5D"
or
curl -g -X GET 'https://api.binance.com/api/v3/exchangeInfo?permissions=["MARGIN","LEVERAGED"]'
showPermissionSetsBOOLEANNoControls whether the content of the permissionSets field is populated or not. Defaults to true
symbolStatusENUMNoFilters symbols that have this tradingStatus. Valid values: TRADING, HALT, BREAK
Cannot be used in combination with symbols or symbol.

Notes:

  • If the value provided to symbol or symbols do not exist, the endpoint will throw an error saying the symbol is invalid.
  • All parameters are optional.
  • permissions can support single or multiple values (e.g. SPOT, ["MARGIN","LEVERAGED"]). This cannot be used in combination with symbol or symbols.
  • If permissions parameter not provided, all symbols that have either SPOT, MARGIN, or LEVERAGED permission will be exposed.
    • To display symbols with any permission you need to specify them explicitly in permissions: (e.g. ["SPOT","MARGIN",...].). See Account and Symbol Permissions for the full list.

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:

{
"timezone": "UTC",
"serverTime": 1565246363776,
"rateLimits": [
{
// These are defined in the `ENUM definitions` section under `Rate Limiters (rateLimitType)`.
// All limits are optional
}
],
"exchangeFilters": [
// These are the defined filters in the `Filters` section.
// All filters are optional.
],
"symbols": [
{
"symbol": "ETHBTC",
"status": "TRADING",
"baseAsset": "ETH",
"baseAssetPrecision": 8,
"quoteAsset": "BTC",
"quotePrecision": 8, // will be removed in future api versions (v4+)
"quoteAssetPrecision": 8,
"baseCommissionPrecision": 8,
"quoteCommissionPrecision": 8,
"orderTypes": [
"LIMIT",
"LIMIT_MAKER",
"MARKET",
"STOP_LOSS",
"STOP_LOSS_LIMIT",
"TAKE_PROFIT",
"TAKE_PROFIT_LIMIT"
],
"icebergAllowed": true,
"ocoAllowed": true,
"otoAllowed": true,
"quoteOrderQtyMarketAllowed": true,
"allowTrailingStop": false,
"cancelReplaceAllowed":false,
"isSpotTradingAllowed": true,
"isMarginTradingAllowed": true,
"filters": [
// These are defined in the Filters section.
// All filters are optional
],
"permissions": [],
"permissionSets": [
[
"SPOT",
"MARGIN"
]
],
"defaultSelfTradePreventionMode": "NONE",
"allowedSelfTradePreventionModes": [
"NONE"
]
}
],
// Optional field. Present only when SOR is available.
// https://github.com/binance/binance-spot-api-docs/blob/master/faqs/sor_faq.md
"sors": [
{
"baseAsset": "BTC",
"symbols": [
"BTCUSDT",
"BTCUSDC"
]
}
]
}

Market Data endpoints

Order book

GET /api/v3/depth

Weight: Adjusted based on the limit:

LimitRequest Weight
1-1005
101-50025
501-100050
1001-5000250

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
limitINTNODefault 100; max 5000.
If limit > 5000. then the response will truncate to 5000.

Data Source: Memory

Response:

{
"lastUpdateId": 1027024,
"bids": [
[
"4.00000000", // PRICE
"431.00000000" // QTY
]
],
"asks": [
[
"4.00000200",
"12.00000000"
]
]
}

Recent trades list

GET /api/v3/trades

Get recent trades.

Weight: 25

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
limitINTNODefault 500; max 1000.

Data Source: Memory

Response:

[
{
"id": 28457,
"price": "4.00000100",
"qty": "12.00000000",
"quoteQty": "48.000012",
"time": 1499865549590,
"isBuyerMaker": true,
"isBestMatch": true
}
]

Old trade lookup

GET /api/v3/historicalTrades

Get older trades.

Weight: 25

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
limitINTNODefault 500; max 1000.
fromIdLONGNOTradeId to fetch from. Default gets most recent trades.

Data Source: Database

Response:

[
{
"id": 28457,
"price": "4.00000100",
"qty": "12.00000000",
"quoteQty": "48.000012",
"time": 1499865549590,
"isBuyerMaker": true,
"isBestMatch": true
}
]

Compressed/Aggregate trades list

GET /api/v3/aggTrades

Get compressed, aggregate trades. Trades that fill at the time, from the same taker order, with the same price will have the quantity aggregated.

Weight: 2

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
fromIdLONGNOID to get aggregate trades from INCLUSIVE.
startTimeLONGNOTimestamp in ms to get aggregate trades from INCLUSIVE.
endTimeLONGNOTimestamp in ms to get aggregate trades until INCLUSIVE.
limitINTNODefault 500; max 1000.
  • If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.

Data Source: Database

Response:

[
{
"a": 26129, // Aggregate tradeId
"p": "0.01633102", // Price
"q": "4.70443515", // Quantity
"f": 27781, // First tradeId
"l": 27781, // Last tradeId
"T": 1498793709153, // Timestamp
"m": true, // Was the buyer the maker?
"M": true // Was the trade the best price match?
}
]

Kline/Candlestick data

GET /api/v3/klines

Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.

Weight: 2

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
intervalENUMYES
startTimeLONGNO
endTimeLONGNO
timeZoneSTRINGNODefault: 0 (UTC)
limitINTNODefault 500; max 1000.

Supported kline intervals (case-sensitive):

Intervalinterval value
seconds1s
minutes1m, 3m, 5m, 15m, 30m
hours1h, 2h, 4h, 6h, 8h, 12h
days1d, 3d
weeks1w
months1M

Notes:

  • If startTime and endTime are not sent, 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:

[
[
1499040000000, // Kline open time
"0.01634790", // Open price
"0.80000000", // High price
"0.01575800", // Low price
"0.01577100", // Close price
"148976.11427815", // Volume
1499644799999, // Kline Close time
"2434.19055334", // Quote asset volume
308, // Number of trades
"1756.87402397", // Taker buy base asset volume
"28.46694368", // Taker buy quote asset volume
"0" // Unused field, ignore.
]
]

UIKlines

GET /api/v3/uiKlines

The request is similar to klines having the same parameters and response.

uiKlines return modified kline data, optimized for presentation of candlestick charts.

Weight: 2

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
intervalENUMYESSee klines
startTimeLONGNO
endTimeLONGNO
timeZoneSTRINGNODefault: 0 (UTC)
limitINTNODefault 500; max 1000.
  • If startTime and endTime are not sent, 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:

[
[
1499040000000, // Kline open time
"0.01634790", // Open price
"0.80000000", // High price
"0.01575800", // Low price
"0.01577100", // Close price
"148976.11427815", // Volume
1499644799999, // Kline close time
"2434.19055334", // Quote asset volume
308, // Number of trades
"1756.87402397", // Taker buy base asset volume
"28.46694368", // Taker buy quote asset volume
"0" // Unused field. Ignore.
]
]

Current average price

GET /api/v3/avgPrice

Current average price for a symbol.

Weight: 2

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES

Data Source: Memory

Response:

{
"mins": 5, // Average price interval (in minutes)
"price": "9.35751834", // Average price
"closeTime": 1694061154503 // Last trade time
}

24hr ticker price change statistics

GET /api/v3/ticker/24hr

24 hour rolling window price change statistics. Careful when accessing this with no symbol.

Weight:

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 80
symbols 1-20 2
21-100 40
101 or more 80
symbols parameter is omitted 80

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.
If neither parameter is sent, tickers for all symbols will be returned in an array.

Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO
type ENUM NO Supported values: FULL or MINI.
If none provided, the default is FULL

Data Source: Memory

Response - FULL:

{
"symbol": "BNBBTC",
"priceChange": "-94.99999800",
"priceChangePercent": "-95.960",
"weightedAvgPrice": "0.29628482",
"prevClosePrice": "0.10002000",
"lastPrice": "4.00000200",
"lastQty": "200.00000000",
"bidPrice": "4.00000000",
"bidQty": "100.00000000",
"askPrice": "4.00000200",
"askQty": "100.00000000",
"openPrice": "99.00000000",
"highPrice": "100.00000000",
"lowPrice": "0.10000000",
"volume": "8913.30000000",
"quoteVolume": "15.30000000",
"openTime": 1499783499040,
"closeTime": 1499869899040,
"firstId": 28385, // First tradeId
"lastId": 28460, // Last tradeId
"count": 76 // Trade count
}

OR

[
{
"symbol": "BNBBTC",
"priceChange": "-94.99999800",
"priceChangePercent": "-95.960",
"weightedAvgPrice": "0.29628482",
"prevClosePrice": "0.10002000",
"lastPrice": "4.00000200",
"lastQty": "200.00000000",
"bidPrice": "4.00000000",
"bidQty": "100.00000000",
"askPrice": "4.00000200",
"askQty": "100.00000000",
"openPrice": "99.00000000",
"highPrice": "100.00000000",
"lowPrice": "0.10000000",
"volume": "8913.30000000",
"quoteVolume": "15.30000000",
"openTime": 1499783499040,
"closeTime": 1499869899040,
"firstId": 28385, // First tradeId
"lastId": 28460, // Last tradeId
"count": 76 // Trade count
}
]

Response - MINI:

{
"symbol": "BNBBTC", // Symbol Name
"openPrice": "99.00000000", // Opening price of the Interval
"highPrice": "100.00000000", // Highest price in the interval
"lowPrice": "0.10000000", // Lowest price in the interval
"lastPrice": "4.00000200", // Closing price of the interval
"volume": "8913.30000000", // Total trade volume (in base asset)
"quoteVolume": "15.30000000", // Total trade volume (in quote asset)
"openTime": 1499783499040, // Start of the ticker interval
"closeTime": 1499869899040, // End of the ticker interval
"firstId": 28385, // First tradeId considered
"lastId": 28460, // Last tradeId considered
"count": 76 // Total trade count
}

OR

[
{
"symbol": "BNBBTC",
"openPrice": "99.00000000",
"highPrice": "100.00000000",
"lowPrice": "0.10000000",
"lastPrice": "4.00000200",
"volume": "8913.30000000",
"quoteVolume": "15.30000000",
"openTime": 1499783499040,
"closeTime": 1499869899040,
"firstId": 28385,
"lastId": 28460,
"count": 76
},
{
"symbol": "LTCBTC",
"openPrice": "0.07000000",
"highPrice": "0.07000000",
"lowPrice": "0.07000000",
"lastPrice": "0.07000000",
"volume": "11.00000000",
"quoteVolume": "0.77000000",
"openTime": 1656908192899,
"closeTime": 1656994592899,
"firstId": 0,
"lastId": 10,
"count": 11
}
]

Trading Day Ticker

GET /api/v3/ticker/tradingDay

Price change statistics for a trading day.

Weight:

4 for each requested symbol.

The weight for this request will cap at 200 once the number of symbols in the request is more than 50.

Parameters:

Name Type Mandatory Description
symbol STRING YES Either symbol or symbols must be provided

Examples of accepted format for the symbols parameter:
["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

The maximum number of symbols allowed in a request is 100.
symbols
timeZone STRING NO Default: 0 (UTC)
type ENUM NO Supported values: FULL or MINI.
If none provided, the default is FULL

Notes:

  • Supported values for timeZone:
    • Hours and minutes (e.g. -1:00, 05:45)
    • Only hours (e.g. 0, 8, 4)

Data Source: Database

Response - FULL:

With symbol:

{
"symbol": "BTCUSDT",
"priceChange": "-83.13000000", // Absolute price change
"priceChangePercent": "-0.317", // Relative price change in percent
"weightedAvgPrice": "26234.58803036", // quoteVolume / volume
"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
}

With symbols:

[
{
"symbol": "BTCUSDT",
"priceChange": "-83.13000000",
"priceChangePercent": "-0.317",
"weightedAvgPrice": "26234.58803036",
"openPrice": "26304.80000000",
"highPrice": "26397.46000000",
"lowPrice": "26088.34000000",
"lastPrice": "26221.67000000",
"volume": "18495.35066000",
"quoteVolume": "485217905.04210480",
"openTime": 1695686400000,
"closeTime": 1695772799999,
"firstId": 3220151555,
"lastId": 3220849281,
"count": 697727
},
{
"symbol": "BNBUSDT",
"priceChange": "2.60000000",
"priceChangePercent": "1.238",
"weightedAvgPrice": "211.92276958",
"openPrice": "210.00000000",
"highPrice": "213.70000000",
"lowPrice": "209.70000000",
"lastPrice": "212.60000000",
"volume": "280709.58900000",
"quoteVolume": "59488753.54750000",
"openTime": 1695686400000,
"closeTime": 1695772799999,
"firstId": 672397461,
"lastId": 672496158,
"count": 98698
}
]

Response - MINI:

With symbol:

{
"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
}

With symbols:

[
{
"symbol": "BTCUSDT",
"openPrice": "26304.80000000",
"highPrice": "26397.46000000",
"lowPrice": "26088.34000000",
"lastPrice": "26221.67000000",
"volume": "18495.35066000",
"quoteVolume": "485217905.04210480",
"openTime": 1695686400000,
"closeTime": 1695772799999,
"firstId": 3220151555,
"lastId": 3220849281,
"count": 697727
},
{
"symbol": "BNBUSDT",
"openPrice": "210.00000000",
"highPrice": "213.70000000",
"lowPrice": "209.70000000",
"lastPrice": "212.60000000",
"volume": "280709.58900000",
"quoteVolume": "59488753.54750000",
"openTime": 1695686400000,
"closeTime": 1695772799999,
"firstId": 672397461,
"lastId": 672496158,
"count": 98698
}
]

Symbol price ticker

GET /api/v3/ticker/price

Latest price for a symbol or symbols.

Weight:

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 4
symbols Any 4

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.
If neither parameter is sent, prices for all symbols will be returned in an array.

Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO

Data Source: Memory

Response:

{
"symbol": "LTCBTC",
"price": "4.00000200"
}

OR

[
{
"symbol": "LTCBTC",
"price": "4.00000200"
},
{
"symbol": "ETHBTC",
"price": "0.07946600"
}
]

Symbol order book ticker

GET /api/v3/ticker/bookTicker

Best price/qty on the order book for a symbol or symbols.

Weight:

Parameter Symbols Provided Weight
symbol 1 2
symbol parameter is omitted 4
symbols Any 4

Parameters:

Name Type Mandatory Description
symbol STRING NO Parameter symbol and symbols cannot be used in combination.
If neither parameter is sent, bookTickers for all symbols will be returned in an array.

Examples of accepted format for the symbols parameter: ["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D
symbols STRING NO

Data Source: Memory

Response:

{
"symbol": "LTCBTC",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
}

OR

[
{
"symbol": "LTCBTC",
"bidPrice": "4.00000000",
"bidQty": "431.00000000",
"askPrice": "4.00000200",
"askQty": "9.00000000"
},
{
"symbol": "ETHBTC",
"bidPrice": "0.07946700",
"bidQty": "9.00000000",
"askPrice": "100000.00000000",
"askQty": "1000.00000000"
}
]

Rolling window price change statistics

GET /api/v3/ticker

Note: This endpoint is different from the GET /api/v3/ticker/24hr endpoint.

The window used to compute statistics will be no more than 59999ms from the requested windowSize.

openTime for /api/v3/ticker always starts on a minute, while the closeTime is the current time of the request. As such, the effective window will be up to 59999ms wider than windowSize.

E.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the windowSize is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00)

Weight:

4 for each requested symbol regardless of windowSize.

The weight for this request will cap at 200 once the number of symbols in the request is more than 50.

Parameters:

Name Type Mandatory Description
symbol STRING YES Either symbol or symbols must be provided

Examples of accepted format for the symbols parameter:
["BTCUSDT","BNBUSDT"]
or
%5B%22BTCUSDT%22,%22BNBUSDT%22%5D

The maximum number of symbols allowed in a request is 100.
symbols
windowSize ENUM NO Defaults to 1d if no parameter provided
Supported windowSize values:
1m,2m....59m for minutes
1h, 2h....23h - for hours
1d...7d - for days

Units cannot be combined (e.g. 1d2h is not allowed)
type ENUM NO Supported values: FULL or MINI.
If none provided, the default is FULL

Data Source: Database

Response - FULL:

When using symbol:

{
"symbol": "BNBBTC",
"priceChange": "-8.00000000", // Absolute price change
"priceChangePercent": "-88.889", // Relative price change in percent
"weightedAvgPrice": "2.60427807", // QuoteVolume / Volume
"openPrice": "9.00000000",
"highPrice": "9.00000000",
"lowPrice": "1.00000000",
"lastPrice": "1.00000000",
"volume": "187.00000000",
"quoteVolume": "487.00000000", // Sum of (price * volume) for all trades
"openTime": 1641859200000, // Open time for ticker window
"closeTime": 1642031999999, // Close time for ticker window
"firstId": 0, // Trade IDs
"lastId": 60,
"count": 61 // Number of trades in the interval
}

or

When using symbols:

[
{
"symbol": "BTCUSDT",
"priceChange": "-154.13000000", // Absolute price change
"priceChangePercent": "-0.740", // Relative price change in percent
"weightedAvgPrice": "20677.46305250", // QuoteVolume / Volume
"openPrice": "20825.27000000",
"highPrice": "20972.46000000",
"lowPrice": "20327.92000000",
"lastPrice": "20671.14000000",
"volume": "72.65112300",
"quoteVolume": "1502240.91155513", // Sum of (price * volume) for all trades
"openTime": 1655432400000, // Open time for ticker window
"closeTime": 1655446835460, // Close time for ticker window
"firstId": 11147809, // Trade IDs
"lastId": 11149775,
"count": 1967 // Number of trades in the interval
},
{
"symbol": "BNBBTC",
"priceChange": "0.00008530",
"priceChangePercent": "0.823",
"weightedAvgPrice": "0.01043129",
"openPrice": "0.01036170",
"highPrice": "0.01049850",
"lowPrice": "0.01033870",
"lastPrice": "0.01044700",
"volume": "166.67000000",
"quoteVolume": "1.73858301",
"openTime": 1655432400000,
"closeTime": 1655446835460,
"firstId": 2351674,
"lastId": 2352034,
"count": 361
}
]

Response - MINI:

When using symbol:

{
"symbol": "LTCBTC",
"openPrice": "0.10000000",
"highPrice": "2.00000000",
"lowPrice": "0.10000000",
"lastPrice": "2.00000000",
"volume": "39.00000000",
"quoteVolume": "13.40000000", // Sum of (price * volume) for all trades
"openTime": 1656986580000, // Open time for ticker window
"closeTime": 1657001016795, // Close time for ticker window
"firstId": 0, // Trade IDs
"lastId": 34,
"count": 35 // Number of trades in the interval
}

OR

When using symbols:

[
{
"symbol": "BNBBTC",
"openPrice": "0.10000000",
"highPrice": "2.00000000",
"lowPrice": "0.10000000",
"lastPrice": "2.00000000",
"volume": "39.00000000",
"quoteVolume": "13.40000000", // Sum of (price * volume) for all trades
"openTime": 1656986880000, // Open time for ticker window
"closeTime": 1657001297799, // Close time for ticker window
"firstId": 0, // Trade IDs
"lastId": 34,
"count": 35 // Number of trades in the interval
},
{
"symbol": "LTCBTC",
"openPrice": "0.07000000",
"highPrice": "0.07000000",
"lowPrice": "0.07000000",
"lastPrice": "0.07000000",
"volume": "33.00000000",
"quoteVolume": "2.31000000",
"openTime": 1656986880000,
"closeTime": 1657001297799,
"firstId": 0,
"lastId": 32,
"count": 33
}
]

Trading endpoints

New order (TRADE)

POST /api/v3/order 

Send in a new order.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
sideENUMYES
typeENUMYES
timeInForceENUMNO
quantityDECIMALNO
quoteOrderQtyDECIMALNO
priceDECIMALNO
newClientOrderIdSTRINGNOA unique id among open orders. Automatically generated if not sent.
Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected.
strategyIdLONGNO
strategyTypeINTNOThe value cannot be less than 1000000.
stopPriceDECIMALNOUsed with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
trailingDeltaLONGNOUsed with STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
icebergQtyDECIMALNOUsed with LIMIT, STOP_LOSS_LIMIT, and TAKE_PROFIT_LIMIT to create an iceberg order.
newOrderRespTypeENUMNOSet the response JSON. ACK, RESULT, or FULL; MARKET and LIMIT order types default to FULL, all other orders default to ACK.
selfTradePreventionModeENUMNOThe allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes.
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Some additional mandatory parameters based on order type:

TypeAdditional mandatory parametersAdditional Information
LIMITtimeInForce, quantity, price
MARKETquantity or quoteOrderQtyMARKET orders using the quantity field specifies the amount of the base asset the user wants to buy or sell at the market price.
E.g. MARKET order on BTCUSDT will specify how much BTC the user is buying or selling.

MARKET orders using quoteOrderQty specifies the amount the user wants to spend (when buying) or receive (when selling) the quote asset; the correct quantity will be determined based on the market liquidity and quoteOrderQty.
E.g. Using the symbol BTCUSDT:
BUY side, the order will buy as many BTC as quoteOrderQty USDT can.
SELL side, the order will sell as much BTC needed to receive quoteOrderQty USDT.
STOP_LOSSquantity, stopPrice or trailingDeltaThis will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated)
STOP_LOSS_LIMITtimeInForce, quantity, price, stopPrice or trailingDelta
TAKE_PROFITquantity, stopPrice or trailingDeltaThis will execute a MARKET order when the conditions are met. (e.g. stopPrice is met or trailingDelta is activated)
TAKE_PROFIT_LIMITtimeInForce, quantity, price, stopPrice or trailingDelta
LIMIT_MAKERquantity, priceThis is a LIMIT order that will be rejected if the order immediately matches and trades as a taker.
This is also known as a POST-ONLY order.

Other info:

  • Any LIMIT or LIMIT_MAKER type order can be made an iceberg order by sending an icebergQty.

  • Any order with an icebergQty MUST have timeInForce set to GTC.

  • For STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT_LIMIT and TAKE_PROFIT orders, trailingDelta can be combined with stopPrice.

  • MARKET orders using quoteOrderQty will not break LOT_SIZE filter rules; the order will execute a quantity that will have the notional value as close as possible to quoteOrderQty. Trigger order price rules against market price for both MARKET and LIMIT versions:

  • Price above market price: STOP_LOSS BUY, TAKE_PROFIT SELL

  • Price below market price: STOP_LOSS SELL, TAKE_PROFIT BUY

Data Source: Matching Engine

Response - ACK:

{
"symbol": "BTCUSDT",
"orderId": 28,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"transactTime": 1507725176595
}

Response - RESULT:

{
"symbol": "BTCUSDT",
"orderId": 28,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"transactTime": 1507725176595,
"price": "0.00000000",
"origQty": "10.00000000",
"executedQty": "10.00000000",
"cummulativeQuoteQty": "10.00000000",
"status": "FILLED",
"timeInForce": "GTC",
"type": "MARKET",
"side": "SELL",
"workingTime": 1507725176595,
"selfTradePreventionMode": "NONE"
}

Response - FULL:

{
"symbol": "BTCUSDT",
"orderId": 28,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "6gCrw2kRUAF9CvJDGP16IP",
"transactTime": 1507725176595,
"price": "0.00000000",
"origQty": "10.00000000",
"executedQty": "10.00000000",
"cummulativeQuoteQty": "10.00000000",
"status": "FILLED",
"timeInForce": "GTC",
"type": "MARKET",
"side": "SELL",
"workingTime": 1507725176595,
"selfTradePreventionMode": "NONE",
"fills": [
{
"price": "4000.00000000",
"qty": "1.00000000",
"commission": "4.00000000",
"commissionAsset": "USDT",
"tradeId": 56
},
{
"price": "3999.00000000",
"qty": "5.00000000",
"commission": "19.99500000",
"commissionAsset": "USDT",
"tradeId": 57
},
{
"price": "3998.00000000",
"qty": "2.00000000",
"commission": "7.99600000",
"commissionAsset": "USDT",
"tradeId": 58
},
{
"price": "3997.00000000",
"qty": "1.00000000",
"commission": "3.99700000",
"commissionAsset": "USDT",
"tradeId": 59
},
{
"price": "3995.00000000",
"qty": "1.00000000",
"commission": "3.99500000",
"commissionAsset": "USDT",
"tradeId": 60
}
]
}

Conditional fields in Order Responses

There are fields in the order responses (e.g. order placement, order query, order cancellation) that appear only if certain conditions are met.

These fields can apply to order lists.

The fields are listed below:

FieldDescriptionVisibility conditionsExamples
icebergQtyQuantity for the iceberg orderAppears only if the parameter icebergQty was sent in the request."icebergQty": "0.00000000"
preventedMatchIdWhen used in combination with symbol, can be used to query a prevented match.Appears only if the order expired due to STP."preventedMatchId": 0
preventedQuantityOrder quantity that expired due to STPAppears only if the order expired due to STP."preventedQuantity": "1.200000"
stopPricePrice when the algorithmic order will be triggeredAppears for STOP_LOSS. TAKE_PROFIT, STOP_LOSS_LIMIT and TAKE_PROFIT_LIMIT orders."stopPrice": "23500.00000000"
strategyIdCan be used to label an order that's part of an order strategy.Appears if the parameter was populated in the request."strategyId": 37463720
strategyTypeCan be used to label an order that is using an order strategy.Appears if the parameter was populated in the request."strategyType": 1000000
trailingDeltaDelta price change required before order activationAppears for Trailing Stop Orders."trailingDelta": 10
trailingTimeTime when the trailing order is now active and tracking price changesAppears only for Trailing Stop Orders."trailingTime": -1
usedSorField that determines whether order used SORAppears when placing orders using SOR"usedSor": true
workingFloorField that determines whether the order is being filled by the SOR or by the order book the order was submitted to.Appears when placing orders using SOR"workingFloor": "SOR"

Test new order (TRADE)

POST /api/v3/order/test

Test new order creation and signature/recvWindow long. Creates and validates a new order but does not send it into the matching engine.

Weight:

ConditionRequest Weight
Without computeCommissionRates1
With computeCommissionRates20

Parameters:

In addition to all parameters accepted by POST /api/v3/order, the following optional parameters are also accepted:

NameTypeMandatoryDescription
computeCommissionRatesBOOLEANNODefault: false

Data Source: Memory

Response:

Without computeCommissionRates

{}

With computeCommissionRates

{
"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 commission in BNB.
}
}

Query order (USER_DATA)

GET /api/v3/order 

Check an order's status.

Weight: 4

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderIdLONGNO
origClientOrderIdSTRINGNO
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Notes:

  • Either orderId or origClientOrderId must be sent.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.

Data Source: Memory => Database

Response:

{
"symbol": "LTCBTC",
"orderId": 1,
"orderListId": -1 // This field will always have a value of -1 if not an order list.
"clientOrderId": "myOrder1",
"price": "0.1",
"origQty": "1.0",
"executedQty": "0.0",
"cummulativeQuoteQty": "0.0",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0.0",
"icebergQty": "0.0",
"time": 1499827319559,
"updateTime": 1499827319559,
"isWorking": true,
"workingTime":1499827319559,
"origQuoteOrderQty": "0.000000",
"selfTradePreventionMode": "NONE"
}

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Cancel order (TRADE)

DELETE /api/v3/order 

Cancel an active order.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderIdLONGNO
origClientOrderIdSTRINGNO
newClientOrderIdSTRINGNOUsed to uniquely identify this cancel. Automatically generated by default.
cancelRestrictionsENUMNOSupported values:
ONLY_NEW - Cancel will succeed if the order status is NEW.
ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED.
recvWindowLONGNOThe value cannot be greater than 60000.
timestampLONGYES

Either orderId or origClientOrderId must be sent. If both parameters are sent, orderId takes precedence.

Data Source: Matching Engine

Response:

{
"symbol": "LTCBTC",
"origClientOrderId": "myOrder1",
"orderId": 4,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "cancelMyOrder1",
"transactTime": 1684804350068,
"price": "2.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"selfTradePreventionMode": "NONE"
}

Note: The payload above does not show all fields that can appear in the order response. Please refer to Conditional fields in Order Responses.

Regarding cancelRestrictions

  • If the cancelRestrictions value is not any of the supported values, the error will be:
{
"code": -1145,
"msg": "Invalid cancelRestrictions"
}
  • If the order did not pass the conditions for cancelRestrictions, the error will be:
{
"code": -2011,
"msg": "Order was not canceled due to cancel restrictions."
}

Cancel All Open Orders on a Symbol (TRADE)

DELETE /api/v3/openOrders 

Cancels all active orders on a symbol. This includes orders that are part of an order list.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Matching Engine

Response:

[
{
"symbol": "BTCUSDT",
"origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
"orderId": 11,
"orderListId": -1,
"clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
"transactTime": 1684804350068,
"price": "0.089853",
"origQty": "0.178622",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"origClientOrderId": "A3EF2HCwxgZPFMrfwbgrhv",
"orderId": 13,
"orderListId": -1,
"clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
"transactTime": 1684804350069,
"price": "0.090430",
"origQty": "0.178622",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"selfTradePreventionMode": "NONE"
},
{
"orderListId": 1929,
"contingencyType": "OCO",
"listStatusType": "ALL_DONE",
"listOrderStatus": "ALL_DONE",
"listClientOrderId": "2inzWQdDvZLHbbAmAozX2N",
"transactionTime": 1585230948299,
"symbol": "BTCUSDT",
"orders": [
{
"symbol": "BTCUSDT",
"orderId": 20,
"clientOrderId": "CwOOIPHSmYywx6jZX77TdL"
},
{
"symbol": "BTCUSDT",
"orderId": 21,
"clientOrderId": "461cPg51vQjV3zIMOXNz39"
}
],
"orderReports": [
{
"symbol": "BTCUSDT",
"origClientOrderId": "CwOOIPHSmYywx6jZX77TdL",
"orderId": 20,
"orderListId": 1929,
"clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
"transactTime": 1688005070874,
"price": "0.668611",
"origQty": "0.690354",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "BUY",
"stopPrice": "0.378131",
"icebergQty": "0.017083",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "BTCUSDT",
"origClientOrderId": "461cPg51vQjV3zIMOXNz39",
"orderId": 21,
"orderListId": 1929,
"clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
"transactTime": 1688005070874,
"price": "0.008791",
"origQty": "0.690354",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"icebergQty": "0.639962",
"selfTradePreventionMode": "NONE"
}
]
}
]

Cancel an Existing Order and Send a New Order (TRADE)

POST /api/v3/order/cancelReplace

Cancels an existing order and places a new order on the same symbol.

Filters and Order Count are evaluated before the processing of the cancellation and order placement occurs.

A new order that was not attempted (i.e. when newOrderResult: NOT_ATTEMPTED ), will still increase the order count by 1.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
sideENUMYES
typeENUMYES
cancelReplaceModeENUMYESThe allowed values are:
STOP_ON_FAILURE - If the cancel request fails, the new order placement will not be attempted.
ALLOW_FAILURE - new order placement will be attempted even if cancel request fails.
timeInForceENUMNO
quantityDECIMALNO
quoteOrderQtyDECIMALNO
priceDECIMALNO
cancelNewClientOrderIdSTRINGNOUsed to uniquely identify this cancel. Automatically generated by default.
cancelOrigClientOrderIdSTRINGNOEither the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
cancelOrderIdLONGNOEither the cancelOrigClientOrderId or cancelOrderId must be provided. If both are provided, cancelOrderId takes precedence.
newClientOrderIdSTRINGNOUsed to identify the new order.
strategyIdLONGNO
strategyTypeINTNOThe value cannot be less than 1000000.
stopPriceDECIMALNO
trailingDeltaLONGNO
icebergQtyDECIMALNO
newOrderRespTypeENUMNOAllowed values:
ACK, RESULT, FULL
MARKET and LIMIT orders types default to FULL; all other orders default to ACK
selfTradePreventionModeENUMNOThe allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes.
cancelRestrictionsENUMNOSupported 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
orderRateLimitExceededModeENUMNoSupported values:
DO_NOTHING (default)- will only attempt to cancel the order if account has not exceeded the unfilled order rate limit
CANCEL_ONLY - will always cancel the order
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Similar to POST /api/v3/order, additional mandatory parameters are determined by type.

Response format varies depending on whether the processing of the message succeeded, partially succeeded, or failed.

Data Source: Matching Engine

Request Response
cancelReplaceMode orderRateLimitExceededMode Unfilled Order Count cancelResult newOrderResult status
STOP_ON_FAILURE DO_NOTHING Within Limits SUCCESS SUCCESS 200
FAILURE NOT_ATTEMPTED 400
SUCCESS FAILURE 409
Exceeds Limits SUCCESS SUCCESS N/A
FAILURE NOT_ATTEMPTED N/A
SUCCESS FAILURE N/A
CANCEL_ONLY Within Limits SUCCESS SUCCESS 200
FAILURE NOT_ATTEMPTED 400
SUCCESS FAILURE 409
Exceeds Limits FAILURE NOT_ATTEMPTED 429
SUCCESS FAILURE 429
ALLOW_FAILURE DO_NOTHING Within Limits SUCCESS SUCCESS 200
FAILURE FAILURE 400
FAILURE SUCCESS 409
SUCCESS FAILURE 409
Exceeds Limits SUCCESS SUCCESS N/A
FAILURE FAILURE N/A
FAILURE SUCCESS N/A
SUCCESS FAILURE N/A
CANCEL_ONLY Within Limits SUCCESS SUCCESS 200
FAILURE FAILURE 400
FAILURE SUCCESS 409
SUCCESS FAILURE 409
Exceeds Limits SUCCESS SUCCESS N/A
FAILURE FAILURE 400
FAILURE SUCCESS N/A
SUCCESS FAILURE 409

Response SUCCESS unfilled order count is not exceeded:

// Both the cancel order placement and new order placement succeeded.
{
"cancelResult": "SUCCESS",
"newOrderResult": "SUCCESS",
"cancelResponse": {
"symbol": "BTCUSDT",
"origClientOrderId": "DnLo3vTAQcjha43lAZhZ0y",
"orderId": 9,
"orderListId": -1,
"clientOrderId": "osxN3JXAtJvKvCqGeMWMVR",
"transactTime": 1684804350068,
"price": "0.01000000",
"origQty": "0.000100",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
"newOrderResponse": {
"symbol": "BTCUSDT",
"orderId": 10,
"orderListId": -1,
"clientOrderId": "wOceeeOzNORyLiQfw7jd8S",
"transactTime": 1652928801803,
"price": "0.02000000",
"origQty": "0.040000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"workingTime": 1669277163808,
"fills": [],
"selfTradePreventionMode": "NONE"
}
}

Response when Cancel Order Fails with STOP_ON FAILURE and account has not exceeded unfilled order count:

{
"code": -2022,
"msg": "Order cancel-replace failed.",
"data": {
"cancelResult": "FAILURE",
"newOrderResult": "NOT_ATTEMPTED",
"cancelResponse": {
"code": -2011,
"msg": "Unknown order sent."
},
"newOrderResponse": null
}
}

Response when Cancel Order Succeeds but New Order Placement Fails and account has not exceeded the unfilled order count:

{
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "SUCCESS",
"newOrderResult": "FAILURE",
"cancelResponse": {
"symbol": "BTCUSDT",
"origClientOrderId": "86M8erehfExV8z2RC8Zo8k",
"orderId": 3,
"orderListId": -1,
"clientOrderId": "G1kLo6aDv2KGNTFcjfTSFq",
"price": "0.006123",
"origQty": "10000.000000",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
"newOrderResponse": {
"code": -2010,
"msg": "Order would immediately match and take."
}
}
}

Response when Cancel Order fails with ALLOW_FAILURE and account has not exceeded the unfilled order count:

{
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "FAILURE",
"newOrderResult": "SUCCESS",
"cancelResponse": {
"code": -2011,
"msg": "Unknown order sent."
},
"newOrderResponse": {
"symbol": "BTCUSDT",
"orderId": 11,
"orderListId": -1,
"clientOrderId": "pfojJMg6IMNDKuJqDxvoxN",
"transactTime": 1648540168818
}
}
}

Response when both Cancel Order and New Order Placement fail using cancelReplaceMode=ALLOW_FAILURE and account has not exceeded the unfilled order count:

{
"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."
}
}
}

Response when using orderRateLimitExceededMode=DO_NOTHING and account's unfilled order count has been exceeded:

{
"code": -1015,
"msg": "Too many new orders; current limit is 1 orders per 10 SECOND."
}

Response when using orderRateLimitExceededMode=CANCEL_ONLY and account's unfilled order count has been exceeded:

{
"code": -2021,
"msg": "Order cancel-replace partially failed.",
"data": {
"cancelResult": "SUCCESS",
"newOrderResult": "FAILURE",
"cancelResponse": {
"symbol": "LTCBNB",
"origClientOrderId": "GKt5zzfOxRDSQLveDYCTkc",
"orderId": 64,
"orderListId": -1,
"clientOrderId": "loehOJF3FjoreUBDmv739R",
"transactTime": 1715779007228,
"price": "1.00",
"origQty": "10.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"selfTradePreventionMode": "NONE"
},
"newOrderResponse": {
"code": -1015,
"msg": "Too many new orders; current limit is 1 orders per 10 SECOND."
}
}
}

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Current open orders (USER_DATA)

GET /api/v3/openOrders

Get all open orders on a symbol. Careful when accessing this with no symbol.

Weight: 6 for a single symbol; 80 when the symbol parameter is omitted

Parameters:

NameTypeMandatoryDescription
symbolSTRINGNO
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES
  • If the symbol is not sent, orders for all symbols will be returned in an array.

Data Source: Memory => Database

Response:

[
{
"symbol": "LTCBTC",
"orderId": 1,
"orderListId": -1, // Unless it's part of an order list, value will be -1
"clientOrderId": "myOrder1",
"price": "0.1",
"origQty": "1.0",
"executedQty": "0.0",
"cummulativeQuoteQty": "0.0",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0.0",
"icebergQty": "0.0",
"time": 1499827319559,
"updateTime": 1499827319559,
"isWorking": true,
"origQuoteOrderQty": "0.000000",
"workingTime": 1499827319559,
"selfTradePreventionMode": "NONE"
}
]

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

All orders (USER_DATA)

GET /api/v3/allOrders

Get all account orders; active, canceled, or filled.

Weight: 20

Data Source: Database

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderIdLONGNO
startTimeLONGNO
endTimeLONGNO
limitINTNODefault 500; max 1000.
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Notes:

  • If orderId is set, it will get orders >= that orderId. Otherwise most recent orders are returned.
  • For some historical orders cummulativeQuoteQty will be < 0, meaning the data is not available at this time.
  • If startTime and/or endTime provided, orderId is not required.
  • The time between startTime and endTime can't be longer than 24 hours.

Response:

[
{
"symbol": "LTCBTC",
"orderId": 1,
"orderListId": -1, //Unless it's part of an order list, value will be -1
"clientOrderId": "myOrder1",
"price": "0.1",
"origQty": "1.0",
"executedQty": "0.0",
"cummulativeQuoteQty": "0.0",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0.0",
"icebergQty": "0.0",
"time": 1499827319559,
"updateTime": 1499827319559,
"isWorking": true,
"origQuoteOrderQty": "0.000000",
"workingTime": 1499827319559,
"selfTradePreventionMode": "NONE",
}
]

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Order lists

New OCO - Deprecated (TRADE)

POST /api/v3/order/oco 

Send in a new OCO.

  • Price Restrictions:
    • SELL: Limit Price > Last Price > Stop Price
    • BUY: Limit Price < Last Price < Stop Price
  • Quantity Restrictions:
    • Both legs must have the same quantity.
    • ICEBERG quantities however do not have to be the same
  • OCO adds 2 orders to the unfilled order count, EXCHANGE_MAX_ORDERS filter and the MAX_NUM_ORDERS filter.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
listClientOrderIdSTRINGNOA unique Id for the entire orderList
sideENUMYES
quantityDECIMALYES
limitClientOrderIdSTRINGNOA unique Id for the limit order
priceDECIMALYES
limitStrategyIdLONGNO
limitStrategyTypeINTNOThe value cannot be less than 1000000.
limitIcebergQtyDECIMALNOUsed to make the LIMIT_MAKER leg an iceberg order.
trailingDeltaLONGNO
stopClientOrderIdSTRINGNOA unique Id for the stop loss/stop loss limit leg
stopPriceDECIMALYES
stopStrategyIdLONGNO
stopStrategyTypeINTNOThe value cannot be less than 1000000.
stopLimitPriceDECIMALNOIf provided, stopLimitTimeInForce is required.
stopIcebergQtyDECIMALNOUsed with STOP_LOSS_LIMIT leg to make an iceberg order.
stopLimitTimeInForceENUMNOValid values are GTC/FOK/IOC
newOrderRespTypeENUMNOSet the response JSON.
selfTradePreventionModeENUMNOThe allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes.
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Matching Engine

Response:

{
"orderListId": 0,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "JYVpp3F0f5CAG15DhtrqLp",
"transactionTime": 1563417480525,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 2,
"clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"clientOrderId": "xTXKaGYd4bluPVp78IVRvl"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"orderId": 2,
"orderListId": 0,
"clientOrderId": "Kk7sqHb9J6mJWTMDVW7Vos",
"transactTime": 1563417480525,
"price": "0.000000",
"origQty": "0.624363",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS",
"side": "BUY",
"stopPrice": "0.960664",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"orderListId": 0,
"clientOrderId": "xTXKaGYd4bluPVp78IVRvl",
"transactTime": 1563417480525,
"price": "0.036435",
"origQty": "0.624363",
"executedQty": "0.000000",
"cummulativeQuoteQty": "0.000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"workingTime": 1563417480525,
"selfTradePreventionMode": "NONE"
}
]
}

New Order list - OCO (TRADE)

POST /api/v3/orderList/oco

Send in an one-cancels-the-other (OCO) pair, where activation of one order immediately cancels the other.

  • An OCO has 2 orders called the above order and below order.
  • One of the orders must be a LIMIT_MAKER order and the other must be STOP_LOSS or STOP_LOSS_LIMIT order.
  • Price restrictions:
    • If the OCO is on the SELL side: LIMIT_MAKER price > Last Traded Price > stopPrice
    • If the OCO is on the BUY side: LIMIT_MAKER price < Last Traded Price < stopPrice
  • OCOs add 2 orders to the unfilled order count, EXCHANGE_MAX_ORDERS filter, and the MAX_NUM_ORDERS filter.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYes
listClientOrderIdSTRINGNoArbitrary unique ID among open order lists. 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.
sideENUMYesBUY or SELL
quantityDECIMALYesQuantity for both orders of the order list.
aboveTypeENUMYesSupported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
aboveClientOrderIdSTRINGNoArbitrary unique ID among open orders for the above order. Automatically generated if not sent
aboveIcebergQtyLONGNoNote that this can only be used if aboveTimeInForce is GTC.
abovePriceDECIMALNo
aboveStopPriceDECIMALNoCan be used if aboveType is STOP_LOSS or STOP_LOSS_LIMIT.
Either aboveStopPrice or aboveTrailingDelta or both, must be specified.
aboveTrailingDeltaLONGNoSee Trailing Stop order FAQ.
aboveTimeInForceDECIMALNoRequired if the aboveType is STOP_LOSS_LIMIT.
aboveStrategyIdLONGNoArbitrary numeric value identifying the above order within an order strategy.
aboveStrategyTypeINTNoArbitrary numeric value identifying the above order strategy.
Values smaller than 1000000 are reserved and cannot be used.
belowTypeENUMYesSupported values : STOP_LOSS_LIMIT, STOP_LOSS, LIMIT_MAKER
belowClientOrderIdSTRINGNoArbitrary unique ID among open orders for the below order. Automatically generated if not sent
belowIcebergQtyLONGNoNote that this can only be used if belowTimeInForce is GTC.
belowPriceDECIMALNoCan be used if belowType is STOP_LOSS_LIMIT or LIMIT_MAKER to specify the limit price.
belowStopPriceDECIMALNoCan be used if belowType is STOP_LOSS or STOP_LOSS_LIMIT.
Either belowStopPrice or belowTrailingDelta or both, must be specified.
belowTrailingDeltaLONGNoSee Trailing Stop order FAQ.
belowTimeInForceENUMNoRequired if the belowType is STOP_LOSS_LIMIT.
belowStrategyIdLONGNoArbitrary numeric value identifying the below order within an order strategy.
belowStrategyTypeINTNoArbitrary numeric value identifying the below order strategy.
Values smaller than 1000000 are reserved and cannot be used.
newOrderRespTypeENUMNoSelect response format: ACK, RESULT, FULL
selfTradePreventionModeENUMNoThe allowed enums is dependent on what is configured on the symbol. Supported values: STP Modes
recvWindowLONGNoThe value cannot be greater than 60000.
timestampLONGYes

Data Source: Matching Engine

Response:

Response format for orderReports is selected using the newOrderRespType parameter. The following example is for the RESULT response type. See POST /api/v3/order for more examples.

{
"orderListId": 1,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "lH1YDkuQKWiXVXHPSKYEIp",
"transactionTime": 1710485608839,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 10,
"clientOrderId": "44nZvqpemY7sVYgPYbvPih"
},
{
"symbol": "LTCBTC",
"orderId": 11,
"clientOrderId": "NuMp0nVYnciDiFmVqfpBqK"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"orderId": 10,
"orderListId": 1,
"clientOrderId": "44nZvqpemY7sVYgPYbvPih",
"transactTime": 1710485608839,
"price": "1.00000000",
"origQty": "5.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "SELL",
"stopPrice": "1.00000000",
"workingTime": -1,
"icebergQty": "1.00000000",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 11,
"orderListId": 1,
"clientOrderId": "NuMp0nVYnciDiFmVqfpBqK",
"transactTime": 1710485608839,
"price": "3.00000000",
"origQty": "5.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"workingTime": 1710485608839,
"selfTradePreventionMode": "NONE"
}
]
}

New Order list - OTO (TRADE)

POST /api/v3/orderList/oto

Places an OTO.

  • An OTO (One-Triggers-the-Other) is an order list comprised of 2 orders.
  • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.
  • The second order is called the pending order. It can be any order type except for MARKET orders using parameter quoteOrderQty. The pending order is only placed on the order book when the working order gets fully filled.
  • If either the working order or the pending order is cancelled individually, the other order in the order list will also be canceled or expired.
  • When the order list is placed, if the working order gets immediately fully filled, the placement response will show the working order as FILLED but the pending order will still appear as PENDING_NEW. You need to query the status of the pending order again to see its updated status.
  • OTOs add 2 orders to the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter and MAX_NUM_ORDERS filter.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
listClientOrderIdSTRINGNOArbitrary unique ID among open order lists. 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 workingClientOrderId and the pendingClientOrderId.
newOrderRespTypeENUMNOFormat of the JSON response. Supported values: Order Response Type
selfTradePreventionModeENUMNOThe allowed values are dependent on what is configured on the symbol. Supported values: STP Modes
workingTypeENUMYESSupported values: LIMIT,LIMIT_MAKER
workingSideENUMYESSupported values: Order Side
workingClientOrderIdSTRINGNOArbitrary unique ID among open orders for the working order.
Automatically generated if not sent.
workingPriceDECIMALYES
workingQuantityDECIMALYESSets the quantity for the working order.
workingIcebergQtyDECIMALNOThis can only be used if workingTimeInForce is GTC, or if workingType is LIMIT_MAKER.
workingTimeInForceENUMNOSupported values: Time In Force
workingStrategyIdLONGNOArbitrary numeric value identifying the working order within an order strategy.
workingStrategyTypeINTNOArbitrary numeric value identifying the working order strategy.
Values smaller than 1000000 are reserved and cannot be used.
pendingTypeENUMYESSupported values: Order Types
Note that MARKET orders using quoteOrderQty are not supported.
pendingSideENUMYESSupported values: Order Side
pendingClientOrderIdSTRINGNOArbitrary unique ID among open orders for the pending order.
Automatically generated if not sent.
pendingPriceDECIMALNO
pendingStopPriceDECIMALNO
pendingTrailingDeltaDECIMALNO
pendingQuantityDECIMALYESSets the quantity for the pending order.
pendingIcebergQtyDECIMALNOThis can only be used if pendingTimeInForce is GTC or if pendingType is LIMIT_MAKER.
pendingTimeInForceENUMNOSupported values: Time In Force
pendingStrategyIdLONGNOArbitrary numeric value identifying the pending order within an order strategy.
pendingStrategyTypeINTNOArbitrary numeric value identifying the pending order strategy.
Values smaller than 1000000 are reserved and cannot be used.
recvWindowLONGNOThe value cannot be greater than 60000.
timestampLONGYES

Mandatory parameters based on pendingType or workingType

Depending on the pendingType or workingType, some optional parameters will become mandatory.

TypeAdditional mandatory parametersAdditional information
workingType = LIMITworkingTimeInForce
pendingType = LIMITpendingPrice, pendingTimeInForce
pendingType = STOP_LOSS or TAKE_PROFITpendingStopPrice and/or pendingTrailingDelta
pendingType = STOP_LOSS_LIMIT or TAKE_PROFIT_LIMITpendingPrice, pendingStopPrice and/or pendingTrailingDelta, pendingTimeInForce

Data Source:

Matching Engine

Response:

{
"orderListId": 0,
"contingencyType": "OTO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "yl2ERtcar1o25zcWtqVBTC",
"transactionTime": 1712289389158,
"symbol": "ABCDEF",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 4,
"clientOrderId": "Bq17mn9fP6vyCn75Jw1xya"
},
{
"symbol": "LTCBTC",
"orderId": 5,
"clientOrderId": "arLFo0zGJVDE69cvGBaU0d"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"orderId": 4,
"orderListId": 0,
"clientOrderId": "Bq17mn9fP6vyCn75Jw1xya",
"transactTime": 1712289389158,
"price": "1.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1712289389158,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 5,
"orderListId": 0,
"clientOrderId": "arLFo0zGJVDE69cvGBaU0d",
"transactTime": 1712289389158,
"price": "0.00000000",
"origQty": "5.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "PENDING_NEW",
"timeInForce": "GTC",
"type": "MARKET",
"side": "BUY",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
}
]
}

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

New Order list - OTOCO (TRADE)

POST /api/v3/orderList/otoco

Place an OTOCO.

  • An OTOCO (One-Triggers-One-Cancels-the-Other) is an order list comprised of 3 orders.

  • The first order is called the working order and must be LIMIT or LIMIT_MAKER. Initially, only the working order goes on the order book.

    • The behavior of the working order is the same as the OTO.
  • OTOCO has 2 pending orders (pending above and pending below), forming an OCO pair. The pending orders are only placed on the order book when the working order gets fully filled.

    • The rules of the pending above and pending below follow the same rules as the Order list OCO.
  • OTOCOs add 3 orders against the unfilled order count, EXCHANGE_MAX_NUM_ORDERS filter, and MAX_NUM_ORDERS filter.

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
listClientOrderIdSTRINGNOArbitrary unique ID among open order lists. 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 workingClientOrderId, pendingAboveClientOrderId, and the pendingBelowClientOrderId.
newOrderRespTypeENUMNOFormat of the JSON response. Supported values: Order Response Type
selfTradePreventionModeENUMNOThe allowed values are dependent on what is configured on the symbol. Supported values: STP Modes
workingTypeENUMYESSupported values: LIMIT, LIMIT_MAKER
workingSideENUMYESSupported values: Order side
workingClientOrderIdSTRINGNOArbitrary unique ID among open orders for the working order.
Automatically generated if not sent.
workingPriceDECIMALYES
workingQuantityDECIMALYES
workingIcebergQtyDECIMALNOThis can only be used if workingTimeInForce is GTC.
workingTimeInForceENUMNOSupported values: Time In Force
workingStrategyIdLONGNOArbitrary numeric value identifying the working order within an order strategy.
workingStrategyTypeINTNOArbitrary numeric value identifying the working order strategy.
Values smaller than 1000000 are reserved and cannot be used.
pendingSideENUMYESSupported values: Order side
pendingQuantityDECIMALYES
pendingAboveTypeENUMYESSupported values: LIMIT_MAKER, STOP_LOSS, and STOP_LOSS_LIMIT
pendingAboveClientOrderIdSTRINGNOArbitrary unique ID among open orders for the pending above order.
Automatically generated if not sent.
pendingAbovePriceDECIMALNO
pendingAboveStopPriceDECIMALNO
pendingAboveTrailingDeltaDECIMALNO
pendingAboveIcebergQtyDECIMALNOThis can only be used if pendingAboveTimeInForce is GTC or if pendingAboveType is LIMIT_MAKER.
pendingAboveTimeInForceENUMNO
pendingAboveStrategyIdLONGNOArbitrary numeric value identifying the pending above order within an order strategy.
pendingAboveStrategyTypeINTNOArbitrary numeric value identifying the pending above order strategy.
Values smaller than 1000000 are reserved and cannot be used.
pendingBelowTypeENUMNOSupported values: LIMIT_MAKER, STOP_LOSS, and STOP_LOSS_LIMIT
pendingBelowClientOrderIdSTRINGNOArbitrary unique ID among open orders for the pending below order.
Automatically generated if not sent.
pendingBelowPriceDECIMALNO
pendingBelowStopPriceDECIMALNO
pendingBelowTrailingDeltaDECIMALNO
pendingBelowIcebergQtyDECIMALNOThis can only be used if pendingBelowTimeInForce is GTC, or if pendingBelowType is LIMIT_MAKER.
pendingBelowTimeInForceENUMNOSupported values: Time In Force
pendingBelowStrategyIdLONGNOArbitrary numeric value identifying the pending below order within an order strategy.
pendingBelowStrategyTypeINTNOArbitrary numeric value identifying the pending below order strategy.
Values smaller than 1000000 are reserved and cannot be used.
recvWindowLONGNOThe value cannot be greater than 60000.
timestampLONGYES

Mandatory parameters based on pendingAboveType, pendingBelowType or workingType

Depending on the pendingAboveType/pendingBelowType or workingType, some optional parameters will become mandatory.

TypeAdditional mandatory parametersAdditional information
workingType = LIMITworkingTimeInForce
pendingAboveType= LIMIT_MAKERpendingAbovePrice
pendingAboveType= STOP_LOSSpendingAboveStopPrice and/or pendingAboveTrailingDelta
pendingAboveType=STOP_LOSS_LIMITpendingAbovePrice, pendingAboveStopPrice and/or pendingAboveTrailingDelta, pendingAboveTimeInForce
pendingBelowType= LIMIT_MAKERpendingBelowPrice
pendingBelowType= STOP_LOSSpendingBelowStopPrice and/or pendingBelowTrailingDelta
pendingBelowType=STOP_LOSS_LIMITpendingBelowPrice, pendingBelowStopPrice and/or pendingBelowTrailingDelta, pendingBelowTimeInForce

Data Source:

Matching Engine

Response:

{
"orderListId": 1,
"contingencyType": "OTO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "RumwQpBaDctlUu5jyG5rs0",
"transactionTime": 1712291372842,
"symbol": "ABCDEF",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 6,
"clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK"
},
{
"symbol": "LTCBTC",
"orderId": 7,
"clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4"
},
{
"symbol": "LTCBTC",
"orderId": 8,
"clientOrderId": "r4JMv9cwAYYUwwBZfbussx"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"orderId": 6,
"orderListId": 1,
"clientOrderId": "fM9Y4m23IFJVCQmIrlUmMK",
"transactTime": 1712291372842,
"price": "1.00000000",
"origQty": "1.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "NEW",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "SELL",
"workingTime": 1712291372842,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 7,
"orderListId": 1,
"clientOrderId": "6pcQbFIzTXGZQ1e2MkGDq4",
"transactTime": 1712291372842,
"price": "1.00000000",
"origQty": "5.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "PENDING_NEW",
"timeInForce": "IOC",
"type": "STOP_LOSS_LIMIT",
"side": "BUY",
"stopPrice": "6.00000000",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"orderId": 8,
"orderListId": 1,
"clientOrderId": "r4JMv9cwAYYUwwBZfbussx",
"transactTime": 1712291372842,
"price": "3.00000000",
"origQty": "5.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "PENDING_NEW",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "BUY",
"workingTime": -1,
"selfTradePreventionMode": "NONE"
}
]
}

Note: The payload above does not show all fields that can appear. Please refer to Conditional fields in Order Responses.

Cancel Order list (TRADE)

DELETE /api/v3/orderList 

Cancel an entire Order list

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderListIdLONGNOEither orderListId or listClientOrderId must be provided
listClientOrderIdSTRINGNOEither orderListId or listClientOrderId must be provided
newClientOrderIdSTRINGNOUsed to uniquely identify this cancel. Automatically generated by default
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Notes:

  • Canceling an individual order from an order list will cancel the entire order list.
  • If both orderListId and listClientOrderId are sent, orderListId takes precedence.

Data Source: Matching Engine

Response:

{
"orderListId": 0,
"contingencyType": "OCO",
"listStatusType": "ALL_DONE",
"listOrderStatus": "ALL_DONE",
"listClientOrderId": "C3wyj4WVEktd7u9aVBRXcN",
"transactionTime": 1574040868128,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 2,
"clientOrderId": "pO9ufTiFGg3nw2fOdgeOXa"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"clientOrderId": "TXOvglzXuaubXAaENpaRCB"
}
],
"orderReports": [
{
"symbol": "LTCBTC",
"origClientOrderId": "pO9ufTiFGg3nw2fOdgeOXa",
"orderId": 2,
"orderListId": 0,
"clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
"transactTime": 1688005070874,
"price": "1.00000000",
"origQty": "10.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "STOP_LOSS_LIMIT",
"side": "SELL",
"stopPrice": "1.00000000",
"selfTradePreventionMode": "NONE"
},
{
"symbol": "LTCBTC",
"origClientOrderId": "TXOvglzXuaubXAaENpaRCB",
"orderId": 3,
"orderListId": 0,
"clientOrderId": "unfWT8ig8i0uj6lPuYLez6",
"transactTime": 1688005070874,
"price": "3.00000000",
"origQty": "10.00000000",
"executedQty": "0.00000000",
"cummulativeQuoteQty": "0.00000000",
"status": "CANCELED",
"timeInForce": "GTC",
"type": "LIMIT_MAKER",
"side": "SELL",
"selfTradePreventionMode": "NONE"
}
]
}

Query Order list (USER_DATA)

GET /api/v3/orderList 

Retrieves a specific order list based on provided optional parameters.

Weight: 4

Parameters:

NameTypeMandatoryDescription
orderListIdLONGNOEither orderListId or listClientOrderId must be provided
origClientOrderIdSTRINGNOEither orderListId or listClientOrderId must be provided
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Database

Response:

{
"orderListId": 27,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "h2USkA5YQpaXHPIrkd96xE",
"transactionTime": 1565245656253,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 4,
"clientOrderId": "qD1gy3kc3Gx0rihm9Y3xwS"
},
{
"symbol": "LTCBTC",
"orderId": 5,
"clientOrderId": "ARzZ9I00CPM8i3NhmU9Ega"
}
]
}

Query all Order lists (USER_DATA)

GET /api/v3/allOrderList

Retrieves all order lists based on provided optional parameters.

Note that the time between startTime and endTime can't be longer than 24 hours.

Weight: 20

Parameters:

NameTypeMandatoryDescription
fromIdLONGNOIf supplied, neither startTime or endTime can be provided
startTimeLONGNO
endTimeLONGNO
limitINTNODefault Value: 500; Max Value: 1000
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Database

Response:

[
{
"orderListId": 29,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "amEEAXryFzFwYF1FeRpUoZ",
"transactionTime": 1565245913483,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 4,
"clientOrderId": "oD7aesZqjEGlZrbtRpy5zB"
},
{
"symbol": "LTCBTC",
"orderId": 5,
"clientOrderId": "Jr1h6xirOxgeJOUuYQS7V3"
}
]
},
{
"orderListId": 28,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "hG7hFNxJV6cZy3Ze4AUT4d",
"transactionTime": 1565245913407,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 2,
"clientOrderId": "j6lFOfbmFMRjTYA7rRJ0LP"
},
{
"symbol": "LTCBTC",
"orderId": 3,
"clientOrderId": "z0KCjOdditiLS5ekAFtK81"
}
]
}
]

Query Open Order lists (USER_DATA)

GET /api/v3/openOrderList 

Weight: 6

Parameters:

NameTypeMandatoryDescription
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Database

Response:

[
{
"orderListId": 31,
"contingencyType": "OCO",
"listStatusType": "EXEC_STARTED",
"listOrderStatus": "EXECUTING",
"listClientOrderId": "wuB13fmulKj3YjdqWEcsnp",
"transactionTime": 1565246080644,
"symbol": "LTCBTC",
"orders": [
{
"symbol": "LTCBTC",
"orderId": 4,
"clientOrderId": "r3EH2N76dHfLoSZWIUw1bT"
},
{
"symbol": "LTCBTC",
"orderId": 5,
"clientOrderId": "Cv1SnyPD3qhqpbjpYEHbd2"
}
]
}
]

SOR

New order using SOR (TRADE)

POST /api/v3/sor/order

Places an order using smart order routing (SOR).

Weight: 1

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
sideENUMYES
typeENUMYES
timeInForceENUMNO
quantityDECIMALYES
priceDECIMALNO
newClientOrderIdSTRINGNOA unique id among open orders. Automatically generated if not sent.
Orders with the same newClientOrderID can be accepted only when the previous one is filled, otherwise the order will be rejected.
strategyIdLONGNO
strategyTypeINTNOThe value cannot be less than 1000000.
icebergQtyDECIMALNOUsed with LIMIT to create an iceberg order.
newOrderRespTypeENUMNOSet the response JSON. ACK, RESULT, or FULL. Default to FULL
selfTradePreventionModeENUMNOThe allowed enums is dependent on what is configured on the symbol. The possible supported values are: STP Modes.
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Note: POST /api/v3/sor/order only supports LIMIT and MARKET orders. quoteOrderQty is not supported.

Data Source: Matching Engine

Response:

{
"symbol": "BTCUSDT",
"orderId": 2,
"orderListId": -1,
"clientOrderId": "sBI1KM6nNtOfj5tccZSKly",
"transactTime": 1689149087774,
"price": "31000.00000000",
"origQty": "0.50000000",
"executedQty": "0.50000000",
"cummulativeQuoteQty": "14000.00000000",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"workingTime": 1689149087774,
"fills": [
{
"matchType": "ONE_PARTY_TRADE_REPORT",
"price": "28000.00000000",
"qty": "0.50000000",
"commission": "0.00000000",
"commissionAsset": "BTC",
"tradeId": -1,
"allocId": 0
}
],
"workingFloor": "SOR",
"selfTradePreventionMode": "NONE",
"usedSor": true
}

Test new order using SOR (TRADE)

POST /api/v3/sor/order/test

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:

ConditionRequest Weight
Without computeCommissionRates1
With computeCommissionRates20

Parameters:

In addition to all parameters accepted by POST /api/v3/sor/order, the following optional parameters are also accepted:

NameTypeMandatoryDescription
computeCommissionRatesBOOLEANNODefault: false

Data Source: Memory

Response:

Without computeCommissionRates

{}

With computeCommissionRates

{
"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 commission in BNB.
}
}

Account Endpoints

Account information (USER_DATA)

GET /api/v3/account 

Get current account information.

Weight: 20

Parameters:

NameTypeMandatoryDescription
omitZeroBalancesBOOLEANNOWhen set to true, emits only the non-zero balances of an account.
Default value: false
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Memory => Database

Response:

{
"makerCommission": 15,
"takerCommission": 15,
"buyerCommission": 0,
"sellerCommission": 0,
"commissionRates": {
"maker": "0.00150000",
"taker": "0.00150000",
"buyer": "0.00000000",
"seller": "0.00000000"
},
"canTrade": true,
"canWithdraw": true,
"canDeposit": true,
"brokered": false,
"requireSelfTradePrevention": false,
"preventSor": false,
"updateTime": 123456789,
"accountType": "SPOT",
"balances": [
{
"asset": "BTC",
"free": "4723846.89208129",
"locked": "0.00000000"
},
{
"asset": "LTC",
"free": "4763368.68006011",
"locked": "0.00000000"
}
],
"permissions": [
"SPOT"
],
"uid": 354937868
}

Account trade list (USER_DATA)

GET /api/v3/myTrades 

Get trades for a specific account and symbol.

Weight: 20

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
orderIdLONGNOThis can only be used in combination with symbol.
startTimeLONGNO
endTimeLONGNO
fromIdLONGNOTradeId to fetch from. Default gets most recent trades.
limitINTNODefault 500; max 1000.
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Notes:

  • If fromId is set, it will get trades >= that fromId. Otherwise most recent trades are returned.
  • The time between startTime and endTime can't be longer than 24 hours.
  • These are the supported combinations of all parameters:
    • symbol
    • symbol + orderId
    • symbol + startTime
    • symbol + endTime
    • symbol + fromId
    • symbol + startTime + endTime
    • symbol+ orderId + fromId

Data Source: Memory => Database

Response:

[
{
"symbol": "BNBBTC",
"id": 28457,
"orderId": 100234,
"orderListId": -1,
"price": "4.00000100",
"qty": "12.00000000",
"quoteQty": "48.000012",
"commission": "10.10000000",
"commissionAsset": "BNB",
"time": 1499865549590,
"isBuyer": true,
"isMaker": false,
"isBestMatch": true
}
]

Query Unfilled Order Count (USER_DATA)

GET /api/v3/rateLimit/order

Displays the user's unfilled order count for all intervals.

Weight: 40

Parameters:

NameTypeMandatoryDescription
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Data Source: Memory

Response:

[

{
"rateLimitType": "ORDERS",
"interval": "SECOND",
"intervalNum": 10,
"limit": 50,
"count": 0
},
{
"rateLimitType": "ORDERS",
"interval": "DAY",
"intervalNum": 1,
"limit": 160000,
"count": 0
}
]

Query Prevented Matches (USER_DATA)

GET /api/v3/myPreventedMatches

Displays the list of orders that were expired due to STP.

These are the combinations supported:

  • symbol + preventedMatchId
  • symbol + orderId
  • symbol + orderId + fromPreventedMatchId (limit will default to 500)
  • symbol + orderId + fromPreventedMatchId + limit

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES
preventedMatchIdLONGNO
orderIdLONGNO
fromPreventedMatchIdLONGNO
limitINTNODefault: 500; Max: 1000
recvWindowLONGNOThe value cannot be greater than 60000
timestampLONGYES

Weight:

CaseWeight
If symbol is invalid2
Querying by preventedMatchId2
Querying by orderId20

Data Source:

Database

Response:

[
{
"symbol": "BTCUSDT",
"preventedMatchId": 1,
"takerOrderId": 5,
"makerSymbol": "BTCUSDT",
"makerOrderId": 3,
"tradeGroupId": 1,
"selfTradePreventionMode": "EXPIRE_MAKER",
"price": "1.100000",
"makerPreventedQuantity": "1.300000",
"transactTime": 1669101687094
}
]

Query Allocations (USER_DATA)

GET /api/v3/myAllocations

Retrieves allocations resulting from SOR order placement.

Weight: 20

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYes
startTimeLONGNo
endTimeLONGNo
fromAllocationIdINTNo
limitINTNoDefault 500;Max 1000
orderIdLONGNo
recvWindowLONGNoThe value cannot be greater than 60000.
timestampLONGNo

Supported parameter combinations:

ParametersResponse
symbolallocations from oldest to newest
symbol + startTimeoldest allocations since startTime
symbol + endTimenewest allocations until endTime
symbol + startTime + endTimeallocations within the time range
symbol + fromAllocationIdallocations by allocation ID
symbol + orderIdallocations related to an order starting with oldest
symbol + orderId + fromAllocationIdallocations related to an order by allocation ID

Note: The time between startTime and endTime can't be longer than 24 hours.

Data Source: Database

Response:

[
{
"symbol": "BTCUSDT",
"allocationId": 0,
"allocationType": "SOR",
"orderId": 1,
"orderListId": -1,
"price": "1.00000000",
"qty": "5.00000000",
"quoteQty": "5.00000000",
"commission": "0.00000000",
"commissionAsset": "BTC",
"time": 1687506878118,
"isBuyer": true,
"isMaker": false,
"isAllocator": false
}
]

Query Commission Rates (USER_DATA)

GET /api/v3/account/commission

Get current account commission rates.

Weight: 20

Parameters:

NameTypeMandatoryDescription
symbolSTRINGYES

Data Source: Database

Response:

{
"symbol": "BTCUSDT",
"standardCommission": { //Commission rates on trades from the order.
"maker": "0.00000010",
"taker": "0.00000020",
"buyer": "0.00000030",
"seller": "0.00000040"
},
"taxCommission": { //Tax commission rates for trades from the order.
"maker": "0.00000112",
"taker": "0.00000114",
"buyer": "0.00000118",
"seller": "0.00000116"
},
"discount": { //Discount commission when paying in BNB
"enabledForAccount": true,
"enabledForSymbol": true,
"discountAsset": "BNB",
"discount": "0.75000000" //Standard commission is reduced by this rate when paying commission in BNB.
}
}

User data stream endpoints

Specifics on how user data streams work can be found here.

Start user data stream (USER_STREAM)

POST /api/v3/userDataStream

Start a new user data stream. The stream will close after 60 minutes unless a keepalive is sent.

Weight: 2

Parameters: NONE

Data Source: Memory

Response:

{
"listenKey": "pqia91ma19a5s61cv6a81va65sdf19v8a65a1a5s61cv6a81va65sdf19v8a65a1"
}

Keepalive user data stream (USER_STREAM)

PUT /api/v3/userDataStream

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 30 minutes.

Weight: 2

Data Source: Memory

Parameters:

NameTypeMandatoryDescription
listenKeySTRINGYES

Response:

{}

Close user data stream (USER_STREAM)

DELETE /api/v3/userDataStream

Close out a user data stream.

Weight: 2

Parameters:

NameTypeMandatoryDescription
listenKeySTRINGYES

Data Source: Memory

Response:

{}