Market Data endpoints
Order book
GET /api/v3/depth
Weight: Adjusted based on the limit:
Limit | Request Weight |
---|---|
1-100 | 5 |
101-500 | 25 |
501-1000 | 50 |
1001-5000 | 250 |
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default: 100; Maximum: 5000. If limit > 5000, only 5000 entries will be returned. |
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:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default: 500; Maximum: 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:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
limit | INT | NO | Default: 500; Maximum: 1000. |
fromId | LONG | NO | TradeId 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: 4
Parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
fromId | LONG | NO | ID to get aggregate trades from INCLUSIVE. |
startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE. |
endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE. |
limit | INT | NO | Default: 500; Maximum: 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:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | |
startTime | LONG | NO | |
endTime | LONG | NO | |
timeZone | STRING | NO | Default: 0 (UTC) |
limit | INT | NO | Default: 500; Maximum: 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
andendTime
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
- Hours and minutes (e.g.
- If
timeZone
provided, kline intervals are interpreted in that timezone instead of UTC. - Note that
startTime
andendTime
are always interpreted in UTC, regardless oftimeZone
.
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:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES | |
interval | ENUM | YES | See klines |
startTime | LONG | NO | |
endTime | LONG | NO | |
timeZone | STRING | NO | Default: 0 (UTC) |
limit | INT | NO | Default: 500; Maximum: 1000. |
- If
startTime
andendTime
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
- Hours and minutes (e.g.
- If
timeZone
provided, kline intervals are interpreted in that timezone instead of UTC. - Note that
startTime
andendTime
are always interpreted in UTC, regardless oftimeZone
.
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:
Name | Type | Mandatory | Description |
---|---|---|---|
symbol | STRING | YES |
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
}
]