Official Python SDK for Odds-API.io - Real-time sports betting odds from 250+ bookmakers.
- β‘ Fast & Reliable - Built on requests and aiohttp for both sync and async workflows
- π 20+ Sports - Basketball, football, tennis, baseball, and more
- π 250+ Bookmakers - Comprehensive odds coverage from major sportsbooks worldwide
- π° Arbitrage Detection - Find risk-free betting opportunities across bookmakers
- π Value Bets - Identify positive expected value betting opportunities
- π΄ Live Events - Real-time in-play event tracking and odds
- π Advanced Search - Search events, participants, and leagues
- β¨ Type Hints - Full type annotations for better IDE support
- π Modern Python - Supports Python 3.8+
pip install odds-api-ioGet your free API key here β
Sign up at odds-api.io to get started. Free tier includes:
- 5,000 requests/hour
- Access to all endpoints
- No credit card required
Full API documentation is available at docs.odds-api.io
from odds_api import OddsAPIClient
# Initialize the client
client = OddsAPIClient(api_key="your_api_key_here")
# Get available sports
sports = client.get_sports()
print(f"Found {len(sports)} sports")
# Get upcoming NBA events
events = client.get_events(sport="basketball", league="usa-nba")
# Search for specific games
lakers_games = client.search_events(query="Lakers")
# Get live basketball events
live = client.get_live_events(sport="basketball")
# Find arbitrage opportunities
arb_bets = client.get_arbitrage_bets(
bookmakers="pinnacle,bet365",
limit=10,
include_event_details=True
)
# Close the client when done
client.close()import asyncio
from odds_api import AsyncOddsAPIClient
async def main():
# Use async context manager
async with AsyncOddsAPIClient(api_key="your_api_key_here") as client:
# Get sports
sports = await client.get_sports()
# Get upcoming events
events = await client.get_events(sport="basketball", league="usa-nba")
# Find value bets
value_bets = await client.get_value_bets(
bookmaker="pinnacle",
include_event_details=True
)
print(f"Found {len(value_bets)} value betting opportunities")
# Run async code
asyncio.run(main())# Sync
with OddsAPIClient(api_key="your_api_key") as client:
sports = client.get_sports()
# Async
async with AsyncOddsAPIClient(api_key="your_api_key") as client:
sports = await client.get_sports()Check out the examples/ directory for more detailed examples:
- basic_usage.py - Getting started with the SDK
- async_example.py - Using the async client
- arbitrage_finder.py - Finding arbitrage opportunities
- value_bets.py - Identifying value bets
- odds_tracking.py - Tracking odds movements
| Method | Description | Docs |
|---|---|---|
get_sports() |
Get all available sports | π |
get_leagues(sport) |
Get leagues for a sport | π |
| Method | Description | Docs |
|---|---|---|
get_events(sport, **filters) |
Get events with filters | π |
get_event_by_id(event_id) |
Get specific event details | π |
get_live_events(sport) |
Get currently live events | π |
search_events(query) |
Search events by keyword | π |
| Method | Description | Docs |
|---|---|---|
get_event_odds(event_id, bookmakers) |
Get odds for an event | π |
get_odds_movement(event_id, bookmaker, market) |
Track odds changes | π |
get_odds_for_multiple_events(event_ids, bookmakers) |
Get odds for multiple events | π |
get_updated_odds_since_timestamp(since, bookmaker, sport) |
Get recently updated odds | π |
| Method | Description | Docs |
|---|---|---|
get_participants(sport, search=None) |
Get teams/players | π |
get_participant_by_id(participant_id) |
Get participant by ID | π |
| Method | Description | Docs |
|---|---|---|
get_bookmakers() |
Get all available bookmakers | π |
get_selected_bookmakers() |
Get your selected bookmakers | π |
select_bookmakers(bookmakers) |
Select bookmakers | π |
clear_selected_bookmakers() |
Clear selection | π |
| Method | Description | Docs |
|---|---|---|
get_arbitrage_bets(bookmakers, **options) |
Find arbitrage opportunities | π |
get_value_bets(bookmaker, **options) |
Find value bets | π |
The SDK provides custom exceptions for different error scenarios:
from odds_api import (
OddsAPIClient,
OddsAPIError,
InvalidAPIKeyError,
RateLimitExceededError,
NotFoundError,
ValidationError
)
client = OddsAPIClient(api_key="your_api_key")
try:
events = client.get_events(sport="basketball")
except InvalidAPIKeyError:
print("Your API key is invalid")
except RateLimitExceededError:
print("Rate limit exceeded - wait before retrying")
except NotFoundError:
print("Resource not found")
except ValidationError as e:
print(f"Invalid parameters: {e}")
except OddsAPIError as e:
print(f"API error: {e}")- β Most Comprehensive Coverage - 250+ bookmakers across 20+ sports
- β Near-Zero Latency - Real-time odds updates with minimal delay
- β Direct Bet Links - Deep links directly to bookmaker bet slips
- β Value Bet Detection - Automatically calculated expected value
- β Historical Data - Access to past odds and results
- β Developer Friendly - Clean API design with excellent documentation
Build powerful betting tools and analytics:
- π― Arbitrage betting platforms
- π Odds comparison sites
- π Value betting calculators
- π€ Automated betting systems
- π Sports analytics dashboards
- π Odds movement alerts
- Limited to 2 bookmakers selected at once
- 5,000 requests per hour (shared across all plans)
- No WebSocket access on free tier
- Python 3.8 or higher
requestslibrary (for sync client)aiohttplibrary (for async client)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Website: odds-api.io
- Documentation: docs.odds-api.io
- API Key: Get your API key
- GitHub: github.com/odds-api-io/odds-api-python
- Issues: Report a bug
- PyPI: pypi.org/project/odds-api-io
Need help? We're here for you:
- π§ Email: hello@odds-api.io
- π Documentation: docs.odds-api.io
- π Issues: GitHub Issues
- β±οΈ Response Time: Usually within 24 hours
Built with β€οΈ by the Odds-API.io team