Skip to main content

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?

If your app runs continuously, WebSocket is the right default. Reach for polling only when a persistent connection isn’t an option.

Basic Workflow

  1. Get available sports - Fetch the list of supported sports
  2. Get leagues - Retrieve leagues for your chosen sport
  3. Get events - Find upcoming or live events
  4. Get odds - Fetch odds from selected bookmakers
  5. Stay up to date - Open the WebSocket feed to keep those odds current
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.
The multi-odds endpoint counts as only 1 API request regardless of how many events you fetch (up to 10). Use it for your initial snapshot, then stream changes over WebSocket instead of calling it again on a timer.

Understanding the Odds Response

The odds response includes multiple markets for each bookmaker:

Market Types

Pass these exact names to the markets 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…
Availability varies by sport. Tennis uses Totals (Games) and Spread (Games), basketball adds Player Props. To see exactly which markets an event carries, request it without a 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:
Passing now - 90 on every poll re-downloads the same 90 seconds of odds each time. Always carry forward X-Next-Since instead. Each call also returns the full market set for every changed event, so add markets to keep responses small.

Caching Strategies

To optimize performance and reduce API calls:
  1. Cache event lists for 5-10 minutes
  2. Cache pre-match odds for 30-60 seconds
  3. For live odds, stream instead of caching - a WebSocket connection is cheaper than any poll interval

Best Practices

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 the most relevant bookmakers for your users. See the full list of supported bookmakers.
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.
Cache odds data appropriately based on match status (pre-match vs live).
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