Skip to main content

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

ParameterTypeRequiredDescription
instrumentIdstringYes*Instrument ID (e.g., BINANCE:BTC/USDT)
venuestringNo*Venue identifier
symbolstringNo*Trading pair symbol
depthintegerNoOrder book depth (default: 10, max: 100)

*Either instrumentId OR both venue and symbol are required.

Response

Returns the order book data.

FieldTypeDescription
instrumentIdstringInstrument identifier
venuestringVenue identifier
symbolstringTrading pair symbol
bidsarrayBuy orders (sorted by price descending)
asksarraySell orders (sorted by price ascending)
timestampintegerOrder 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 CodeErrorDescription
400Invalid requestMissing or invalid instrument parameters
401UnauthorizedInvalid or expired access token
404Not foundInstrument 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 depth parameter controls how many levels to return