Step 1: Fetch the Sports List
Start by loading the list of available sports. This endpoint is public and does not require authentication.| Sport | ID |
|---|---|
| NFL | 2 |
| MLB | 3 |
| NBA | 4 |
| NCAAB | 5 |
| NHL | 6 |
Step 2: Fetch Events for a Sport and Date
Once the user selects a sport, fetch events for that sport on a given date. Includemarket_ids=1,2,3 for moneyline, spread, and total. Use main_line=true to get only the primary line for each market.
Always pass
offset=300 to align the date boundary with US Central Time. Without this, games that tip off late at night may show up under the next day’s date.Step 3: Discover Available Markets
Not every sport or event has the same markets. Before building your odds columns, check which markets actually have data. There are two ways to do this:By sport and date
Returns all markets with active pricing for a sport on a given date, keyed by sport ID. Usehide_closed_markets=1 to exclude markets that have been taken off the board.
By event ID
Returns only the markets available for a specific event. Useful when building a detail view for a single game.event_id value returned by GET /api/v2/sports/{sportID}/events/{date} when calling per-event V2 endpoints.
Each market object includes:
| Field | Description |
|---|---|
id | Numeric market ID — pass these as market_ids when fetching event odds |
name | Human-readable name (e.g., “Moneyline”, “Player Points”) |
proposition | true for player prop markets, false for game-level markets |
period_id | Period this market applies to (full game, first half, etc.) |
live_variant_id | If set, the corresponding live/in-play market ID |
description | Longer description of the market |
Step 4: Parse Markets for Display
Each event contains amarkets array. Index it by market_id to pull moneyline (1), spread (2), and total (3) for each sportsbook.
Step 5: Connect WebSocket for Real-Time Updates
Once your initial data is loaded, connect the V2 Markets WebSocket to receive live price updates. Filter by sport to reduce traffic.Step 6: Handle Price Updates in the UI
When a WebSocket message arrives, merge the individual price update into your local state. Each message contains a single price change — find the matching event, market, participant, and affiliate, then update the price.Tips for Production
Use delta endpoints for efficient polling as a fallback
Use delta endpoints for efficient polling as a fallback
If the WebSocket disconnects, use
GET /api/v2/delta to fetch event deltas or GET /api/v2/markets/delta to fetch market price deltas since your last request. This is much more efficient than refetching the full event list.Animate price changes
Animate price changes
When a price moves, briefly highlight the cell green (price improved for the bettor) or red (price worsened). This visual cue helps users notice live movement.
Handle the 0.0001 sentinel value
Handle the 0.0001 sentinel value
Always check for
0.0001 before displaying a price. Show “Off Board” or “N/A” instead. See Sentinel Values for details.Cache the sports and affiliates lists
Cache the sports and affiliates lists
The sports and affiliates endpoints return reference data that rarely changes. Cache these responses and refresh once per day to avoid unnecessary API calls.
Filter aggressively
Filter aggressively
Use
affiliate_ids, market_ids, and main_line=true to reduce payload size. Only request the data your UI actually displays.Next Steps
WebSocket Streaming
Deep dive into WebSocket configuration
Efficient Polling
Delta endpoints and cache strategies for when WebSocket isn’t available
Player Props
Add player prop markets to your screen
Historical Odds
Track line movement over time
Data Model
How events, markets, lines, and prices relate
Sportsbook IDs
Full list of affiliate IDs