GET /api/v1/depth

Get Order Book Depth

Get order book depth data for a specific trading pair. This endpoint returns the current buy and sell orders (bids and asks) at various price levels. This is a public endpoint and does not require authentication.

What is Order Book?

The order book shows all pending buy and sell orders for a trading pair. Bids represent buy orders, and asks represent sell orders. The depth data helps traders understand market liquidity and potential price movements.

Request Parameters

Response Example

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

Code Example

// 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())

Related Documentation