Skip to main content

Depth

Get a snapshot of the order book (bids and asks) for a symbol on a given exchange.

HTTP

MethodGET
Endpoint/trade/api/v2/depth

Request Parameters

ParameterTypeMandatoryDescription
exchangestringYesSee Exchange Identifiers.
symbolstringYesBASE/QUOTE, e.g. BTC/INR, BTC/USDT.

Example

import requests

headers, path = sign_request("GET", "/trade/api/v2/depth",
params={"exchange": "coinswitchx", "symbol": "btc/inr"})
response = requests.get(BASE_URL + path, headers=headers)
print(response.json())

Response

{
"data": {
"symbol": "DOGE/INR",
"timestamp": 1686514361972,
"bids": [
["5.82", "4350"]
],
"asks": [
["5.8664", "1238"]
]
}
}

Response Parameters

FieldTypeDescription
symbolstringSymbol echoed back, e.g. "DOGE/INR".
timestampintegerSnapshot time (Unix milliseconds).
bidsarraySorted descending. Each entry is [price (string), quantity (string)].
asksarraySorted ascending. Each entry is [price (string), quantity (string)].

For real-time depth updates, use the Order Book WebSocket.