Skip to main content

Order Book (Depth)

Description

Get limited order book information.

HTTP Request

GET /fapi/v1/depth

Weight

limitWeight
5, 10, 20, 502
1005
50010
100020

Request Parameters

NameTypeRequiredDescription
symbolSTRINGYESTrading pair
limitINTNODefault 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}")