Data Structure
Each orderbook snapshot contains bid and ask arrays as[price, size] tuples:
| Field | Type | Description |
|---|---|---|
ts | integer | Unix timestamp in milliseconds |
asset_id | string | Token ID for the outcome |
market_id | string | Market ID |
outcome_index | integer | Outcome position (0 = first outcome) |
bids | array | Buy orders as [price, size] tuples, sorted by price descending |
asks | array | Sell orders as [price, size] tuples, sorted by price ascending |
Query Orderbooks
GET
Query orderbook snapshots with filters.
At least one of
market_id or asset_id is required.Query Parameters
Filter by market ID
Filter by asset/token ID
Filter by outcome name (e.g., “Yes”, “No”)
Start timestamp in milliseconds (inclusive)
End timestamp in milliseconds (inclusive)
Results per page (1-1000)
Timestamp cursor for pagination
Examples
Get orderbook history for a market:Get Latest Orderbook
GET
Get the most recent orderbook snapshot for a market or asset.
At least one filter parameter is required.
Query Parameters
Filter by market ID
Filter by asset/token ID
Filter by outcome name
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
GET
Convenience endpoint to get orderbook snapshots for a specific market.
Path Parameters
Market ID
Query Parameters
Filter by outcome name
Start timestamp in milliseconds
End timestamp in milliseconds
Results per page (1-1000)
Timestamp cursor for pagination
Example
Pagination Example
For large historical queries, use cursor-based pagination: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.