Fetch historical orderbook snapshots for a single market stream. This route is for stored historical orderbooks, not the live websocket feed. The response shape depends on venue: Polymarket returns Polymarket orderbook snapshots keyed by token_id, while Kalshi returns Kalshi orderbook snapshots keyed by market_id with separate yes and no books.
Venue selector. Required. Supported values: polymarket or kalshi.
"polymarket"
Required when venue=polymarket. Polymarket token ID whose historical orderbook snapshots should be returned. Missing or empty values are rejected for Polymarket requests.
"21742633143463906290569050155826241533067272736897614950488156847949938836455"
Required when venue=kalshi. Kalshi market ID whose historical orderbook snapshots should be returned. Missing or empty values are rejected for Kalshi requests.
"KXBTC-25-T100000"
Range start. Accepts Unix seconds, Unix milliseconds, or an RFC 3339 timestamp. If omitted, the earliest stored snapshot for the requested token_id or market_id is used.
"2026-01-01T00:00:00"
Range end. Accepts Unix seconds, Unix milliseconds, or an RFC 3339 timestamp. If omitted, the latest stored snapshot for the requested token_id or market_id is used.
"1735776000000"
Sort order for returned snapshots. Supported values: ASC or DESC.
"ASC"
Maximum snapshots to return. Must be greater than 0. Capped at 25000.
500
Pagination offset. Must be 0 or greater.
0
Optional time bucket used to downsample snapshots. Format is a positive integer plus optional unit: seconds by default, or explicit s, m, h, d. Examples: 30, 30s, 5m, 1h, 1d. The effective bucket is clamped to between 1 second and 1 day.
"5m"
Optional target point count used only when bucket is omitted. An automatic bucket size is derived from the requested time range, and points is capped at 25000.
200
Historical orderbook snapshots