tickstreamdocs

DOCS

Level 2 depth

Subscribe to the full order book with order-flow fields. Available on Realtime + L2 and Pro.

The book channel streams the full Level 2 order book — every price level with aggregated size on both sides — plus derived order-flow fields. It's included on the Realtime + L2 and Pro plans.

Subscribe to the book

Pass an optional depth (number of price levels per side, default 10, max 50):

from tickstream import Stream

stream = Stream("sk_live_…")
for book in stream.book("ES", depth=10):
    best_bid = book.bids[0]
    print(best_bid.price, best_bid.size, book.imbalance)
{ "op": "subscribe", "channel": "book", "symbols": ["ES"], "depth": 10 }

The book message

{
  "type": "book",
  "symbol": "ES",
  "bids": [[5283.00, 42], [5282.75, 88]],
  "asks": [[5283.25, 37], [5283.50, 61]],
  "imbalance": 0.18,
  "ts": 1749556800
}
FieldTypeDescription
bids[price, size][]Bid levels, best first, descending price.
asks[price, size][]Ask levels, best first, ascending price.
imbalancenumberTop-of-book order-flow imbalance in [-1, 1] (positive = bid-heavy).
tsintegerExchange timestamp in Unix seconds.

Snapshots & updates

The first message after subscribing is a full snapshot at your requested depth. Subsequent messages are full snapshots too (not deltas), so you never have to reconstruct the book yourself — just read the latest frame.

plan

Subscribing to book on a plan without L2 returns a 403. See pricing or auth errors.