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
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
SSE is best when you need immediate reaction and have a long-running process (trading bot on a server, monitoring script on your laptop).
Webhooks are best for serverless architectures or when you want events to trigger specific actions without maintaining an open connection.
Polling is simplest but adds latency. Use the
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.