Get Order Book
Get the order book for a specific instrument.
Endpoint
GET /api/v3/market/orderBook/get
Description
Retrieves the current order book (bids and asks) for a specific trading instrument.
Authentication
Requires Bearer token authentication.
Authorization: Bearer {access_token}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
instrumentId | string | Yes* | Instrument ID (e.g., BINANCE:BTC/USDT) |
venue | string | No* | Venue identifier |
symbol | string | No* | Trading pair symbol |
depth | integer | No | Order book depth (default: 10, max: 100) |
*Either instrumentId OR both venue and symbol are required.
Response
Returns the order book data.
| Field | Type | Description |
|---|---|---|
instrumentId | string | Instrument identifier |
venue | string | Venue identifier |
symbol | string | Trading pair symbol |
bids | array | Buy orders (sorted by price descending) |
asks | array | Sell orders (sorted by price ascending) |
timestamp | integer | Order book timestamp (milliseconds) |
Bid/Ask Entry
Each entry in bids and asks is an array with:
[0]- Price (string)[1]- Quantity (string)
Usage
import requests
headers = {"Authorization": f"Bearer {access_token}"}
# Using instrumentId
response = requests.get(
"https://cadenza-api-uat.algo724.com/api/v3/market/orderBook/get",
headers=headers,
params={"instrumentId": "BINANCE:BTC/USDT", "depth": 10}
)
order_book = response.json()["data"]
print(f"Best bid: {order_book['bids'][0]}")
print(f"Best ask: {order_book['asks'][0]}")
# Using venue + symbol
response = requests.get(
"https://cadenza-api-uat.algo724.com/api/v3/market/orderBook/get",
headers=headers,
params={"venue": "BINANCE", "symbol": "BTC/USDT", "depth": 5}
)
curl "https://cadenza-api-uat.algo724.com/api/v3/market/orderBook/get?instrumentId=BINANCE:BTC/USDT&depth=10" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Example Response
{
"data": {
"instrumentId": "BINANCE:BTC/USDT",
"venue": "BINANCE",
"symbol": "BTC/USDT",
"bids": [
["50000.00", "1.5"],
["49999.50", "2.3"],
["49999.00", "0.8"],
["49998.50", "3.1"],
["49998.00", "1.2"]
],
"asks": [
["50000.50", "1.2"],
["50001.00", "2.0"],
["50001.50", "0.5"],
["50002.00", "1.8"],
["50002.50", "2.5"]
],
"timestamp": 1703052635110
},
"success": true,
"errno": 0,
"error": null
}
Error Responses
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid request | Missing or invalid instrument parameters |
| 401 | Unauthorized | Invalid or expired access token |
| 404 | Not found | Instrument not found |
Notes
- Bids are sorted from highest to lowest price (best bid first)
- Asks are sorted from lowest to highest price (best ask first)
- The spread is
asks[0][0] - bids[0][0] - For real-time order book updates, use the WebSocket API
- The
depthparameter controls how many levels to return