Python SDK for multi-source sports data — ESPN, MLB, NBA, NFL, FotMob, Sofascore, and more
Project description
sportly
Python SDK for multi-source sports data — ESPN, MLB, NBA, NFL, FotMob, Sofascore, ESPN Fantasy, and NHL.
☕ Support This Project
| Platform | Link |
|---|---|
| ☕ Buy Me a Coffee | buymeacoffee.com/pseudo_r |
| 💖 GitHub Sponsors | github.com/sponsors/Kloverdevs |
| 💳 PayPal | PayPal (CAD) |
📱 Real-World Apps Built With sportly
| App | Store |
|---|---|
| 🏀 Sportly: Basketball Live | |
| ⚽ Sportly: Soccer Live | |
| 🏒 Sportly: NHL & Hockey Live | |
| 🏈 Sportly: American Football Live | |
| ⚾ Sportly: Baseball Live |
Install
pip install sportly
# Include Sofascore support (curl_cffi TLS impersonation)
pip install sportly[sofascore]
# All optional extras
pip install sportly[all]
Requires Python 3.12+.
Data Sources
| Module | Source | Auth | Special |
|---|---|---|---|
sportly.espn |
ESPN (17 sports, 139+ leagues) | None | 6 ESPN API domains |
sportly.nhl |
NHL Web API + NHL Stats REST | None | Official NHL data |
sportly.mlb |
MLB Stats API (statsapi.mlb.com) |
None | hydrate= embeds sub-resources |
sportly.nba |
NBA Stats API (stats.nba.com) |
WAF headers (auto-injected) | resultSets row-parser built-in |
sportly.nfl |
ESPN public NFL infrastructure | None | Wraps existing ESPN domains |
sportly.fantasy |
ESPN Fantasy v3 (lm-api-reads) |
Cookies (private leagues only) | Public leagues need no auth |
sportly.fotmob |
FotMob web API | None | xG, shot maps, player ratings |
sportly.sofascore |
Sofascore API v1 | curl_cffi TLS spoof |
pip install sportly[sofascore] |
Quick Start
# ── ESPN ──────────────────────────────────────────────────────────────
from sportly.espn import basketball, football, soccer, hockey
# NBA teams
teams = basketball.teams("nba")
# EPL standings
table = soccer.standings("eng.1")
# NHL scores
scores = hockey.scoreboard("nhl")
# ── MLB ───────────────────────────────────────────────────────────────
from sportly import mlb
games = mlb.schedule() # today
ohtani = mlb.player(660271) # Shohei Ohtani
hr = mlb.leaders("homeRuns", season=2025) # HR leaders
box = mlb.boxscore(745444) # game boxscore
# ── NBA ───────────────────────────────────────────────────────────────
from sportly import nba
sb = nba.scoreboard("2025-03-26")
shots = nba.shot_chart("201939", "2024-25") # Curry
top = nba.leaders("PTS", season="2024-25")
st = nba.standings("2024-25")
# ── NFL ───────────────────────────────────────────────────────────────
from sportly import nfl
sb = nfl.scoreboard(week=1, season=2024)
dc = nfl.depth_chart("6") # Cowboys
inj = nfl.injuries()
qbr = nfl.qbr(season=2024)
# ── ESPN Fantasy ──────────────────────────────────────────────────────
from sportly import fantasy
teams = fantasy.teams("ffl", league_id=336358, season=2025)
draft = fantasy.draft("ffl", league_id=336358, season=2025)
# Private league:
data = fantasy.league("ffl", league_id=123456, season=2025,
cookies={"espn_s2": "...", "SWID": "{...}"})
# ── FotMob ────────────────────────────────────────────────────────────
from sportly import fotmob
day = fotmob.matches("20260326") # today's matches
epl = fotmob.league(47) # Premier League
m = fotmob.match(4310531) # xG, lineups, ratings
# ── Sofascore ─────────────────────────────────────────────────────────
from sportly import sofascore # requires pip install sportly[sofascore]
games = sofascore.matches("football", "2026-03-26")
stats = sofascore.match_stats(11352523) # xG, possession
lineup = sofascore.lineups(11352523)
# ── NHL ───────────────────────────────────────────────────────────────
from sportly import nhl
today = nhl.schedule()
games = nhl.scoreboard()
roster = nhl.roster("TOR")
CLI
sportly info
# ESPN
sportly espn basketball teams --league nba
sportly espn football scoreboard --league nfl
sportly espn soccer standings --league eng.1
# NHL
sportly nhl teams
sportly nhl schedule --date 2024-04-15
ESPN Coverage (17 sports · 139+ leagues)
| Module | Default League | Notable Leagues |
|---|---|---|
espn.basketball |
nba |
WNBA, NCAA, NBL, FIBA |
espn.football |
nfl |
NCAAF, CFL, XFL, UFL |
espn.soccer |
eng.1 |
260+ leagues worldwide |
espn.hockey |
nhl |
NCAA |
espn.baseball |
mlb |
NCAA, WBC |
espn.cricket |
icc-cricket |
ICC T20/ODI, IPL |
espn.tennis |
atp |
WTA |
espn.golf |
pga |
LPGA, LIV, DP World |
espn.mma |
bellator |
LFA, Cage Warriors |
espn.racing |
f1 |
IndyCar, NASCAR |
espn.lacrosse |
pll |
NLL, NCAA |
espn.volleyball |
womens-college-volleyball |
NCAA |
espn.water_polo |
mens-college-water-polo |
NCAA |
espn.field_hockey |
womens-college-field-hockey |
NCAA |
espn.rugby |
180659 (Six Nations) |
24 competitions |
espn.rugby_league |
3 |
NRL, Super League |
espn.australian_football |
afl |
AFL |
ESPN Methods (per sport module)
| Method | Description |
|---|---|
teams(league) |
All teams |
team(id, league) |
Single team |
roster(team_id, league) |
Team roster |
scoreboard(league, date) |
Live scores / schedule |
game(id, league) |
Game summary |
news(league, limit) |
Latest news |
standings(league, season) |
League table |
injuries(league) |
Injury report |
transactions(league) |
Signings / trades |
athlete(id, league) |
Athlete profile |
athlete_stats(id, league) |
Season statistics |
athlete_gamelog(id, league) |
Game-by-game log |
odds(event_id, league) |
Betting odds |
play_by_play(event_id, league) |
Play-by-play |
cdn_game(game_id) |
Full CDN game package |
Documentation
- ESPN Overview
- Basketball · Football · Soccer · Hockey
- MLB · NBA · NFL
- ESPN Fantasy · FotMob · Sofascore
- NHL (Native)
Development
git clone https://github.com/pseudo-r/sportly
cd sportly
pip install -e .[dev]
pytest
License
MIT — see LICENSE
Disclaimer: This SDK uses undocumented public APIs. Not affiliated with ESPN, MLB, NBA, NFL, FotMob, Sofascore, or NHL.
Last updated: March 2026 · v1.1.0 · 8 sources · 17+ sports · 139+ leagues
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
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 sportly-1.1.0.tar.gz.
File metadata
- Download URL: sportly-1.1.0.tar.gz
- Upload date:
- Size: 65.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d58c53f79e2d860402ff82df1cf25ada220d3a4534a11c97d89cd784f75f567
|
|
| MD5 |
fb761538a393bfb480224391a5aa4b80
|
|
| BLAKE2b-256 |
529c7a7217dab1aa19b38200e9f59ab15e002f737f0a1e4733cea1334e05a57a
|
Provenance
The following attestation bundles were made for sportly-1.1.0.tar.gz:
Publisher:
publish.yml on pseudo-r/sportly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sportly-1.1.0.tar.gz -
Subject digest:
8d58c53f79e2d860402ff82df1cf25ada220d3a4534a11c97d89cd784f75f567 - Sigstore transparency entry: 1187634703
- Sigstore integration time:
-
Permalink:
pseudo-r/sportly@c8b34fb0c05f498e4bd3f7dc3bceee5e50afb8a2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/pseudo-r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c8b34fb0c05f498e4bd3f7dc3bceee5e50afb8a2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sportly-1.1.0-py3-none-any.whl.
File metadata
- Download URL: sportly-1.1.0-py3-none-any.whl
- Upload date:
- Size: 86.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23c84649df79d9f6384bd1056f3c16b0f5e40d96cca2dfc28a959b14c930923c
|
|
| MD5 |
e27219adaf487b9e5bd334039795e52b
|
|
| BLAKE2b-256 |
73ba313846dc9feb899d7a18a9289a0804ea9df5d0683081faf56ca0d3bb2f7f
|
Provenance
The following attestation bundles were made for sportly-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on pseudo-r/sportly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sportly-1.1.0-py3-none-any.whl -
Subject digest:
23c84649df79d9f6384bd1056f3c16b0f5e40d96cca2dfc28a959b14c930923c - Sigstore transparency entry: 1187634716
- Sigstore integration time:
-
Permalink:
pseudo-r/sportly@c8b34fb0c05f498e4bd3f7dc3bceee5e50afb8a2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/pseudo-r
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c8b34fb0c05f498e4bd3f7dc3bceee5e50afb8a2 -
Trigger Event:
release
-
Statement type: