Connection
Authentication
Send an auth message immediately after connecting:Subscribing
After authentication, subscribe to markets:| Field | Type | Required | Description |
|---|---|---|---|
parsec_id | string | Yes | Market identifier ({exchange}:{market_id}) |
outcome | string | No | yes or no (default: yes) |
depth | number | No | Price levels per side, 1–100 (default: 50) |
Unsubscribing
Resync
Request a fresh snapshot if data becomes stale:Server Messages
Orderbook
Activity (Trades & Fills)
Trades and fills are sent astype: "activity" with a kind field:
Heartbeat
Error
Resync Required
Sent when you’ve fallen behind on updates:Slow Reader
Warning that you’re consuming messages too slowly:Book State
| State | Description |
|---|---|
fresh | Data is current and reliable |
stale | No recent updates received |
needs_refresh | Send a Resync message to get fresh data |
Feed State
| State | Description |
|---|---|
healthy | Connected and receiving data normally |
degraded | Partial connectivity or delayed data |
disconnected | No connection to exchange |
Sequence Numbers
Useserver_seq to detect gaps. If you receive a sequence number more than 1 higher than the previous, send a Resync request to recover missed updates.
Error Codes
| Code | Type | Description |
|---|---|---|
| 1001 | auth_required | Authentication required |
| 1002 | auth_invalid | Invalid API key |
| 2001 | invalid_market | Invalid message format or market ID |
| 2002 | market_not_found | Market does not exist |
| 2003 | exchange_unavailable | Exchange is unavailable |
| 2005 | invalid_outcome | Invalid outcome value |
| 3001 | rate_limited | Subscribe rate limit exceeded |
| 3002 | max_subscriptions | Max subscriptions reached |
Limits
- Max 100 subscriptions per connection
- Subscribe rate limit: 3 requests per second
- Authentication timeout: 15 seconds
Supported Exchanges
| Exchange | Orderbook | Trades | Fills |
|---|---|---|---|
| Polymarket | Yes | Yes | Yes |
| Limitless | Yes | Yes | No |
| Kalshi | Yes | Yes | Yes |
| Opinion | No | No | No |
| Predict.fun | No | No | No |