Overview
The Odds-API.io provides several endpoints for fetching odds data from multiple bookmakers. This guide covers best practices and common patterns for working with odds data.For an up-to-date list of all supported bookmakers, visit odds-api.io/sportsbooks.
Which endpoint should I use?
Basic Workflow
- Get available sports - Fetch the list of supported sports
- Get leagues - Retrieve leagues for your chosen sport
- Get events - Find upcoming or live events
- Get odds - Fetch odds from selected bookmakers
- Stay up to date - Open the WebSocket feed to keep those odds current
Recommended pattern: snapshot, then stream
Fetch your initial odds with/v3/odds/multi, then open a WebSocket connection to keep them current. Every updated message carries the full current market set for that event and bookmaker, so overwrite what you have stored. Never merge, or suspended markets will never disappear from your data.
Use Python’s
websockets library, not websocket-client. Only websockets negotiates the permessage-deflate compression the feed requires. See Compression (Required).Fetching Odds for a Single Event
Use the/v3/odds endpoint to get odds for a specific event. Add markets to keep only the market names you need; it’s optional and defaults to every market:
Fetching Odds for Multiple Events
For better efficiency, use the/v3/odds/multi endpoint to fetch odds for up to 10 events in a single request. Add markets to keep only the market names you need and cut payload size; it’s optional and defaults to every market.
Understanding the Odds Response
The odds response includes multiple markets for each bookmaker:Market Types
Pass these exact names to themarkets parameter. Matching is case-insensitive.
- ML - Match result (Home, Draw, Away)
- Spread - Handicap betting with fractional lines, including Asian lines
- Totals - Total goals/points over or under a line
- Both Teams To Score - Yes/No markets
- Correct Score - Exact score predictions
- Double Chance, Draw No Bet, European Handicap, Half Time / Full Time
- Team Total Home / Team Total Away - Totals for one side only
- Half-time and period variants use a suffix: ML HT, Totals HT, Spread HT, Totals 2H
- Baseball’s first five innings are named in full rather than with the HT suffix: First 5 Innings ML, First 5 Innings Spread, First 5 Innings Totals, First 5 Innings Team Total Home / First 5 Innings Team Total Away
- And many more…
markets filter.
Match the full market name. There is no market called “Match Winner” (use ML), and no bare “Over/Under” or “Asian Handicap”, though longer names such as Goals Over/Under and Alternative Corners do exist. Call
GET /v3/markets?sport=<sport> to see the exact names served for a sport.Finding the Best Odds
Here’s an example of comparing odds across bookmakers to find the best value:Keeping Odds Fresh
For real-time applications, open a WebSocket connection instead of polling. It pushes odds changes the moment they happen, negotiates compression, and replays anything you missed on reconnect.WebSocket Odds API
Full connection details, filters, message shapes, and reconnection with replay.
Polling with /v3/odds/updated
If you can’t hold a persistent connection, /v3/odds/updated is the fallback. It returns odds that changed since a given timestamp.
Each response includes two headers:
Make your first call with
since set to 20 seconds ago, then use X-Next-Since for every call after that:
Caching Strategies
To optimize performance and reduce API calls:- Cache event lists for 5-10 minutes
- Cache pre-match odds for 30-60 seconds
- For live odds, stream instead of caching - a WebSocket connection is cheaper than any poll interval
Best Practices
Stream, Don't Poll
Stream, Don't Poll
For anything live, open a WebSocket connection instead of polling. It’s real-time, compressed, replays missed messages on reconnect, and doesn’t count against your hourly request limit.
Select Only Needed Bookmakers
Select Only Needed Bookmakers
Select only the most relevant bookmakers for your users. See the full list of supported bookmakers.
Use Multi-Odds for the Initial Snapshot
Use Multi-Odds for the Initial Snapshot
Batch requests using
/v3/odds/multi to load your initial snapshot (up to 10 events, counts as 1 request), then stream changes over WebSocket instead of polling.Implement Proper Caching
Implement Proper Caching
Cache odds data appropriately based on match status (pre-match vs live).
Handle Missing Data Gracefully
Handle Missing Data Gracefully
Not all bookmakers offer all markets. Always check if data exists before accessing it.
Next Steps
WebSockets
Get real-time odds updates via WebSocket connections
Value Bets
Learn how to identify profitable betting opportunities