Why Polling Efficiency Matters
TheRundown usage is not just about request count. The cost of a polling loop depends on:- how many sportsbooks you request
- how many markets you include
- whether you pull full event payloads or only deltas
- how often you refresh
Shrink Every Response First
Before you tune polling intervals, make each response smaller.market_ids: biggest control for response sizeaffiliate_ids: only request the books you actually surfacemain_line=true: skip alternate lines if your product only shows the primary market- event-specific endpoints: if you only care about a handful of games, do not fetch the full slate
hide_closed_markets=1: useful during market discovery to avoid off-board clutter
Delta Endpoint Bootstrap Flow
The pattern for using delta endpoints has three stages:1. Fetch the full snapshot
Start by loading the complete event data for the sport and date you need. This gives you the initial state and the first delta cursor.meta.delta_last_id — save this value.
2. Poll with the delta cursor
On each subsequent poll, pass your saved cursor to the delta endpoint. It returns only events or prices that changed since that cursor. Event delta — returns full event objects that changed:3. Merge updates into local state
Each delta response contains the full updated object — replace (do not partially merge) the corresponding entry in your local cache. Update your cursor to the newdelta_last_id from the response.
Choosing Between Event and Market Delta
| Endpoint | Returns | Best for |
|---|---|---|
GET /api/v2/delta | Full event objects (scores, status, markets) | Apps that need score updates alongside odds |
GET /api/v2/markets/delta | Individual price changes only | Odds-focused apps where you track scores separately |
Recommended Polling Intervals
Match your polling frequency to your use case. Faster polling uses more data points and increases the chance of hitting your burst limit if you parallelize heavily.| Use Case | Interval | Endpoint | Notes |
|---|---|---|---|
| Live odds screen | 5–10s | Market delta | Fastest practical interval for REST |
| Pre-match odds monitoring | 30–60s | Market delta | Lines move slowly before game time |
| Live scores | 15–30s | Event delta | Score updates come in bursts during play |
| Pre-match schedules | 5 min | Full events | Schedules rarely change close to game time |
| Historical/closing lines | On demand | Openers/closing | Fetch once after the event starts or ends |
For sub-second updates, use the WebSocket endpoint on a WebSocket-enabled tier instead of polling. WebSocket traffic does not increment the HTTP request counter, but pushed messages are still metered as data points.
Cache TTL Recommendations
Not all data changes at the same rate. Cache aggressively for reference data and use shorter TTLs for live data.| Data Type | Recommended TTL | Endpoint |
|---|---|---|
| Sports list | 24 hours | GET /api/v2/sports |
| Affiliates list | 24 hours | GET /api/v2/affiliates |
| Teams | 6 hours | GET /api/v2/sports/{id}/teams |
| Market definitions | 6 hours | GET /api/v2/markets |
| Events (pre-match) | 5 minutes | GET /api/v2/sports/{id}/events/{date} |
| Events (live) | Use delta | GET /api/v2/delta or GET /api/v2/markets/delta |
| Market prices | Real-time | Delta endpoint or WebSocket |
Staleness Guards
Your delta cursor can become stale if you stop polling for an extended period. When this happens, the delta endpoint may return an error or skip events that changed while you were away. How to detect stale data:- Track the
updated_attimestamp on your cached events. If the newest update is more than 5 minutes old during a live game window, your data may be stale. - If a delta response returns an empty result but you know games are in progress, your cursor may have expired.
- If you receive an error response from the delta endpoint, re-bootstrap from a full snapshot.
- Discard your current delta cursor
- Fetch a fresh full snapshot from the events endpoint
- Extract the new
delta_last_idand resume polling
Watch Your Usage Headers
Every production poller should log and monitor:X-DatapointsX-Datapoints-UsedX-Datapoints-RemainingX-Datapoints-ResetX-Rate-Limit
Code Example: Python Polling Loop
This example fetches a full snapshot, then polls the market delta endpoint with automatic fallback to a full refresh when the cursor goes stale.WebSocket vs. Polling Decision Guide
| Factor | REST Polling | WebSocket |
|---|---|---|
| Latency | 5–60s depending on interval | Sub-second |
| Usage impact | Consumes data points and counts toward HTTP burst limit | Consumes data points but does not increment the HTTP request counter |
| Implementation complexity | Simple HTTP requests | Requires connection management, reconnection logic |
| Data freshness | As fresh as your poll interval | Real-time |
| Reliability | Each request is independent | Must handle disconnects and reconnections |
| Best for | Pre-match monitoring, low-frequency updates | Live odds screens, real-time dashboards |
Many production applications use both: WebSocket for live windows, with delta polling as a fallback when the socket disconnects or for lower-tier keys that do not have WebSocket access. See the Building an Odds Screen guide for this pattern in practice.