Data Structure
Each orderbook snapshot contains bid and ask arrays as[price, size] tuples:
Query Orderbooks
Query orderbook snapshots with filters. Results are ordered by timestamp descending (most recent first).
At least one of
market_id or asset_id is required.Query Parameters
string
Filter by market ID.
string
Filter by asset/token ID.
string
Filter by outcome. Accepts
yes, no, 0, or 1.integer
Start timestamp in milliseconds (inclusive).
integer
End timestamp in milliseconds (inclusive).
integer
default:"100"
Results per page (1–1000).
integer
Timestamp cursor for pagination. Returns rows with
ts < cursor_ts.Examples
Get orderbook history for a market:Get Latest Orderbook
Get the most recent orderbook snapshot for a market or asset.
At least one filter parameter (
market_id, asset_id, or outcome) is required.Query Parameters
string
Filter by market ID.
string
Filter by asset/token ID.
string
Filter by outcome. Accepts
yes, no, 0, or 1.Examples
Get latest orderbook for a market:This endpoint has a 500ms cache TTL for near real-time data access.
Get Orderbooks by Market ID
Convenience endpoint to get orderbook snapshots for a specific market. Results are ordered by timestamp descending.
Path Parameters
string
required
Market ID.
Query Parameters
string
Filter by outcome. Accepts
yes, no, 0, or 1.integer
Start timestamp in milliseconds (inclusive).
integer
End timestamp in milliseconds (inclusive).
integer
default:"100"
Results per page (1–1000).
integer
Timestamp cursor for pagination. Returns rows with
ts < cursor_ts.Example
Pagination Example
For large historical queries, use cursor-based pagination. Start with a very highcursor_ts value and follow the next cursor:
Common Use Cases
Backtesting
Fetch historical orderbooks within a time range to simulate trading strategies.
Spread Analysis
Calculate bid-ask spreads over time to analyze market liquidity.
Event Studies
Study how orderbooks change around major news events.
Market Making
Analyze historical depth to calibrate market making parameters.