Skip to main content

Official Python SDK for the AltSportsData API - alternative sports odds, events, and futures data

Project description

AltSportsData SDK

PyPI Python 3.8+

The data feed for alternative sports betting.

One SDK. 31 leagues. Every market type. Built for sportsbooks, DFS platforms, and prediction markets.

pip install altsportsdata

30 Seconds to Your First Odds

from altsportsdata import AltSportsData

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

# What's live right now?
events = wsl.list_events(status="live")

# Pull moneylines
odds = wsl.get_moneylines(events[0].id)

# Build a parlay
parlay = wsl.calculate_parlay(events[0].id, picks=["odd_1", "odd_2", "odd_3"])
print(f"Combined odds: {parlay['combinedOdds']}")

Why AltSportsData

Problem Solution
Alt sports data is fragmented across dozens of sources One unified API — 31 leagues, standardized schema
Your team wastes weeks integrating each new sport Minutes to integrate — same SDK, same patterns
No odds available for niche sports your users want Full market coverage — moneylines, matchups, props, totals, futures, parlays
Existing feeds don't support your platform's format Sportsbook-native naming — use the terms your team already knows

Sportsbook-Native API

Use the names your trading team already knows. We alias everything.

# These all work — use whatever your team prefers
wsl.get_moneylines("evt_id")       # → eventWinner
wsl.get_matchups("evt_id")         # → headToHead
wsl.get_player_props("evt_id")     # → propBets
wsl.get_totals("evt_id")           # → overUnder
wsl.get_exactas("evt_id", n=3)     # → eventExacta

# Or use API-native names directly
wsl.get_odds("evt_id", "eventWinner")
wsl.get_odds("evt_id", "headToHead")

Full API Reference

Setup

from altsportsdata import AltSportsData

# Lock to a league — all queries auto-filter
wsl = AltSportsData(api_key="sk_live_xxx", league="wsl")
f1  = AltSportsData(api_key="sk_live_xxx", league="f1")
pbr = AltSportsData(api_key="sk_live_xxx", league="pbr")

# Or query across all leagues
client = AltSportsData(api_key="sk_live_xxx")

Leagues

client.list_leagues()     # all leagues with markets & tours
client.list_sports()      # alias

Events

# Filter by status — use plain English
client.list_events(status="upcoming")
client.list_events(status="live")
client.list_events(status="completed")
client.list_events(status=["live", "upcoming"])

# Date range
client.list_events(start_date="2024-04-01T00:00:00Z", end_date="2024-04-30T00:00:00Z")

# Single event
client.get_event("evt_id")

# Participants / athletes
client.get_participants("evt_id")

# Heat scores (action sports & racing)
client.get_heat_scores("evt_id", "heat_id")

Odds

# Sportsbook-native
client.get_moneylines("evt_id")                          # event winner
client.get_matchups("evt_id")                             # head-to-head
client.get_player_props("evt_id")                         # prop bets
client.get_totals("evt_id")                               # over/under
client.get_totals("evt_id", sub_market="points")          # with sub-market
client.get_heat_winners("evt_id")                         # heat winner (WSL/SLS/racing)
client.get_fastest_lap("evt_id")                          # fastest lap (racing)
client.get_exactas("evt_id", n=2)                         # exacta (2/3/4-way)
client.get_podiums("evt_id")                              # podium finish
client.get_shows("evt_id")                                # shows
client.get_dream_team("evt_id")                           # dream team

# Generic — pass any market type
client.get_odds("evt_id", "moneyline")                    # alias resolves automatically
client.get_odds("evt_id", "eventWinner")                  # API-native also works
client.get_odds("evt_id", "raceTop5")                     # all 17 market types supported

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

Parlays (SGP)

parlay = client.calculate_parlay("evt_id", picks=["odd_1", "odd_2", "odd_3"])
# → {"combinedOdds": 12.5, "combinedProbability": 0.08, "selections": [...]}

Futures

client.list_futures()
client.get_futures(tour="tour_id", type="winner")
client.get_futures(tour="tour_id", type="top3", league="f1")

Jai Alai

client.get_jaialai_matches("evt_id")
client.get_jaialai_odds("evt_id")    # moneyline, spread, totals per set

31 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
byb BYB Extreme Fighting gsoc Global Soccer
usac USAC Racing xgame X Games
motocrs Motocross motoamerica MotoAmerica
sprmtcrs Supermotocross hlrs Haulers
spr Supercross cdc CDC
athletesunlimited Athletes Unlimited lux Lux
raf RAF mltt Major League Table Tennis
spectation Spectation

Error Handling

from altsportsdata import AltSportsData, AuthenticationError, RateLimitError, NotFoundError

try:
    odds = wsl.get_moneylines("evt_id")
except AuthenticationError:
    print("Invalid API key")
except NotFoundError:
    print("Event not found")
except RateLimitError as e:
    print(f"Rate limited — retry in {e.retry_after}s")

Coming Soon

  • TypeScript SDK — same flat API, same aliases
  • Go SDK — for high-throughput pipelines
  • WebSocket feeds — real-time odds streaming
  • Webhook push — odds delivered to your endpoint
  • Pandas integrationclient.get_moneylines("evt_id", as_df=True)

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.0.1.tar.gz (18.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.0.1-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for altsportsdata-2.0.1.tar.gz
Algorithm Hash digest
SHA256 bb75fdbe2c71a494eddf0b370ffc477bf6f40cbbf2167b17de30a45c8715d760
MD5 7ca14eff9b8ee90a67f7d031c29fb60f
BLAKE2b-256 86c701e534537162593ac35ee09f58306c9407f85e8f25743470828b9a887203

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for altsportsdata-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 480c0f7499605911202f29b7b87a3cd8fc32ffce87f34f2cb1323d6b49214652
MD5 4efadf464d474f816d1e61c765a98159
BLAKE2b-256 7d02a80a48bdba6745e3196872e0363e6f2ecc4fdd27daa6839a39600e73e6c8

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