odds-api-io 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- odds_api_io-1.0.0/LICENSE +21 -0
- odds_api_io-1.0.0/PKG-INFO +313 -0
- odds_api_io-1.0.0/README.md +277 -0
- odds_api_io-1.0.0/odds_api/__init__.py +27 -0
- odds_api_io-1.0.0/odds_api/async_client.py +502 -0
- odds_api_io-1.0.0/odds_api/client.py +495 -0
- odds_api_io-1.0.0/odds_api/constants.py +42 -0
- odds_api_io-1.0.0/odds_api/exceptions.py +31 -0
- odds_api_io-1.0.0/odds_api/py.typed +2 -0
- odds_api_io-1.0.0/odds_api_io.egg-info/PKG-INFO +313 -0
- odds_api_io-1.0.0/odds_api_io.egg-info/SOURCES.txt +14 -0
- odds_api_io-1.0.0/odds_api_io.egg-info/dependency_links.txt +1 -0
- odds_api_io-1.0.0/odds_api_io.egg-info/requires.txt +9 -0
- odds_api_io-1.0.0/odds_api_io.egg-info/top_level.txt +1 -0
- odds_api_io-1.0.0/pyproject.toml +76 -0
- odds_api_io-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Odds-API.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: odds-api-io
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official Python SDK for Odds-API.io - Real-time sports betting odds from 250+ bookmakers
|
|
5
|
+
Author-email: "Odds-API.io" <hello@odds-api.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://odds-api.io
|
|
8
|
+
Project-URL: Documentation, https://docs.odds-api.io
|
|
9
|
+
Project-URL: Repository, https://github.com/odds-api-io/odds-api-python
|
|
10
|
+
Project-URL: Issues, https://github.com/odds-api-io/odds-api-python/issues
|
|
11
|
+
Keywords: odds,sports,betting,api,odds-api,arbitrage,value-bets,bookmakers,sportsbook
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: requests>=2.25.0
|
|
28
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
32
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# Odds-API.io Python SDK
|
|
38
|
+
|
|
39
|
+
[](https://pypi.org/project/odds-api-io/)
|
|
40
|
+
[](https://pypi.org/project/odds-api-io/)
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
[](https://docs.odds-api.io)
|
|
43
|
+
|
|
44
|
+
Official Python SDK for [**Odds-API.io**](https://odds-api.io) - Real-time sports betting odds from 250+ bookmakers.
|
|
45
|
+
|
|
46
|
+
## 🚀 Features
|
|
47
|
+
|
|
48
|
+
- ⚡ **Fast & Reliable** - Built on requests and aiohttp for both sync and async workflows
|
|
49
|
+
- 🏀 **20+ Sports** - Basketball, football, tennis, baseball, and more
|
|
50
|
+
- 📊 **250+ Bookmakers** - Comprehensive odds coverage from major sportsbooks worldwide
|
|
51
|
+
- 💰 **Arbitrage Detection** - Find risk-free betting opportunities across bookmakers
|
|
52
|
+
- 📈 **Value Bets** - Identify positive expected value betting opportunities
|
|
53
|
+
- 🔴 **Live Events** - Real-time in-play event tracking and odds
|
|
54
|
+
- 🔍 **Advanced Search** - Search events, participants, and leagues
|
|
55
|
+
- ✨ **Type Hints** - Full type annotations for better IDE support
|
|
56
|
+
- 🐍 **Modern Python** - Supports Python 3.8+
|
|
57
|
+
|
|
58
|
+
## 📦 Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install odds-api-io
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 🔑 Get Your API Key
|
|
65
|
+
|
|
66
|
+
**[Get your free API key here →](https://odds-api.io/#pricing)**
|
|
67
|
+
|
|
68
|
+
Sign up at [**odds-api.io**](https://odds-api.io) to get started. Free tier includes:
|
|
69
|
+
- 5,000 requests/hour
|
|
70
|
+
- Access to all endpoints
|
|
71
|
+
- No credit card required
|
|
72
|
+
|
|
73
|
+
## 📚 Documentation
|
|
74
|
+
|
|
75
|
+
Full API documentation is available at [**docs.odds-api.io**](https://docs.odds-api.io)
|
|
76
|
+
|
|
77
|
+
## 🏃 Quick Start
|
|
78
|
+
|
|
79
|
+
### Synchronous Client
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from odds_api import OddsAPIClient
|
|
83
|
+
|
|
84
|
+
# Initialize the client
|
|
85
|
+
client = OddsAPIClient(api_key="your_api_key_here")
|
|
86
|
+
|
|
87
|
+
# Get available sports
|
|
88
|
+
sports = client.get_sports()
|
|
89
|
+
print(f"Found {len(sports)} sports")
|
|
90
|
+
|
|
91
|
+
# Get upcoming NBA events
|
|
92
|
+
events = client.get_events(sport="basketball", league="usa-nba")
|
|
93
|
+
|
|
94
|
+
# Search for specific games
|
|
95
|
+
lakers_games = client.search_events(query="Lakers")
|
|
96
|
+
|
|
97
|
+
# Get live basketball events
|
|
98
|
+
live = client.get_live_events(sport="basketball")
|
|
99
|
+
|
|
100
|
+
# Find arbitrage opportunities
|
|
101
|
+
arb_bets = client.get_arbitrage_bets(
|
|
102
|
+
bookmakers="pinnacle,bet365",
|
|
103
|
+
limit=10,
|
|
104
|
+
include_event_details=True
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
# Close the client when done
|
|
108
|
+
client.close()
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Asynchronous Client
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import asyncio
|
|
115
|
+
from odds_api import AsyncOddsAPIClient
|
|
116
|
+
|
|
117
|
+
async def main():
|
|
118
|
+
# Use async context manager
|
|
119
|
+
async with AsyncOddsAPIClient(api_key="your_api_key_here") as client:
|
|
120
|
+
# Get sports
|
|
121
|
+
sports = await client.get_sports()
|
|
122
|
+
|
|
123
|
+
# Get upcoming events
|
|
124
|
+
events = await client.get_events(sport="basketball", league="usa-nba")
|
|
125
|
+
|
|
126
|
+
# Find value bets
|
|
127
|
+
value_bets = await client.get_value_bets(
|
|
128
|
+
bookmaker="pinnacle",
|
|
129
|
+
include_event_details=True
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
print(f"Found {len(value_bets)} value betting opportunities")
|
|
133
|
+
|
|
134
|
+
# Run async code
|
|
135
|
+
asyncio.run(main())
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Context Manager (Recommended)
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
# Sync
|
|
142
|
+
with OddsAPIClient(api_key="your_api_key") as client:
|
|
143
|
+
sports = client.get_sports()
|
|
144
|
+
|
|
145
|
+
# Async
|
|
146
|
+
async with AsyncOddsAPIClient(api_key="your_api_key") as client:
|
|
147
|
+
sports = await client.get_sports()
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 📖 Examples
|
|
151
|
+
|
|
152
|
+
Check out the [`examples/`](examples/) directory for more detailed examples:
|
|
153
|
+
|
|
154
|
+
- **[basic_usage.py](examples/basic_usage.py)** - Getting started with the SDK
|
|
155
|
+
- **[async_example.py](examples/async_example.py)** - Using the async client
|
|
156
|
+
- **[arbitrage_finder.py](examples/arbitrage_finder.py)** - Finding arbitrage opportunities
|
|
157
|
+
- **[value_bets.py](examples/value_bets.py)** - Identifying value bets
|
|
158
|
+
- **[odds_tracking.py](examples/odds_tracking.py)** - Tracking odds movements
|
|
159
|
+
|
|
160
|
+
## 🔧 API Reference
|
|
161
|
+
|
|
162
|
+
### Sports & Leagues
|
|
163
|
+
|
|
164
|
+
| Method | Description | Docs |
|
|
165
|
+
|--------|-------------|------|
|
|
166
|
+
| `get_sports()` | Get all available sports | [📖](https://docs.odds-api.io/api-reference/sports/get-sports) |
|
|
167
|
+
| `get_leagues(sport)` | Get leagues for a sport | [📖](https://docs.odds-api.io/api-reference/leagues/get-leagues) |
|
|
168
|
+
|
|
169
|
+
### Events
|
|
170
|
+
|
|
171
|
+
| Method | Description | Docs |
|
|
172
|
+
|--------|-------------|------|
|
|
173
|
+
| `get_events(sport, **filters)` | Get events with filters | [📖](https://docs.odds-api.io/api-reference/events/get-events) |
|
|
174
|
+
| `get_event_by_id(event_id)` | Get specific event details | [📖](https://docs.odds-api.io/api-reference/events/get-event-by-id) |
|
|
175
|
+
| `get_live_events(sport)` | Get currently live events | [📖](https://docs.odds-api.io/api-reference/events/get-live-events) |
|
|
176
|
+
| `search_events(query)` | Search events by keyword | [📖](https://docs.odds-api.io/api-reference/events/search-events) |
|
|
177
|
+
|
|
178
|
+
### Odds
|
|
179
|
+
|
|
180
|
+
| Method | Description | Docs |
|
|
181
|
+
|--------|-------------|------|
|
|
182
|
+
| `get_event_odds(event_id, bookmakers)` | Get odds for an event | [📖](https://docs.odds-api.io/api-reference/odds/get-event-odds) |
|
|
183
|
+
| `get_odds_movement(event_id, bookmaker, market)` | Track odds changes | [📖](https://docs.odds-api.io/api-reference/odds/get-odds-movements) |
|
|
184
|
+
| `get_odds_for_multiple_events(event_ids, bookmakers)` | Get odds for multiple events | [📖](https://docs.odds-api.io/api-reference/odds/get-odds-for-multiple-events) |
|
|
185
|
+
| `get_updated_odds_since_timestamp(since, bookmaker, sport)` | Get recently updated odds | [📖](https://docs.odds-api.io/api-reference/odds/get-updated-event-odds-since-a-given-timestamp) |
|
|
186
|
+
|
|
187
|
+
### Participants
|
|
188
|
+
|
|
189
|
+
| Method | Description | Docs |
|
|
190
|
+
|--------|-------------|------|
|
|
191
|
+
| `get_participants(sport, search=None)` | Get teams/players | [📖](https://docs.odds-api.io/api-reference/participants/get-participants) |
|
|
192
|
+
| `get_participant_by_id(participant_id)` | Get participant by ID | [📖](https://docs.odds-api.io/api-reference/participants/get-participant-by-id) |
|
|
193
|
+
|
|
194
|
+
### Bookmakers
|
|
195
|
+
|
|
196
|
+
| Method | Description | Docs |
|
|
197
|
+
|--------|-------------|------|
|
|
198
|
+
| `get_bookmakers()` | Get all available bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/get-bookmakers) |
|
|
199
|
+
| `get_selected_bookmakers()` | Get your selected bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/get-selected-bookmakers) |
|
|
200
|
+
| `select_bookmakers(bookmakers)` | Select bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/select-bookmakers) |
|
|
201
|
+
| `clear_selected_bookmakers()` | Clear selection | [📖](https://docs.odds-api.io/api-reference/bookmakers/clear-selected-bookmakers) |
|
|
202
|
+
|
|
203
|
+
### Betting Analysis
|
|
204
|
+
|
|
205
|
+
| Method | Description | Docs |
|
|
206
|
+
|--------|-------------|------|
|
|
207
|
+
| `get_arbitrage_bets(bookmakers, **options)` | Find arbitrage opportunities | [📖](https://docs.odds-api.io/api-reference/arbitrage-bets/get-arbitrage-betting-opportunities) |
|
|
208
|
+
| `get_value_bets(bookmaker, **options)` | Find value bets | [📖](https://docs.odds-api.io/api-reference/value-bets/get-value-bets) |
|
|
209
|
+
|
|
210
|
+
## ⚠️ Error Handling
|
|
211
|
+
|
|
212
|
+
The SDK provides custom exceptions for different error scenarios:
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
from odds_api import (
|
|
216
|
+
OddsAPIClient,
|
|
217
|
+
OddsAPIError,
|
|
218
|
+
InvalidAPIKeyError,
|
|
219
|
+
RateLimitExceededError,
|
|
220
|
+
NotFoundError,
|
|
221
|
+
ValidationError
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
client = OddsAPIClient(api_key="your_api_key")
|
|
225
|
+
|
|
226
|
+
try:
|
|
227
|
+
events = client.get_events(sport="basketball")
|
|
228
|
+
except InvalidAPIKeyError:
|
|
229
|
+
print("Your API key is invalid")
|
|
230
|
+
except RateLimitExceededError:
|
|
231
|
+
print("Rate limit exceeded - wait before retrying")
|
|
232
|
+
except NotFoundError:
|
|
233
|
+
print("Resource not found")
|
|
234
|
+
except ValidationError as e:
|
|
235
|
+
print(f"Invalid parameters: {e}")
|
|
236
|
+
except OddsAPIError as e:
|
|
237
|
+
print(f"API error: {e}")
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## 🌟 Why Odds-API.io?
|
|
241
|
+
|
|
242
|
+
- **✅ Most Comprehensive Coverage** - 250+ bookmakers across 20+ sports
|
|
243
|
+
- **✅ Near-Zero Latency** - Real-time odds updates with minimal delay
|
|
244
|
+
- **✅ Direct Bet Links** - Deep links directly to bookmaker bet slips
|
|
245
|
+
- **✅ Value Bet Detection** - Automatically calculated expected value
|
|
246
|
+
- **✅ Historical Data** - Access to past odds and results
|
|
247
|
+
- **✅ Developer Friendly** - Clean API design with excellent documentation
|
|
248
|
+
|
|
249
|
+
## 💡 Use Cases
|
|
250
|
+
|
|
251
|
+
Build powerful betting tools and analytics:
|
|
252
|
+
- 🎯 Arbitrage betting platforms
|
|
253
|
+
- 📊 Odds comparison sites
|
|
254
|
+
- 📈 Value betting calculators
|
|
255
|
+
- 🤖 Automated betting systems
|
|
256
|
+
- 📉 Sports analytics dashboards
|
|
257
|
+
- 🔔 Odds movement alerts
|
|
258
|
+
|
|
259
|
+
## 🆓 Free Tier Limitations
|
|
260
|
+
|
|
261
|
+
- Limited to 2 bookmakers selected at once
|
|
262
|
+
- 5,000 requests per hour (shared across all plans)
|
|
263
|
+
- No WebSocket access on free tier
|
|
264
|
+
|
|
265
|
+
[**Upgrade for more features →**](https://odds-api.io/#pricing)
|
|
266
|
+
|
|
267
|
+
## 📋 Requirements
|
|
268
|
+
|
|
269
|
+
- Python 3.8 or higher
|
|
270
|
+
- `requests` library (for sync client)
|
|
271
|
+
- `aiohttp` library (for async client)
|
|
272
|
+
|
|
273
|
+
## 🤝 Contributing
|
|
274
|
+
|
|
275
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
276
|
+
|
|
277
|
+
1. Fork the repository
|
|
278
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
279
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
280
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
281
|
+
5. Open a Pull Request
|
|
282
|
+
|
|
283
|
+
## 📝 License
|
|
284
|
+
|
|
285
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
286
|
+
|
|
287
|
+
## 🔗 Links
|
|
288
|
+
|
|
289
|
+
- **Website**: [odds-api.io](https://odds-api.io)
|
|
290
|
+
- **Documentation**: [docs.odds-api.io](https://docs.odds-api.io)
|
|
291
|
+
- **API Key**: [Get your API key](https://odds-api.io/#pricing)
|
|
292
|
+
- **GitHub**: [github.com/odds-api-io/odds-api-python](https://github.com/odds-api-io/odds-api-python)
|
|
293
|
+
- **Issues**: [Report a bug](https://github.com/odds-api-io/odds-api-python/issues)
|
|
294
|
+
- **PyPI**: [pypi.org/project/odds-api-io](https://pypi.org/project/odds-api-io/)
|
|
295
|
+
|
|
296
|
+
## 💬 Support
|
|
297
|
+
|
|
298
|
+
Need help? We're here for you:
|
|
299
|
+
|
|
300
|
+
- 📧 **Email**: hello@odds-api.io
|
|
301
|
+
- 📚 **Documentation**: [docs.odds-api.io](https://docs.odds-api.io)
|
|
302
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/odds-api-io/odds-api-python/issues)
|
|
303
|
+
- ⏱️ **Response Time**: Usually within 24 hours
|
|
304
|
+
|
|
305
|
+
## ⚡ Quick Links
|
|
306
|
+
|
|
307
|
+
- [**Get Started →**](https://odds-api.io/#pricing)
|
|
308
|
+
- [**View Documentation →**](https://docs.odds-api.io)
|
|
309
|
+
- [**See Examples →**](examples/)
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
Built with ❤️ by the [Odds-API.io](https://odds-api.io) team
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Odds-API.io Python SDK
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/odds-api-io/)
|
|
4
|
+
[](https://pypi.org/project/odds-api-io/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://docs.odds-api.io)
|
|
7
|
+
|
|
8
|
+
Official Python SDK for [**Odds-API.io**](https://odds-api.io) - Real-time sports betting odds from 250+ bookmakers.
|
|
9
|
+
|
|
10
|
+
## 🚀 Features
|
|
11
|
+
|
|
12
|
+
- ⚡ **Fast & Reliable** - Built on requests and aiohttp for both sync and async workflows
|
|
13
|
+
- 🏀 **20+ Sports** - Basketball, football, tennis, baseball, and more
|
|
14
|
+
- 📊 **250+ Bookmakers** - Comprehensive odds coverage from major sportsbooks worldwide
|
|
15
|
+
- 💰 **Arbitrage Detection** - Find risk-free betting opportunities across bookmakers
|
|
16
|
+
- 📈 **Value Bets** - Identify positive expected value betting opportunities
|
|
17
|
+
- 🔴 **Live Events** - Real-time in-play event tracking and odds
|
|
18
|
+
- 🔍 **Advanced Search** - Search events, participants, and leagues
|
|
19
|
+
- ✨ **Type Hints** - Full type annotations for better IDE support
|
|
20
|
+
- 🐍 **Modern Python** - Supports Python 3.8+
|
|
21
|
+
|
|
22
|
+
## 📦 Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install odds-api-io
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 🔑 Get Your API Key
|
|
29
|
+
|
|
30
|
+
**[Get your free API key here →](https://odds-api.io/#pricing)**
|
|
31
|
+
|
|
32
|
+
Sign up at [**odds-api.io**](https://odds-api.io) to get started. Free tier includes:
|
|
33
|
+
- 5,000 requests/hour
|
|
34
|
+
- Access to all endpoints
|
|
35
|
+
- No credit card required
|
|
36
|
+
|
|
37
|
+
## 📚 Documentation
|
|
38
|
+
|
|
39
|
+
Full API documentation is available at [**docs.odds-api.io**](https://docs.odds-api.io)
|
|
40
|
+
|
|
41
|
+
## 🏃 Quick Start
|
|
42
|
+
|
|
43
|
+
### Synchronous Client
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
from odds_api import OddsAPIClient
|
|
47
|
+
|
|
48
|
+
# Initialize the client
|
|
49
|
+
client = OddsAPIClient(api_key="your_api_key_here")
|
|
50
|
+
|
|
51
|
+
# Get available sports
|
|
52
|
+
sports = client.get_sports()
|
|
53
|
+
print(f"Found {len(sports)} sports")
|
|
54
|
+
|
|
55
|
+
# Get upcoming NBA events
|
|
56
|
+
events = client.get_events(sport="basketball", league="usa-nba")
|
|
57
|
+
|
|
58
|
+
# Search for specific games
|
|
59
|
+
lakers_games = client.search_events(query="Lakers")
|
|
60
|
+
|
|
61
|
+
# Get live basketball events
|
|
62
|
+
live = client.get_live_events(sport="basketball")
|
|
63
|
+
|
|
64
|
+
# Find arbitrage opportunities
|
|
65
|
+
arb_bets = client.get_arbitrage_bets(
|
|
66
|
+
bookmakers="pinnacle,bet365",
|
|
67
|
+
limit=10,
|
|
68
|
+
include_event_details=True
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Close the client when done
|
|
72
|
+
client.close()
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Asynchronous Client
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import asyncio
|
|
79
|
+
from odds_api import AsyncOddsAPIClient
|
|
80
|
+
|
|
81
|
+
async def main():
|
|
82
|
+
# Use async context manager
|
|
83
|
+
async with AsyncOddsAPIClient(api_key="your_api_key_here") as client:
|
|
84
|
+
# Get sports
|
|
85
|
+
sports = await client.get_sports()
|
|
86
|
+
|
|
87
|
+
# Get upcoming events
|
|
88
|
+
events = await client.get_events(sport="basketball", league="usa-nba")
|
|
89
|
+
|
|
90
|
+
# Find value bets
|
|
91
|
+
value_bets = await client.get_value_bets(
|
|
92
|
+
bookmaker="pinnacle",
|
|
93
|
+
include_event_details=True
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
print(f"Found {len(value_bets)} value betting opportunities")
|
|
97
|
+
|
|
98
|
+
# Run async code
|
|
99
|
+
asyncio.run(main())
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Context Manager (Recommended)
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# Sync
|
|
106
|
+
with OddsAPIClient(api_key="your_api_key") as client:
|
|
107
|
+
sports = client.get_sports()
|
|
108
|
+
|
|
109
|
+
# Async
|
|
110
|
+
async with AsyncOddsAPIClient(api_key="your_api_key") as client:
|
|
111
|
+
sports = await client.get_sports()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## 📖 Examples
|
|
115
|
+
|
|
116
|
+
Check out the [`examples/`](examples/) directory for more detailed examples:
|
|
117
|
+
|
|
118
|
+
- **[basic_usage.py](examples/basic_usage.py)** - Getting started with the SDK
|
|
119
|
+
- **[async_example.py](examples/async_example.py)** - Using the async client
|
|
120
|
+
- **[arbitrage_finder.py](examples/arbitrage_finder.py)** - Finding arbitrage opportunities
|
|
121
|
+
- **[value_bets.py](examples/value_bets.py)** - Identifying value bets
|
|
122
|
+
- **[odds_tracking.py](examples/odds_tracking.py)** - Tracking odds movements
|
|
123
|
+
|
|
124
|
+
## 🔧 API Reference
|
|
125
|
+
|
|
126
|
+
### Sports & Leagues
|
|
127
|
+
|
|
128
|
+
| Method | Description | Docs |
|
|
129
|
+
|--------|-------------|------|
|
|
130
|
+
| `get_sports()` | Get all available sports | [📖](https://docs.odds-api.io/api-reference/sports/get-sports) |
|
|
131
|
+
| `get_leagues(sport)` | Get leagues for a sport | [📖](https://docs.odds-api.io/api-reference/leagues/get-leagues) |
|
|
132
|
+
|
|
133
|
+
### Events
|
|
134
|
+
|
|
135
|
+
| Method | Description | Docs |
|
|
136
|
+
|--------|-------------|------|
|
|
137
|
+
| `get_events(sport, **filters)` | Get events with filters | [📖](https://docs.odds-api.io/api-reference/events/get-events) |
|
|
138
|
+
| `get_event_by_id(event_id)` | Get specific event details | [📖](https://docs.odds-api.io/api-reference/events/get-event-by-id) |
|
|
139
|
+
| `get_live_events(sport)` | Get currently live events | [📖](https://docs.odds-api.io/api-reference/events/get-live-events) |
|
|
140
|
+
| `search_events(query)` | Search events by keyword | [📖](https://docs.odds-api.io/api-reference/events/search-events) |
|
|
141
|
+
|
|
142
|
+
### Odds
|
|
143
|
+
|
|
144
|
+
| Method | Description | Docs |
|
|
145
|
+
|--------|-------------|------|
|
|
146
|
+
| `get_event_odds(event_id, bookmakers)` | Get odds for an event | [📖](https://docs.odds-api.io/api-reference/odds/get-event-odds) |
|
|
147
|
+
| `get_odds_movement(event_id, bookmaker, market)` | Track odds changes | [📖](https://docs.odds-api.io/api-reference/odds/get-odds-movements) |
|
|
148
|
+
| `get_odds_for_multiple_events(event_ids, bookmakers)` | Get odds for multiple events | [📖](https://docs.odds-api.io/api-reference/odds/get-odds-for-multiple-events) |
|
|
149
|
+
| `get_updated_odds_since_timestamp(since, bookmaker, sport)` | Get recently updated odds | [📖](https://docs.odds-api.io/api-reference/odds/get-updated-event-odds-since-a-given-timestamp) |
|
|
150
|
+
|
|
151
|
+
### Participants
|
|
152
|
+
|
|
153
|
+
| Method | Description | Docs |
|
|
154
|
+
|--------|-------------|------|
|
|
155
|
+
| `get_participants(sport, search=None)` | Get teams/players | [📖](https://docs.odds-api.io/api-reference/participants/get-participants) |
|
|
156
|
+
| `get_participant_by_id(participant_id)` | Get participant by ID | [📖](https://docs.odds-api.io/api-reference/participants/get-participant-by-id) |
|
|
157
|
+
|
|
158
|
+
### Bookmakers
|
|
159
|
+
|
|
160
|
+
| Method | Description | Docs |
|
|
161
|
+
|--------|-------------|------|
|
|
162
|
+
| `get_bookmakers()` | Get all available bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/get-bookmakers) |
|
|
163
|
+
| `get_selected_bookmakers()` | Get your selected bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/get-selected-bookmakers) |
|
|
164
|
+
| `select_bookmakers(bookmakers)` | Select bookmakers | [📖](https://docs.odds-api.io/api-reference/bookmakers/select-bookmakers) |
|
|
165
|
+
| `clear_selected_bookmakers()` | Clear selection | [📖](https://docs.odds-api.io/api-reference/bookmakers/clear-selected-bookmakers) |
|
|
166
|
+
|
|
167
|
+
### Betting Analysis
|
|
168
|
+
|
|
169
|
+
| Method | Description | Docs |
|
|
170
|
+
|--------|-------------|------|
|
|
171
|
+
| `get_arbitrage_bets(bookmakers, **options)` | Find arbitrage opportunities | [📖](https://docs.odds-api.io/api-reference/arbitrage-bets/get-arbitrage-betting-opportunities) |
|
|
172
|
+
| `get_value_bets(bookmaker, **options)` | Find value bets | [📖](https://docs.odds-api.io/api-reference/value-bets/get-value-bets) |
|
|
173
|
+
|
|
174
|
+
## ⚠️ Error Handling
|
|
175
|
+
|
|
176
|
+
The SDK provides custom exceptions for different error scenarios:
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from odds_api import (
|
|
180
|
+
OddsAPIClient,
|
|
181
|
+
OddsAPIError,
|
|
182
|
+
InvalidAPIKeyError,
|
|
183
|
+
RateLimitExceededError,
|
|
184
|
+
NotFoundError,
|
|
185
|
+
ValidationError
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
client = OddsAPIClient(api_key="your_api_key")
|
|
189
|
+
|
|
190
|
+
try:
|
|
191
|
+
events = client.get_events(sport="basketball")
|
|
192
|
+
except InvalidAPIKeyError:
|
|
193
|
+
print("Your API key is invalid")
|
|
194
|
+
except RateLimitExceededError:
|
|
195
|
+
print("Rate limit exceeded - wait before retrying")
|
|
196
|
+
except NotFoundError:
|
|
197
|
+
print("Resource not found")
|
|
198
|
+
except ValidationError as e:
|
|
199
|
+
print(f"Invalid parameters: {e}")
|
|
200
|
+
except OddsAPIError as e:
|
|
201
|
+
print(f"API error: {e}")
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## 🌟 Why Odds-API.io?
|
|
205
|
+
|
|
206
|
+
- **✅ Most Comprehensive Coverage** - 250+ bookmakers across 20+ sports
|
|
207
|
+
- **✅ Near-Zero Latency** - Real-time odds updates with minimal delay
|
|
208
|
+
- **✅ Direct Bet Links** - Deep links directly to bookmaker bet slips
|
|
209
|
+
- **✅ Value Bet Detection** - Automatically calculated expected value
|
|
210
|
+
- **✅ Historical Data** - Access to past odds and results
|
|
211
|
+
- **✅ Developer Friendly** - Clean API design with excellent documentation
|
|
212
|
+
|
|
213
|
+
## 💡 Use Cases
|
|
214
|
+
|
|
215
|
+
Build powerful betting tools and analytics:
|
|
216
|
+
- 🎯 Arbitrage betting platforms
|
|
217
|
+
- 📊 Odds comparison sites
|
|
218
|
+
- 📈 Value betting calculators
|
|
219
|
+
- 🤖 Automated betting systems
|
|
220
|
+
- 📉 Sports analytics dashboards
|
|
221
|
+
- 🔔 Odds movement alerts
|
|
222
|
+
|
|
223
|
+
## 🆓 Free Tier Limitations
|
|
224
|
+
|
|
225
|
+
- Limited to 2 bookmakers selected at once
|
|
226
|
+
- 5,000 requests per hour (shared across all plans)
|
|
227
|
+
- No WebSocket access on free tier
|
|
228
|
+
|
|
229
|
+
[**Upgrade for more features →**](https://odds-api.io/#pricing)
|
|
230
|
+
|
|
231
|
+
## 📋 Requirements
|
|
232
|
+
|
|
233
|
+
- Python 3.8 or higher
|
|
234
|
+
- `requests` library (for sync client)
|
|
235
|
+
- `aiohttp` library (for async client)
|
|
236
|
+
|
|
237
|
+
## 🤝 Contributing
|
|
238
|
+
|
|
239
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
240
|
+
|
|
241
|
+
1. Fork the repository
|
|
242
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
243
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
244
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
245
|
+
5. Open a Pull Request
|
|
246
|
+
|
|
247
|
+
## 📝 License
|
|
248
|
+
|
|
249
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
250
|
+
|
|
251
|
+
## 🔗 Links
|
|
252
|
+
|
|
253
|
+
- **Website**: [odds-api.io](https://odds-api.io)
|
|
254
|
+
- **Documentation**: [docs.odds-api.io](https://docs.odds-api.io)
|
|
255
|
+
- **API Key**: [Get your API key](https://odds-api.io/#pricing)
|
|
256
|
+
- **GitHub**: [github.com/odds-api-io/odds-api-python](https://github.com/odds-api-io/odds-api-python)
|
|
257
|
+
- **Issues**: [Report a bug](https://github.com/odds-api-io/odds-api-python/issues)
|
|
258
|
+
- **PyPI**: [pypi.org/project/odds-api-io](https://pypi.org/project/odds-api-io/)
|
|
259
|
+
|
|
260
|
+
## 💬 Support
|
|
261
|
+
|
|
262
|
+
Need help? We're here for you:
|
|
263
|
+
|
|
264
|
+
- 📧 **Email**: hello@odds-api.io
|
|
265
|
+
- 📚 **Documentation**: [docs.odds-api.io](https://docs.odds-api.io)
|
|
266
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/odds-api-io/odds-api-python/issues)
|
|
267
|
+
- ⏱️ **Response Time**: Usually within 24 hours
|
|
268
|
+
|
|
269
|
+
## ⚡ Quick Links
|
|
270
|
+
|
|
271
|
+
- [**Get Started →**](https://odds-api.io/#pricing)
|
|
272
|
+
- [**View Documentation →**](https://docs.odds-api.io)
|
|
273
|
+
- [**See Examples →**](examples/)
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
Built with ❤️ by the [Odds-API.io](https://odds-api.io) team
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Odds-API.io Python SDK
|
|
3
|
+
Official Python client for the Odds-API.io sports betting odds API.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "1.0.0"
|
|
7
|
+
|
|
8
|
+
from .client import OddsAPIClient
|
|
9
|
+
from .async_client import AsyncOddsAPIClient
|
|
10
|
+
from .exceptions import (
|
|
11
|
+
OddsAPIError,
|
|
12
|
+
InvalidAPIKeyError,
|
|
13
|
+
RateLimitExceededError,
|
|
14
|
+
NotFoundError,
|
|
15
|
+
ValidationError,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"OddsAPIClient",
|
|
20
|
+
"AsyncOddsAPIClient",
|
|
21
|
+
"OddsAPIError",
|
|
22
|
+
"InvalidAPIKeyError",
|
|
23
|
+
"RateLimitExceededError",
|
|
24
|
+
"NotFoundError",
|
|
25
|
+
"ValidationError",
|
|
26
|
+
"__version__",
|
|
27
|
+
]
|