Skip to main content
GET
/
orderbooks
/
stocks
/
api
/
order-books
/
{orderBookId}
/
snapshot
curl -X GET "https://api.trusset.org/orderbooks/stocks/api/order-books/ob_abc123/snapshot?levels=10" \
  -H "x-api-key: trusset_{instanceRef}_{secret}"
{
  "success": true,
  "data": {
    "orderBookId": "ob_abc123",
    "bids": [
      { "price": "99500000000000000000", "quantity": "5000000000000000000" },
      { "price": "99000000000000000000", "quantity": "12000000000000000000" }
    ],
    "asks": [
      { "price": "100500000000000000000", "quantity": "3000000000000000000" },
      { "price": "101000000000000000000", "quantity": "8000000000000000000" }
    ]
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:30:00.000Z",
    "instanceId": "inst_abc"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.trusset.org/llms.txt

Use this file to discover all available pages before exploring further.

Returns a snapshot of the current order book depth, showing aggregated bid and ask levels. Use this to display market depth or calculate spread.

Authentication

Requires an instance API key with the trading service enabled.

Path Parameters

orderBookId
string
required
The order book identifier.

Query Parameters

levels
integer
Number of price levels to return per side. Default 20, maximum 100.
curl -X GET "https://api.trusset.org/orderbooks/stocks/api/order-books/ob_abc123/snapshot?levels=10" \
  -H "x-api-key: trusset_{instanceRef}_{secret}"
{
  "success": true,
  "data": {
    "orderBookId": "ob_abc123",
    "bids": [
      { "price": "99500000000000000000", "quantity": "5000000000000000000" },
      { "price": "99000000000000000000", "quantity": "12000000000000000000" }
    ],
    "asks": [
      { "price": "100500000000000000000", "quantity": "3000000000000000000" },
      { "price": "101000000000000000000", "quantity": "8000000000000000000" }
    ]
  },
  "metadata": {
    "requestId": "550e8400-e29b-41d4-a716-446655440000",
    "timestamp": "2025-01-15T10:30:00.000Z",
    "instanceId": "inst_abc"
  }
}