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+

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.1.1.tar.gz (18.4 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.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for altsportsdata-2.1.1.tar.gz
Algorithm Hash digest
SHA256 865c666ee7c98bd04acb6b8c49299e5e99bbf16d292b99392ea67614b14766eb
MD5 3e6f0015c5cc177e43d04795b5a4e838
BLAKE2b-256 bda68cae34239c0adefb7c5de72fa3f836e138cba2526aed200aa591efd63df4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: altsportsdata-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 830b9a9045afb27a3cb7c8e9e3c1e445a6842583d6ee59f2503debead0654480
MD5 c9c74f66992c296fc22fd915ec91dd34
BLAKE2b-256 34c1f644c2c06b47e0e4c192912feefe59cd2cfb9cb16d9cffa599844718fc90

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