Order Book (Depth)
Description
Get limited order book information.
HTTP Request
GET /fapi/v1/depth
Weight
| limit | Weight |
|---|---|
| 5, 10, 20, 50 | 2 |
| 100 | 5 |
| 500 | 10 |
| 1000 | 20 |
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | YES | Trading pair |
| limit | INT | NO | Default 500; Valid values: [5, 10, 20, 50, 100, 500, 1000] |
Response Example
{
"lastUpdateId": 1027024,
"E": 1589436922972, // Message time
"T": 1589436922959, // Matching engine time
"bids": [ // Bids
[
"4.00000000", // Price
"431.00000000" // Quantity
]
],
"asks": [ // Asks
[
"4.00000200", // Price
"12.00000000" // Quantity
]
]
}
Code Examples
cURL
curl -s "https://api-sepolia.ztdx.io/fapi/v1/depth?symbol=BTCUSDT&limit=5"
Python
import requests
base_url = "https://api.ztdx.io"
response = requests.get(f"{base_url}/fapi/v1/depth", params={"symbol": "BTCUSDT", "limit": 5})
data = response.json()
print(f"Last Update ID: {data['lastUpdateId']}")
print("Bids:")
for price, qty in data['bids']:
print(f" {price} x {qty}")
print("Asks:")
for price, qty in data['asks']:
print(f" {price} x {qty}")