altsportsdata 2.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.
- altsportsdata-2.0.0/PKG-INFO +234 -0
- altsportsdata-2.0.0/README.md +200 -0
- altsportsdata-2.0.0/altsportsdata/__init__.py +140 -0
- altsportsdata-2.0.0/altsportsdata/client.py +452 -0
- altsportsdata-2.0.0/altsportsdata/exceptions.py +119 -0
- altsportsdata-2.0.0/altsportsdata/models.py +826 -0
- altsportsdata-2.0.0/altsportsdata.egg-info/PKG-INFO +234 -0
- altsportsdata-2.0.0/altsportsdata.egg-info/SOURCES.txt +13 -0
- altsportsdata-2.0.0/altsportsdata.egg-info/dependency_links.txt +1 -0
- altsportsdata-2.0.0/altsportsdata.egg-info/requires.txt +9 -0
- altsportsdata-2.0.0/altsportsdata.egg-info/top_level.txt +1 -0
- altsportsdata-2.0.0/pyproject.toml +82 -0
- altsportsdata-2.0.0/setup.cfg +4 -0
- altsportsdata-2.0.0/setup.py +10 -0
- altsportsdata-2.0.0/tests/test_client.py +241 -0
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: altsportsdata
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Official Python SDK for the AltSportsData API - alternative sports odds, events, and futures data
|
|
5
|
+
Author-email: AltSportsData <dev@altsportsdata.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://altsportsdata.com
|
|
8
|
+
Project-URL: Documentation, https://api.dev.altsportsdata.com/public/docs/swagger
|
|
9
|
+
Project-URL: Repository, https://github.com/altsportsdata/altsportsdata-python
|
|
10
|
+
Project-URL: Issues, https://github.com/altsportsdata/altsportsdata-python/issues
|
|
11
|
+
Keywords: sports,betting,odds,sportsbook,api,sdk,alternative-sports,futures,events,altsportsdata,wsl,sls,f1,pbr,mma,esports
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.8
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Requires-Dist: requests>=2.28.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
32
|
+
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
33
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
34
|
+
|
|
35
|
+
# AltSportsData SDK
|
|
36
|
+
|
|
37
|
+
[](https://pypi.org/project/altsportsdata/)
|
|
38
|
+
[](https://www.python.org/downloads/)
|
|
39
|
+
|
|
40
|
+
**The data feed for alternative sports betting.**
|
|
41
|
+
|
|
42
|
+
One SDK. 31 leagues. Every market type. Built for sportsbooks, DFS platforms, and prediction markets.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
pip install altsportsdata
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## 30 Seconds to Your First Odds
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from altsportsdata import AltSportsData
|
|
52
|
+
|
|
53
|
+
wsl = AltSportsData(api_key="sk_live_xxx", league="wsl")
|
|
54
|
+
|
|
55
|
+
# What's live right now?
|
|
56
|
+
events = wsl.list_events(status="live")
|
|
57
|
+
|
|
58
|
+
# Pull moneylines
|
|
59
|
+
odds = wsl.get_moneylines(events[0].id)
|
|
60
|
+
|
|
61
|
+
# Build a parlay
|
|
62
|
+
parlay = wsl.calculate_parlay(events[0].id, picks=["odd_1", "odd_2", "odd_3"])
|
|
63
|
+
print(f"Combined odds: {parlay['combinedOdds']}")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Why AltSportsData
|
|
67
|
+
|
|
68
|
+
| Problem | Solution |
|
|
69
|
+
|---------|----------|
|
|
70
|
+
| Alt sports data is fragmented across dozens of sources | **One unified API** — 31 leagues, standardized schema |
|
|
71
|
+
| Your team wastes weeks integrating each new sport | **Minutes to integrate** — same SDK, same patterns |
|
|
72
|
+
| No odds available for niche sports your users want | **Full market coverage** — moneylines, matchups, props, totals, futures, parlays |
|
|
73
|
+
| Existing feeds don't support your platform's format | **Sportsbook-native naming** — use the terms your team already knows |
|
|
74
|
+
|
|
75
|
+
## Sportsbook-Native API
|
|
76
|
+
|
|
77
|
+
Use the names your trading team already knows. We alias everything.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
# These all work — use whatever your team prefers
|
|
81
|
+
wsl.get_moneylines("evt_id") # → eventWinner
|
|
82
|
+
wsl.get_matchups("evt_id") # → headToHead
|
|
83
|
+
wsl.get_player_props("evt_id") # → propBets
|
|
84
|
+
wsl.get_totals("evt_id") # → overUnder
|
|
85
|
+
wsl.get_exactas("evt_id", n=3) # → eventExacta
|
|
86
|
+
|
|
87
|
+
# Or use API-native names directly
|
|
88
|
+
wsl.get_odds("evt_id", "eventWinner")
|
|
89
|
+
wsl.get_odds("evt_id", "headToHead")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Full API Reference
|
|
93
|
+
|
|
94
|
+
### Setup
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from altsportsdata import AltSportsData
|
|
98
|
+
|
|
99
|
+
# Lock to a league — all queries auto-filter
|
|
100
|
+
wsl = AltSportsData(api_key="sk_live_xxx", league="wsl")
|
|
101
|
+
f1 = AltSportsData(api_key="sk_live_xxx", league="f1")
|
|
102
|
+
pbr = AltSportsData(api_key="sk_live_xxx", league="pbr")
|
|
103
|
+
|
|
104
|
+
# Or query across all leagues
|
|
105
|
+
client = AltSportsData(api_key="sk_live_xxx")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Leagues
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
client.list_leagues() # all leagues with markets & tours
|
|
112
|
+
client.list_sports() # alias
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Events
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
# Filter by status — use plain English
|
|
119
|
+
client.list_events(status="upcoming")
|
|
120
|
+
client.list_events(status="live")
|
|
121
|
+
client.list_events(status="completed")
|
|
122
|
+
client.list_events(status=["live", "upcoming"])
|
|
123
|
+
|
|
124
|
+
# Date range
|
|
125
|
+
client.list_events(start_date="2024-04-01T00:00:00Z", end_date="2024-04-30T00:00:00Z")
|
|
126
|
+
|
|
127
|
+
# Single event
|
|
128
|
+
client.get_event("evt_id")
|
|
129
|
+
|
|
130
|
+
# Participants / athletes
|
|
131
|
+
client.get_participants("evt_id")
|
|
132
|
+
|
|
133
|
+
# Heat scores (action sports & racing)
|
|
134
|
+
client.get_heat_scores("evt_id", "heat_id")
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Odds
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
# Sportsbook-native
|
|
141
|
+
client.get_moneylines("evt_id") # event winner
|
|
142
|
+
client.get_matchups("evt_id") # head-to-head
|
|
143
|
+
client.get_player_props("evt_id") # prop bets
|
|
144
|
+
client.get_totals("evt_id") # over/under
|
|
145
|
+
client.get_totals("evt_id", sub_market="points") # with sub-market
|
|
146
|
+
client.get_heat_winners("evt_id") # heat winner (WSL/SLS/racing)
|
|
147
|
+
client.get_fastest_lap("evt_id") # fastest lap (racing)
|
|
148
|
+
client.get_exactas("evt_id", n=2) # exacta (2/3/4-way)
|
|
149
|
+
client.get_podiums("evt_id") # podium finish
|
|
150
|
+
client.get_shows("evt_id") # shows
|
|
151
|
+
client.get_dream_team("evt_id") # dream team
|
|
152
|
+
|
|
153
|
+
# Generic — pass any market type
|
|
154
|
+
client.get_odds("evt_id", "moneyline") # alias resolves automatically
|
|
155
|
+
client.get_odds("evt_id", "eventWinner") # API-native also works
|
|
156
|
+
client.get_odds("evt_id", "raceTop5") # all 17 market types supported
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**17 market types:** `moneyline` · `matchups` · `props` · `totals` · `heat_winner` · `fastest_lap` · `exacta` · `podium` · `shows` · `dream_team` · `top3` · `top5` · `top10` · `second_place` · `hole_shot` · `multi_ou` · `heat_exacta`
|
|
160
|
+
|
|
161
|
+
### Parlays (SGP)
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
parlay = client.calculate_parlay("evt_id", picks=["odd_1", "odd_2", "odd_3"])
|
|
165
|
+
# → {"combinedOdds": 12.5, "combinedProbability": 0.08, "selections": [...]}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Futures
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
client.list_futures()
|
|
172
|
+
client.get_futures(tour="tour_id", type="winner")
|
|
173
|
+
client.get_futures(tour="tour_id", type="top3", league="f1")
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Jai Alai
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
client.get_jaialai_matches("evt_id")
|
|
180
|
+
client.get_jaialai_odds("evt_id") # moneyline, spread, totals per set
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## 31 Leagues
|
|
184
|
+
|
|
185
|
+
| Code | League | Code | League |
|
|
186
|
+
|------|--------|------|--------|
|
|
187
|
+
| `wsl` | World Surf League | `pbr` | Professional Bull Riders |
|
|
188
|
+
| `sls` | Street League Skateboarding | `bkfc` | Bare Knuckle FC |
|
|
189
|
+
| `f1` | Formula 1 | `motogp` | MotoGP |
|
|
190
|
+
| `nrx` | Nitrocross | `mxgp` | MXGP |
|
|
191
|
+
| `fdrift` | Formula Drift | `jaialai` | Jai Alai |
|
|
192
|
+
| `masl` | Major Arena Soccer | `nll` | National Lacrosse League |
|
|
193
|
+
| `powerslap` | Power Slap | `nhra` | NHRA Drag Racing |
|
|
194
|
+
| `dgpt` | Disc Golf Pro Tour | `worldoutlaws` | World of Outlaws |
|
|
195
|
+
| `byb` | BYB Extreme Fighting | `gsoc` | Global Soccer |
|
|
196
|
+
| `usac` | USAC Racing | `xgame` | X Games |
|
|
197
|
+
| `motocrs` | Motocross | `motoamerica` | MotoAmerica |
|
|
198
|
+
| `sprmtcrs` | Supermotocross | `hlrs` | Haulers |
|
|
199
|
+
| `spr` | Supercross | `cdc` | CDC |
|
|
200
|
+
| `athletesunlimited` | Athletes Unlimited | `lux` | Lux |
|
|
201
|
+
| `raf` | RAF | `mltt` | Major League Table Tennis |
|
|
202
|
+
| `spectation` | Spectation | | |
|
|
203
|
+
|
|
204
|
+
## Error Handling
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from altsportsdata import AltSportsData, AuthenticationError, RateLimitError, NotFoundError
|
|
208
|
+
|
|
209
|
+
try:
|
|
210
|
+
odds = wsl.get_moneylines("evt_id")
|
|
211
|
+
except AuthenticationError:
|
|
212
|
+
print("Invalid API key")
|
|
213
|
+
except NotFoundError:
|
|
214
|
+
print("Event not found")
|
|
215
|
+
except RateLimitError as e:
|
|
216
|
+
print(f"Rate limited — retry in {e.retry_after}s")
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Coming Soon
|
|
220
|
+
|
|
221
|
+
- **TypeScript SDK** — same flat API, same aliases
|
|
222
|
+
- **Go SDK** — for high-throughput pipelines
|
|
223
|
+
- **WebSocket feeds** — real-time odds streaming
|
|
224
|
+
- **Webhook push** — odds delivered to your endpoint
|
|
225
|
+
- **Pandas integration** — `client.get_moneylines("evt_id", as_df=True)`
|
|
226
|
+
|
|
227
|
+
## Links
|
|
228
|
+
|
|
229
|
+
- [API Docs](https://api.dev.altsportsdata.com/public/docs/swagger)
|
|
230
|
+
- [Get API Key](https://altsportsdata.com)
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# AltSportsData SDK
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/altsportsdata/)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
|
|
6
|
+
**The data feed for alternative sports betting.**
|
|
7
|
+
|
|
8
|
+
One SDK. 31 leagues. Every market type. Built for sportsbooks, DFS platforms, and prediction markets.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
pip install altsportsdata
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 30 Seconds to Your First Odds
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
from altsportsdata import AltSportsData
|
|
18
|
+
|
|
19
|
+
wsl = AltSportsData(api_key="sk_live_xxx", league="wsl")
|
|
20
|
+
|
|
21
|
+
# What's live right now?
|
|
22
|
+
events = wsl.list_events(status="live")
|
|
23
|
+
|
|
24
|
+
# Pull moneylines
|
|
25
|
+
odds = wsl.get_moneylines(events[0].id)
|
|
26
|
+
|
|
27
|
+
# Build a parlay
|
|
28
|
+
parlay = wsl.calculate_parlay(events[0].id, picks=["odd_1", "odd_2", "odd_3"])
|
|
29
|
+
print(f"Combined odds: {parlay['combinedOdds']}")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Why AltSportsData
|
|
33
|
+
|
|
34
|
+
| Problem | Solution |
|
|
35
|
+
|---------|----------|
|
|
36
|
+
| Alt sports data is fragmented across dozens of sources | **One unified API** — 31 leagues, standardized schema |
|
|
37
|
+
| Your team wastes weeks integrating each new sport | **Minutes to integrate** — same SDK, same patterns |
|
|
38
|
+
| No odds available for niche sports your users want | **Full market coverage** — moneylines, matchups, props, totals, futures, parlays |
|
|
39
|
+
| Existing feeds don't support your platform's format | **Sportsbook-native naming** — use the terms your team already knows |
|
|
40
|
+
|
|
41
|
+
## Sportsbook-Native API
|
|
42
|
+
|
|
43
|
+
Use the names your trading team already knows. We alias everything.
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
# These all work — use whatever your team prefers
|
|
47
|
+
wsl.get_moneylines("evt_id") # → eventWinner
|
|
48
|
+
wsl.get_matchups("evt_id") # → headToHead
|
|
49
|
+
wsl.get_player_props("evt_id") # → propBets
|
|
50
|
+
wsl.get_totals("evt_id") # → overUnder
|
|
51
|
+
wsl.get_exactas("evt_id", n=3) # → eventExacta
|
|
52
|
+
|
|
53
|
+
# Or use API-native names directly
|
|
54
|
+
wsl.get_odds("evt_id", "eventWinner")
|
|
55
|
+
wsl.get_odds("evt_id", "headToHead")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Full API Reference
|
|
59
|
+
|
|
60
|
+
### Setup
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from altsportsdata import AltSportsData
|
|
64
|
+
|
|
65
|
+
# Lock to a league — all queries auto-filter
|
|
66
|
+
wsl = AltSportsData(api_key="sk_live_xxx", league="wsl")
|
|
67
|
+
f1 = AltSportsData(api_key="sk_live_xxx", league="f1")
|
|
68
|
+
pbr = AltSportsData(api_key="sk_live_xxx", league="pbr")
|
|
69
|
+
|
|
70
|
+
# Or query across all leagues
|
|
71
|
+
client = AltSportsData(api_key="sk_live_xxx")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Leagues
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
client.list_leagues() # all leagues with markets & tours
|
|
78
|
+
client.list_sports() # alias
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Events
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
# Filter by status — use plain English
|
|
85
|
+
client.list_events(status="upcoming")
|
|
86
|
+
client.list_events(status="live")
|
|
87
|
+
client.list_events(status="completed")
|
|
88
|
+
client.list_events(status=["live", "upcoming"])
|
|
89
|
+
|
|
90
|
+
# Date range
|
|
91
|
+
client.list_events(start_date="2024-04-01T00:00:00Z", end_date="2024-04-30T00:00:00Z")
|
|
92
|
+
|
|
93
|
+
# Single event
|
|
94
|
+
client.get_event("evt_id")
|
|
95
|
+
|
|
96
|
+
# Participants / athletes
|
|
97
|
+
client.get_participants("evt_id")
|
|
98
|
+
|
|
99
|
+
# Heat scores (action sports & racing)
|
|
100
|
+
client.get_heat_scores("evt_id", "heat_id")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Odds
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
# Sportsbook-native
|
|
107
|
+
client.get_moneylines("evt_id") # event winner
|
|
108
|
+
client.get_matchups("evt_id") # head-to-head
|
|
109
|
+
client.get_player_props("evt_id") # prop bets
|
|
110
|
+
client.get_totals("evt_id") # over/under
|
|
111
|
+
client.get_totals("evt_id", sub_market="points") # with sub-market
|
|
112
|
+
client.get_heat_winners("evt_id") # heat winner (WSL/SLS/racing)
|
|
113
|
+
client.get_fastest_lap("evt_id") # fastest lap (racing)
|
|
114
|
+
client.get_exactas("evt_id", n=2) # exacta (2/3/4-way)
|
|
115
|
+
client.get_podiums("evt_id") # podium finish
|
|
116
|
+
client.get_shows("evt_id") # shows
|
|
117
|
+
client.get_dream_team("evt_id") # dream team
|
|
118
|
+
|
|
119
|
+
# Generic — pass any market type
|
|
120
|
+
client.get_odds("evt_id", "moneyline") # alias resolves automatically
|
|
121
|
+
client.get_odds("evt_id", "eventWinner") # API-native also works
|
|
122
|
+
client.get_odds("evt_id", "raceTop5") # all 17 market types supported
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**17 market types:** `moneyline` · `matchups` · `props` · `totals` · `heat_winner` · `fastest_lap` · `exacta` · `podium` · `shows` · `dream_team` · `top3` · `top5` · `top10` · `second_place` · `hole_shot` · `multi_ou` · `heat_exacta`
|
|
126
|
+
|
|
127
|
+
### Parlays (SGP)
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
parlay = client.calculate_parlay("evt_id", picks=["odd_1", "odd_2", "odd_3"])
|
|
131
|
+
# → {"combinedOdds": 12.5, "combinedProbability": 0.08, "selections": [...]}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Futures
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
client.list_futures()
|
|
138
|
+
client.get_futures(tour="tour_id", type="winner")
|
|
139
|
+
client.get_futures(tour="tour_id", type="top3", league="f1")
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Jai Alai
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
client.get_jaialai_matches("evt_id")
|
|
146
|
+
client.get_jaialai_odds("evt_id") # moneyline, spread, totals per set
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 31 Leagues
|
|
150
|
+
|
|
151
|
+
| Code | League | Code | League |
|
|
152
|
+
|------|--------|------|--------|
|
|
153
|
+
| `wsl` | World Surf League | `pbr` | Professional Bull Riders |
|
|
154
|
+
| `sls` | Street League Skateboarding | `bkfc` | Bare Knuckle FC |
|
|
155
|
+
| `f1` | Formula 1 | `motogp` | MotoGP |
|
|
156
|
+
| `nrx` | Nitrocross | `mxgp` | MXGP |
|
|
157
|
+
| `fdrift` | Formula Drift | `jaialai` | Jai Alai |
|
|
158
|
+
| `masl` | Major Arena Soccer | `nll` | National Lacrosse League |
|
|
159
|
+
| `powerslap` | Power Slap | `nhra` | NHRA Drag Racing |
|
|
160
|
+
| `dgpt` | Disc Golf Pro Tour | `worldoutlaws` | World of Outlaws |
|
|
161
|
+
| `byb` | BYB Extreme Fighting | `gsoc` | Global Soccer |
|
|
162
|
+
| `usac` | USAC Racing | `xgame` | X Games |
|
|
163
|
+
| `motocrs` | Motocross | `motoamerica` | MotoAmerica |
|
|
164
|
+
| `sprmtcrs` | Supermotocross | `hlrs` | Haulers |
|
|
165
|
+
| `spr` | Supercross | `cdc` | CDC |
|
|
166
|
+
| `athletesunlimited` | Athletes Unlimited | `lux` | Lux |
|
|
167
|
+
| `raf` | RAF | `mltt` | Major League Table Tennis |
|
|
168
|
+
| `spectation` | Spectation | | |
|
|
169
|
+
|
|
170
|
+
## Error Handling
|
|
171
|
+
|
|
172
|
+
```python
|
|
173
|
+
from altsportsdata import AltSportsData, AuthenticationError, RateLimitError, NotFoundError
|
|
174
|
+
|
|
175
|
+
try:
|
|
176
|
+
odds = wsl.get_moneylines("evt_id")
|
|
177
|
+
except AuthenticationError:
|
|
178
|
+
print("Invalid API key")
|
|
179
|
+
except NotFoundError:
|
|
180
|
+
print("Event not found")
|
|
181
|
+
except RateLimitError as e:
|
|
182
|
+
print(f"Rate limited — retry in {e.retry_after}s")
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Coming Soon
|
|
186
|
+
|
|
187
|
+
- **TypeScript SDK** — same flat API, same aliases
|
|
188
|
+
- **Go SDK** — for high-throughput pipelines
|
|
189
|
+
- **WebSocket feeds** — real-time odds streaming
|
|
190
|
+
- **Webhook push** — odds delivered to your endpoint
|
|
191
|
+
- **Pandas integration** — `client.get_moneylines("evt_id", as_df=True)`
|
|
192
|
+
|
|
193
|
+
## Links
|
|
194
|
+
|
|
195
|
+
- [API Docs](https://api.dev.altsportsdata.com/public/docs/swagger)
|
|
196
|
+
- [Get API Key](https://altsportsdata.com)
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
MIT
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AltSportsData Python SDK
|
|
3
|
+
|
|
4
|
+
Official Python SDK for the AltSportsData API — alternative sports
|
|
5
|
+
odds, events, and futures data for sportsbooks and betting platforms.
|
|
6
|
+
|
|
7
|
+
Quick start in Google Colab::
|
|
8
|
+
|
|
9
|
+
!pip install altsportsdata
|
|
10
|
+
|
|
11
|
+
from altsportsdata import AltSportsData
|
|
12
|
+
|
|
13
|
+
client = AltSportsData(api_key="your-key", sport="wsl")
|
|
14
|
+
client.list_upcoming_events()
|
|
15
|
+
client.get_event_odds(event="event-id", market="eventWinner")
|
|
16
|
+
|
|
17
|
+
API Docs: https://api.dev.altsportsdata.com/public/docs/swagger
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
__version__ = "2.0.0"
|
|
21
|
+
__author__ = "AltSportsData"
|
|
22
|
+
__description__ = "Python SDK for AltSportsData API - alternative sports betting data"
|
|
23
|
+
|
|
24
|
+
from .client import AltSportsData
|
|
25
|
+
from .models import (
|
|
26
|
+
# Enums
|
|
27
|
+
SportType,
|
|
28
|
+
OddType,
|
|
29
|
+
EventStatus,
|
|
30
|
+
MarketStatus,
|
|
31
|
+
Settlement,
|
|
32
|
+
PropSettlement,
|
|
33
|
+
LapStatus,
|
|
34
|
+
FutureType,
|
|
35
|
+
ExactasType,
|
|
36
|
+
OverUnderSubMarketType,
|
|
37
|
+
SortOrder,
|
|
38
|
+
# Core models
|
|
39
|
+
Team,
|
|
40
|
+
Athlete,
|
|
41
|
+
RoundScore,
|
|
42
|
+
# Event models
|
|
43
|
+
EventResponse,
|
|
44
|
+
EventListing,
|
|
45
|
+
EventParticipant,
|
|
46
|
+
EventRoundListing,
|
|
47
|
+
EventRoundHeatListing,
|
|
48
|
+
ScoresListing,
|
|
49
|
+
TeamsListing,
|
|
50
|
+
# Jai Alai
|
|
51
|
+
JaiAlaiEvent,
|
|
52
|
+
JaiAlaiOdds,
|
|
53
|
+
ScoreDetail,
|
|
54
|
+
SetDetail,
|
|
55
|
+
TeamDetail,
|
|
56
|
+
# Odds models
|
|
57
|
+
EventWinnerOdd,
|
|
58
|
+
FastestLapOdd,
|
|
59
|
+
HeatOddsAthlete,
|
|
60
|
+
HeatOddsEvent,
|
|
61
|
+
HeatOddsRound,
|
|
62
|
+
HeadToHead,
|
|
63
|
+
PlayerEventParticipant,
|
|
64
|
+
PlayerAthlete,
|
|
65
|
+
PropBet,
|
|
66
|
+
DreamTeam,
|
|
67
|
+
DreamTeamTeam,
|
|
68
|
+
ProjectionExacta,
|
|
69
|
+
ExactasAthlete,
|
|
70
|
+
OverUnderOdd,
|
|
71
|
+
OverUnderGroup,
|
|
72
|
+
MultiOverUnder,
|
|
73
|
+
SelectionDto,
|
|
74
|
+
# SGP
|
|
75
|
+
SgpRequest,
|
|
76
|
+
SgpResponse,
|
|
77
|
+
# Futures
|
|
78
|
+
FutureListing,
|
|
79
|
+
FutureOdds,
|
|
80
|
+
FutureOdd,
|
|
81
|
+
FutureOddAthlete,
|
|
82
|
+
# Sports
|
|
83
|
+
SportsListing,
|
|
84
|
+
# Jai Alai odds
|
|
85
|
+
BaseSelection,
|
|
86
|
+
MoneyLineGroup,
|
|
87
|
+
EventWinnerMarket,
|
|
88
|
+
SpreadSelection,
|
|
89
|
+
SpreadGroup,
|
|
90
|
+
TotalSetsSelection,
|
|
91
|
+
TotalSetsGroup,
|
|
92
|
+
MatchWinnerMarketType,
|
|
93
|
+
SetOdds,
|
|
94
|
+
)
|
|
95
|
+
from .exceptions import (
|
|
96
|
+
AltSportsDataError,
|
|
97
|
+
AuthenticationError,
|
|
98
|
+
ValidationError,
|
|
99
|
+
RateLimitError,
|
|
100
|
+
NotFoundError,
|
|
101
|
+
PermissionError,
|
|
102
|
+
ServerError,
|
|
103
|
+
NetworkError,
|
|
104
|
+
ConfigurationError,
|
|
105
|
+
DataFormatError,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
__all__ = [
|
|
109
|
+
"AltSportsData",
|
|
110
|
+
# Enums
|
|
111
|
+
"SportType", "OddType", "EventStatus", "MarketStatus",
|
|
112
|
+
"Settlement", "PropSettlement", "LapStatus", "FutureType",
|
|
113
|
+
"ExactasType", "OverUnderSubMarketType", "SortOrder",
|
|
114
|
+
# Core
|
|
115
|
+
"Team", "Athlete", "RoundScore",
|
|
116
|
+
# Events
|
|
117
|
+
"EventResponse", "EventListing", "EventParticipant",
|
|
118
|
+
"EventRoundListing", "EventRoundHeatListing", "ScoresListing", "TeamsListing",
|
|
119
|
+
# Jai Alai
|
|
120
|
+
"JaiAlaiEvent", "JaiAlaiOdds", "ScoreDetail", "SetDetail", "TeamDetail",
|
|
121
|
+
# Odds
|
|
122
|
+
"EventWinnerOdd", "FastestLapOdd", "HeatOddsAthlete", "HeatOddsEvent",
|
|
123
|
+
"HeatOddsRound", "HeadToHead", "PlayerEventParticipant", "PlayerAthlete",
|
|
124
|
+
"PropBet", "DreamTeam", "DreamTeamTeam", "ProjectionExacta", "ExactasAthlete",
|
|
125
|
+
"OverUnderOdd", "OverUnderGroup", "MultiOverUnder", "SelectionDto",
|
|
126
|
+
# SGP
|
|
127
|
+
"SgpRequest", "SgpResponse",
|
|
128
|
+
# Futures
|
|
129
|
+
"FutureListing", "FutureOdds", "FutureOdd", "FutureOddAthlete",
|
|
130
|
+
# Sports
|
|
131
|
+
"SportsListing",
|
|
132
|
+
# Jai Alai odds
|
|
133
|
+
"BaseSelection", "MoneyLineGroup", "EventWinnerMarket",
|
|
134
|
+
"SpreadSelection", "SpreadGroup", "TotalSetsSelection", "TotalSetsGroup",
|
|
135
|
+
"MatchWinnerMarketType", "SetOdds",
|
|
136
|
+
# Exceptions
|
|
137
|
+
"AltSportsDataError", "AuthenticationError", "ValidationError",
|
|
138
|
+
"RateLimitError", "NotFoundError", "PermissionError", "ServerError",
|
|
139
|
+
"NetworkError", "ConfigurationError", "DataFormatError",
|
|
140
|
+
]
|