GET
/api/v1/depth
获取深度数据
获取指定交易对的深度数据(订单簿)。此接口返回当前各个价格档位的买卖订单(买单和卖单)。此接口为公开接口,无需认证。
什么是订单簿?
订单簿显示交易对的所有待成交买卖订单。买单(bids)代表买入订单,卖单(asks)代表卖出订单。深度数据帮助交易者了解市场流动性和潜在的价格变动。
请求参数
响应示例
{
"code": 200,
"msg": "success",
"data": {
"symbol": "BTCUSDT",
"bids": [
[
"45000.50",
"1.2345"
],
[
"45000.00",
"2.3456"
],
[
"44999.50",
"0.5678"
]
],
"asks": [
[
"45001.00",
"0.9876"
],
[
"45001.50",
"1.2345"
],
[
"45002.00",
"2.3456"
]
],
"timestamp": 1701234567000
}
}
代码示例
// cURL example
curl -X GET "https://ziario.pro/api/v1/depth?symbol=BTCUSDT&exchange=binance&limit=20"
// PHP example
$response = file_get_contents("https://ziario.pro/api/v1/depth?symbol=BTCUSDT&exchange=binance&limit=20");
$data = json_decode($response, true);
print_r($data);
// JavaScript example
fetch("https://ziario.pro/api/v1/depth?symbol=BTCUSDT&exchange=binance&limit=20")
.then(response => response.json())
.then(data => {
console.log("Bids:", data.data.bids);
console.log("Asks:", data.data.asks);
})
.catch(error => console.error("Error:", error));
// Python example
import requests
response = requests.get("https://ziario.pro/api/v1/depth", params={
"symbol": "BTCUSDT",
"exchange": "binance",
"limit": 20
})
print(response.json())