Skip to main content

The data feed for alternative sports betting — odds, events, futures for 31 leagues

Project description

AltSportsData SDK

PyPI Python 3.8+

Alternative sports odds & data for sportsbooks, DFS platforms, and prediction markets.

One SDK. 30 leagues. Every market type. Probabilities, odds, props, matchups, futures, and parlays.

pip install altsportsdata

Example 1 — Upcoming Odds

Pull pre-event moneylines for the next Supercross round:

from altsportsdata import AltSportsData

client = AltSportsData(api_key="your_key", league="spr")

events = client.list_events(status="upcoming")
odds = client.get_moneylines(events[0].id)

for o in odds["eventWinner"][:5]:
    ath = o["athlete"]
    print(f'{ath["firstName"]} {ath["lastName"]:20} {o["probability"]:6.2f}%  (odds {o["odds"]:.2f})')
Eli Tomac              49.42%  (odds 2.02)
Hunter Lawrence        37.57%  (odds 2.66)
Ken Roczen             23.49%  (odds 4.26)
Jett Lawrence          18.33%  (odds 5.45)
Chase Sexton           15.90%  (odds 6.29)

Example 2 — Historical Results & Settlement

Pull completed event odds with win/lose settlement:

wsl = AltSportsData(api_key="your_key", league="wsl")

events = wsl.list_events(status="completed")
odds = wsl.get_moneylines(events[0].id)

for o in sorted(odds["eventWinner"], key=lambda x: x["odds"])[:5]:
    ath = o["athlete"]
    marker = "✅" if o["settlement"] == "WIN" else "  "
    print(f'{marker} {ath["firstName"]} {ath["lastName"]:20} odds {o["odds"]:6.2f}{o["settlement"]}')
   Molly Picklum        odds   3.50  → LOSE
   Caitlin Simmers      odds   3.88  → LOSE
   Erin Brooks          odds   5.49  → LOSE
✅ Gabriela Bryan        odds   6.46  → WIN
   Sawyer Lindblad      odds   7.00  → LOSE

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")

# 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 upcoming odds
events = client.list_events(status="upcoming", sort="asc")
for e in events:
    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["athlete"]
            print(f"  {ath['firstName']} {ath['lastName']:20} {w['probability']}%  ({w['odds']})")
        break

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")                     # pre-event
client.list_events(status="live")                         # in-progress
client.list_events(status="completed")                    # historical results
client.list_events(status=["live", "upcoming"])           # combine filters
client.get_event("event_id")                              # full detail
client.get_participants("event_id")                       # athletes/roster
client.get_heat_scores("event_id", "heat_id")            # scores/lap times

Odds

# 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 by name or alias
client.get_odds("event_id", "eventWinner")
client.get_odds("event_id", "moneyline")                  # aliases work

Parlays

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")

30 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
spr Supercross mxgp MXGP
nrx Nitrocross jaialai Jai Alai
fdrift Formula Drift nll National Lacrosse League
masl Major Arena Soccer nhra NHRA Drag Racing
powerslap Power Slap 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 mltt Major League Table Tennis
motocrs Motocross spectation Spectation
gsoc Global Soccer sprmtcrs Supermotocross
cdc CDC

Links

License

MIT

Project details


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.3.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

altsportsdata-2.1.3-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file altsportsdata-2.1.3.tar.gz.

File metadata

  • Download URL: altsportsdata-2.1.3.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for altsportsdata-2.1.3.tar.gz
Algorithm Hash digest
SHA256 7966e5c7245c494ad00576af26befa03d5cfc1021a932bcf5d878c4f794db0fc
MD5 e46befcd3ea5f64b5455f1441c73a4d8
BLAKE2b-256 795908e92ee314095182db4d4a10436de6c063969b3e64989a4b8d6c9968eaab

See more details on using hashes here.

File details

Details for the file altsportsdata-2.1.3-py3-none-any.whl.

File metadata

  • Download URL: altsportsdata-2.1.3-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for altsportsdata-2.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 55d6cdff79662caecbbfbdf2233b9ec397a4375385820d497b1983dc20ac9b0d
MD5 29dd5c4271eb732bafe6396b3e98b08c
BLAKE2b-256 27bc051bb92a067bf674a549db708377bd043c8d9a20c6c2784a726ab51f02cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page