The data feed for alternative sports betting — odds, events, futures for 31 leagues
Project description
AltSportsData SDK
Alternative sports data for prediction markets, DFS platforms, and sportsbooks.
One SDK. 27 leagues. Every market type. Probabilities, odds, props, matchups, futures, and parlays.
pip install altsportsdata
30 Seconds to Live Data
from altsportsdata import AltSportsData
wsl = AltSportsData(api_key="your_key", league="wsl")
events = wsl.list_events(status="upcoming")
probs = wsl.get_market_probabilities(events[0].id)
Built For Three Audiences
Prediction Markets (Kalshi, Polymarket)
wsl = AltSportsData(api_key="your_key", league="wsl")
# Win probabilities for every participant
probs = wsl.get_market_probabilities("event_id")
for p in probs.get("eventWinner", []):
ath = p["athlete"]
print(f"{ath['firstName']} {ath['lastName']}: {p['probability']}% chance")
# Podium / top-N finish probabilities
wsl.get_podium_probabilities("event_id")
wsl.get_top_finish_probabilities("event_id", top_n=5)
# Season futures
wsl.get_futures(tour="tour_id", type="winner")
DFS Platforms (PrizePicks, Underdog)
f1 = AltSportsData(api_key="your_key", league="f1")
# Player props — the core DFS data
f1.get_player_props("event_id")
# Head-to-head matchups — pick'em format
f1.get_player_matchups("event_id")
# Player totals (over/under)
f1.get_player_totals("event_id", stat="finishingPosition")
Sportsbooks (DraftKings, Bet365, Stake)
nhra = AltSportsData(api_key="your_key", league="nhra")
# Traditional market types
nhra.get_moneylines("event_id")
nhra.get_matchups("event_id")
nhra.get_totals("event_id")
nhra.get_exactas("event_id", n=3)
nhra.get_podiums("event_id")
# Same Game Parlay
nhra.calculate_parlay("event_id", picks=["outcomeId_1", "outcomeId_2"])
Google Colab
!pip install altsportsdata
from altsportsdata import AltSportsData
from google.colab import userdata
client = AltSportsData(api_key=userdata.get('ALTSPORTSDATA_SDK_API_KEY'))
# Browse all leagues
for lg in client.list_leagues():
print(f"{lg.key:15} {lg.name}")
# Find live odds
events = client.list_events(status="upcoming", sort="asc")
for e in events:
if "jaialai" in str(e.id or ""):
continue
try:
odds = client.get_market_probabilities(e.id)
winners = odds.get("eventWinner", [])
if winners:
print(f"\n{e.name}:")
for w in sorted(winners, key=lambda x: x.get("odds") or 999)[:10]:
ath = w.get("athlete", {})
print(f" {ath['firstName']} {ath['lastName']:20} {w['probability']}% ({w['odds']})")
break
except:
continue
Full API
Setup
client = AltSportsData(api_key="key") # all leagues
wsl = AltSportsData(api_key="key", league="wsl") # auto-filters
f1 = AltSportsData(api_key="key", league="f1")
Events
client.list_events(status="upcoming")
client.list_events(status="live")
client.list_events(status="completed")
client.list_events(status=["live", "upcoming"])
client.get_event("event_id")
client.get_participants("event_id")
client.get_heat_scores("event_id", "heat_id")
All Odds Methods
# Prediction markets
client.get_market_probabilities("event_id") # win probabilities
client.get_podium_probabilities("event_id") # top-3 finish
client.get_top_finish_probabilities("event_id", top_n=5) # top-N
# DFS
client.get_player_props("event_id") # prop bets
client.get_player_matchups("event_id") # h2h pick'em
client.get_player_totals("event_id", stat="points") # over/under
# Sportsbook
client.get_moneylines("event_id") # event winner
client.get_matchups("event_id") # head-to-head
client.get_totals("event_id") # over/under
client.get_heat_winners("event_id") # heat winner
client.get_fastest_lap("event_id") # fastest lap
client.get_exactas("event_id", n=2) # exacta
client.get_podiums("event_id") # podium
client.get_shows("event_id") # shows
client.get_dream_team("event_id") # dream team
# Generic (any market type by name)
client.get_odds("event_id", "eventWinner")
client.get_odds("event_id", "moneyline") # aliases work too
Parlays
# Get real outcomeIds from odds first
odds = client.get_moneylines("event_id")
picks = [w["outcomeId"] for w in odds["eventWinner"][:2]]
parlay = client.calculate_parlay("event_id", picks=picks)
Futures
client.list_futures()
client.get_futures(tour="tour_id", type="winner")
Jai Alai
client.get_jaialai_matches("event_id")
client.get_jaialai_odds("event_id")
27 Leagues
| Code | League | Code | League |
|---|---|---|---|
wsl |
World Surf League | pbr |
Professional Bull Riders |
sls |
Street League Skateboarding | bkfc |
Bare Knuckle FC |
f1 |
Formula 1 | motogp |
MotoGP |
nrx |
Nitrocross | mxgp |
MXGP |
fdrift |
Formula Drift | jaialai |
Jai Alai |
masl |
Major Arena Soccer | nll |
National Lacrosse League |
powerslap |
Power Slap | nhra |
NHRA Drag Racing |
dgpt |
Disc Golf Pro Tour | worldoutlaws |
World of Outlaws |
usac |
USAC Racing | xgame |
X Games |
motoamerica |
MotoAmerica | hlrs |
High Limit Racing |
byb |
BYB Extreme Fighting | athletesunlimited |
Athletes Unlimited |
lux |
LUX Fight League | raf |
Real American Freestyle |
nll |
National Lacrosse League | mltt |
Major League Table Tennis |
spectation |
Spectation |
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
altsportsdata-2.1.2.tar.gz
(18.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file altsportsdata-2.1.2.tar.gz.
File metadata
- Download URL: altsportsdata-2.1.2.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d971189fc7e68e98895270eca5123d742ab7253dc3ba79a80f0047a166c18c
|
|
| MD5 |
cc4749bac9ab66329dd4f395474491aa
|
|
| BLAKE2b-256 |
87e19d98ba8e883e82a0797d595e829f2d279fac3eaafbab57ef7bf8ab3dae1b
|
File details
Details for the file altsportsdata-2.1.2-py3-none-any.whl.
File metadata
- Download URL: altsportsdata-2.1.2-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6f1f61aa2a70be8b2fd3469727696d7d950761549bb7d2c765f781956dc6aec
|
|
| MD5 |
63832942a54b14d5df9efb831e77eb0c
|
|
| BLAKE2b-256 |
ccbf65283377913c03117e0c628bdc6cc3df61c24d3aa77209e09c0fd6251b08
|