Client messages
Subscribe
Subscribe to orderbook updates. You can subscribe to specific markets by slug, condition ID, or token ID, or subscribe to the full firehose (full data stream) with"*".
- Firehose (all markets)
- By slug
- By condition ID
- By token ID
How identifiers are detected:
"*"→ firehose (all active markets)- Starts with
0x→ condition ID - All digits and longer than 10 characters → CLOB token ID
- Everything else → slug
Unsubscribe
Remove all subscriptions on this connection.markets to remove only a subset. Identifiers use the same slug, condition ID, and token ID resolver as subscribe.
Resync (PN1)
Request a new ordered integrity anchor without reconnecting:integrity=1. Every requested market must already be subscribed. Omit markets or pass an empty array to resync the full current subscription. After resyncing, expect a new ordered anchor and a matching completion marker. If that cannot complete, the socket fails closed with a terminal integrity error. If an anchor for any requested token is already in flight, the server returns resync_in_progress; keep that token gated and retry after the supplied delay.
Ping
Client-initiated keepalive.{"type": "pong"}
Server messages
subscribed
Acknowledgment after a successful subscribe. The response format differs slightly depending on whether you subscribed to specific markets or the firehose.
- Firehose
- Specific markets
- PN1 integrity
snapshot_batch
Orderbook snapshots delivered in batches after subscribing. For small subscriptions (under 100 tokens), snapshots arrive in a single batch almost instantly. For large subscriptions (firehose), snapshots are streamed in batches of 50 every 200ms to avoid flooding your connection.
PN1 integrity connections instead receive one standalone book_snapshot anchor for every subscribed token, including empty books.
Once all snapshots have been delivered, you’ll receive a completion marker:
book_snapshot
Full orderbook state for a token. Sent inside snapshot_batch messages after subscribing, and occasionally in batch updates when the upstream source sends a full refresh.
Each
PriceLevel is {"price": "0.55", "size": "1000.00"} where price is the probability (0 to 1) and size is the number of shares.
batch
Batched updates delivered every 250ms. Contains all changes for your subscribed tokens since the last batch. Multiple updates to the same price level within a batch window are coalesced into a single net change, reducing bandwidth without losing accuracy.
With PN1, integrity metadata belongs to each depth update—not to this outer batch—because sequence continuity is per token.
Each update in the
updates array is one of:
price_change
A market’s price level changed due to an order placement, cancellation, or fill. Each entry in assets describes a single level change. size is the absolute new size at that level — "0" means the level was removed. You can apply price_change events directly to your local book to maintain tick-accurate state without polling.
Each entry in
assets:
In PN1 mode, a depth-mutating
price_change is split into token-scoped messages with exactly one assets row so each row has one unambiguous sequence and checksum. The default stream keeps the existing multi-row shape.book_update
Incremental change to the orderbook. Apply these to the last snapshot.
book_snapshot
Occasional full orderbook replacement (sent when the upstream source resets).
Same schema as the initial book_snapshot message above.
last_trade_price
A trade executed on Polymarket. Delivered for every fill, not coalesced — each trade in a batch window is its own event.
last_trade_price does not mutate bid/ask depth, so it never advances PN1 sequence and never carries an integrity checksum.
Need sub-millisecond granularity? Enterprise plans can be configured with a dedicated stream that delivers every individual orderbook event without batching, including per-event timestamps. Contact us if your strategy requires tick-by-tick data.

