Fetching Events with Odds
The primary endpoint for odds data is:market_ids parameter to specify which market types to include. The three core markets are:
Always include
offset=300 to align the date boundary with US Central Time. Without it, games starting late at night may appear under the wrong date. The offset is in minutes (300 = 5 hours).Understanding the Response Structure
The V2 response follows a nested hierarchy:score.event_status to identify live games, score.display_clock and score.game_period for the on-screen state, and score.updated_at to judge freshness. Some live score metadata, especially venue_name and venue_location, may be empty strings until the upstream feed provides them.
Filtering by Sportsbook
Use theaffiliate_ids parameter to limit results to specific sportsbooks. This reduces payload size and focuses on the books you care about.
See Sportsbook IDs for the full list.
Main Lines vs. Alternates
By default, the API returns both main lines and alternate lines. Alternate lines are additional spread/total values offered by sportsbooks (e.g., -2.5, -3.0, -3.5, -4.0 for a spread market). To fetch only the primary line for each market, addmain_line=true:
main_line=true is set, each participant will have at most one line object per market, and the is_main_line field on each price will be true. This is recommended for odds screens where you only need the consensus line.
Handling the 0.0001 Sentinel Value
A price value of0.0001 means the line is off the board — the sportsbook has temporarily removed it. This commonly happens when:
- A key injury is being evaluated
- The book is recalculating after sharp action
- The market is approaching game time suspension
Full Working Example
Here is a complete example that fetches NBA odds, filters to DraftKings and FanDuel, and prints a formatted table:Next Steps
Building an Odds Screen
Turn this data into a full UI
WebSocket Streaming
Get real-time updates instead of polling
Efficient Polling
Delta endpoints, cache TTLs, and polling intervals
Data Model
How events, markets, lines, and prices relate
Historical Odds
Track line movement over time
Market IDs Reference
All available market types