Skip to main content
GET
Get order book events
Use this endpoint to pull the L2 events for one or more outcome tokens. Each event is either a book snapshot (full bids and asks) or a price_change delta (a single side, price, and sizeAfter). Provide at least one of marketId, conditionId, or tokenId. The API combines values in the same parameter with OR. It combines different parameters with AND.

Reconstructing a book

To rebuild a token’s book at a target time:
  1. For one tokenId, fetch the latest book at or before the target time with eventType=book, to=<target_time>, order=desc, and limit=1.
  2. Start a new query from that event’s cursor. Set eventType=price_change, keep to=<target_time>, and use order=asc.
  3. Page through the results with the same filters and order, passing each nextCursor into the next request.
  4. Apply BUY deltas to bids and SELL deltas to asks. A sizeAfter value of 0 removes the price level. Any other value replaces its size.
You need a book snapshot to start reconstruction. If none exists at or before the target time, the later price changes are not enough to rebuild the book.
Events use Unix milliseconds. Other API endpoints use seconds. Subtract timestamp from indexedTimestamp to estimate total indexing latency, including WebSocket delivery, queueing, batching, and insertion. Historical rows created before timestamp_ingested do not have a reliable original ingestion timestamp.
Cursors are opaque. Keep the filters and order unchanged while paging through one result set. When reconstructing a book, you can use the snapshot cursor to start the new ascending price_change query described above.

Authorizations

Authorization
string
header
required

Paste your Orbscan API key here. The Bearer prefix is added automatically.

Query Parameters

marketId
string[]

Market IDs to include. You can provide up to 20 as comma-separated values, repeated parameters, or both.

Maximum array length: 20
Example:
conditionId
string[]

Condition IDs to include. You can provide up to 20 as comma-separated values, repeated parameters, or both. Input is case-insensitive.

Maximum array length: 20
Example:
tokenId
string[]

Outcome token IDs to include. You can provide up to 50 as comma-separated values, repeated parameters, or both.

Maximum array length: 50
Example:
eventType
enum<string>[]

Event types to include: book, price_change, or both. The endpoint returns both when you omit this parameter.

Maximum array length: 2
Available options:
book,
price_change
from
integer<int64>

Inclusive lower bound on source time, Unix milliseconds.

Example:

1788852000000

to
integer<int64>

Inclusive upper bound on source time, Unix milliseconds. Must be greater than or equal to from.

order
enum<string>
default:asc

Sort by source time. Defaults to asc. Case-insensitive.

Available options:
asc,
desc
limit
integer
default:1000

Page size. Defaults to 1,000. Values outside 1 to 10,000 return 400.

Required range: 1 <= x <= 10000
cursor
string

Opaque cursor from the last item's cursor or the response's nextCursor. Keep the filters and order unchanged while paging one result set. To reconstruct a book, you can use a snapshot cursor to start a new ascending price_change query.

Response

Successful response

message
string
Example:

"OK"

status_code
string
Example:

"1"

data
object