What this page covers
- Server-Sent Events (SSE) for real-time market monitoring
- Webhooks for push notifications to your server
- Event types: price shifts, whale alerts, analysis completions
- Complete receiver implementations in Python, cURL, and JavaScript
- When to use SSE vs webhooks vs polling
Why real-time data?
Prediction market prices move in response to news, large trades, and liquidity shifts. A market that was fairly priced an hour ago may have a 5% edge now. Real-time monitoring lets you:- React to price shifts before the market corrects
- Detect whale trades that signal informed positioning
- Get notified when a deep analysis completes
- Build event-driven trading bots instead of polling on an interval
Server-Sent Events (SSE)
SSE is a persistent HTTP connection where the server pushes events to the client. No WebSocket setup needed — it works over standard HTTP.Connect to the stream
Event types
| Event | Description | Key fields |
|---|---|---|
price_shift | Market price moved significantly | market_id, platform, old_yes, new_yes, change_pct |
whale_alert | Large trade detected | market_id, platform, side, flow, price |
analysis_complete | Deep analysis finished | analysis_id, market_id, platform |
Filter events
Pass only the event types you want via theevents parameter:
Webhooks
Webhooks push events to your server via HTTP POST. Unlike SSE (which requires an open connection), webhooks fire asynchronously — your server receives a POST request for each event.Register a webhook
Manage webhooks
Webhook payload
Each webhook POST sends a JSON body with the event data:Verify webhook signatures
Each webhook includes anx-webhook-signature header with an HMAC-SHA256 signature of the body using your secret:
Complete webhook receiver (FastAPI)
SSE vs webhooks vs polling
| Approach | Latency | Infrastructure | Use case |
|---|---|---|---|
| SSE streaming | Real-time | Open connection | Desktop bot, monitoring dashboard |
| Webhooks | Near real-time | Public endpoint | Server-side trading bot, cloud functions |
Polling (GET /markets) | Depends on interval | None | Simple scripts, cron jobs |
GET /v1/markets endpoint on an interval (e.g., every 60 seconds) for low-frequency monitoring.
Complete event-driven trading bot
Combining SSE with the trading API:What’s next
Build a trading bot
Full trading bot tutorial with screening and analysis.
SSE API reference
Full endpoint documentation for the SSE stream.
Webhooks API reference
Full endpoint documentation for webhook management.