espn-api
Skill12 starsChanged 7 months agoMITView on GitHub
Query ESPN's public API for live scores, standings, rosters, player stats, odds, play-by-play, injuries, transactions, news, and more across 17 sports and 139 leagues. Use when the user needs sports data from ESPN, wants to build a sports app, fetch scores or schedules, look up player or team stats, get betting odds, or pull any structured sports data. Triggers on mentions of ESPN, sports scores, standings, box scores, player stats, game data, or league data.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- machina-sports/sports-skillsedited, first seen Nov 14, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- machina-sports/sports-skills★ 27039% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 133
When filtering odds by provider:
- Distinctive: line 146
When the user wants to write code that calls the ESPN API:
- Distinctive: line 176
Always set a timeout (30s recommended)
- Very specific: line 181
Use User-Agent header to identify your app
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ESPN Public API Skill
You are an expert at using ESPN's undocumented public JSON APIs to fetch sports data. These APIs power espn.com and the ESPN mobile app. They require no authentication and return JSON.
Important: These are unofficial, undocumented APIs. They may change without notice. Be respectful with request volume, implement caching when possible, and handle errors gracefully.
How to Use This Skill
- Identify what the user needs (scores, standings, player stats, odds, etc.)
- Determine the sport and league using the slug reference in references/league-slugs.md
- Pick the right API domain and endpoint from references/endpoints.md
- Construct the URL and fetch the data
- Parse the JSON response using patterns from references/response-schemas.md
- Watch for common pitfalls documented in references/gotchas.md
API Domains
There are six ESPN API domains. Choose based on your data need:
| Domain | Base URL | Use For |
| Site API | https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/ | Scores, teams, rosters, news, injuries, game summaries |
| Site API v2 | https://site.api.espn.com/apis/v2/sports/{sport}/{league}/ | Standings only (the site/v2 path returns a stub for standings) |
| Core API v2 | https://sports.core.api.espn.com/v2/sports/{sport}/leagues/{league}/ | Athletes, detailed stats, odds, play-by-play, venues, coaches |
| Core API v3 | https://sports.core.api.espn.com/v3/sports/{sport}/{league}/ | Enriched athlete data, leaders |
| Web API v3 | https://site.web.api.espn.com/apis/common/v3/sports/{sport}/{league}/ | Player season stats, gamelogs, splits, leaderboards |
| CDN | https://cdn.espn.com/core/{league-abbrev}/ | Full game packages (boxscore + plays + win prob). Requires ?xhr=1 |
| Now API | https://now.core.api.espn.com/v1/sports/news | Real-time news feed |
Quick Start Recipes
Get today's scores for any league
curl "https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/scoreboard"
# Example: NBA scores today
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard"
# Scores for a specific date
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard?dates=20250315"Get standings
# IMPORTANT: Use /apis/v2/ NOT /apis/site/v2/ (the latter returns a stub)
curl "https://site.api.espn.com/apis/v2/sports/basketball/nba/standings"
curl "https://site.api.espn.com/apis/v2/sports/football/nfl/standings"Get all teams
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams"Get a team's roster
# Team IDs: look them up from the teams endpoint first
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams/13/roster"Get a full game summary (boxscore + plays + leaders)
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/summary?event=401765432"Get player season stats
# Uses the Web API v3 domain. Works for NFL, NBA, NHL, MLB.
curl "https://site.web.api.espn.com/apis/common/v3/sports/basketball/nba/athletes/3136776/stats"Get player game log
curl "https://site.web.api.espn.com/apis/common/v3/sports/basketball/nba/athletes/3136776/gamelog"Get betting odds for a game
curl "https://sports.core.api.espn.com/v2/sports/basketball/leagues/nba/events/{eventId}/competitions/{eventId}/odds"Get league-wide injury report
curl "https://site.api.espn.com/apis/site/v2/sports/football/nfl/injuries"Get real-time news
curl "https://now.core.api.espn.com/v1/sports/news?sport=basketball&league=nba&limit=20"Get full game package via CDN (richest data)
# Returns gamepackageJSON with drives, plays, win probability, boxscore, odds
curl "https://cdn.espn.com/core/nba/game?xhr=1&gameId=401765432"
curl "https://cdn.espn.com/core/nfl/boxscore?xhr=1&gameId=401671793"Common Query Parameters
| Parameter | Description | Example |
dates | Date filter (YYYYMMDD or range) | 20250315 or 20250301-20250331 |
season | Season year | 2025 |
seasontype | 1=preseason, 2=regular, 3=postseason, 4=offseason | 2 |
week | Week number | 1 |
limit | Results per page | 100 |
page | Page number | 1 |
groups | Conference ID (college sports) | 8 (SEC) |
xhr | Required for CDN endpoints | 1 |
active | Filter active athletes | true |
Season Types
| Type | Value | Description |
| Preseason | 1 | Exhibition/preseason games |
| Regular Season | 2 | Regular season |
| Postseason | 3 | Playoffs/postseason |
| Off Season | 4 | Off season |
Betting Provider IDs
When filtering odds by provider:
| Provider | ID |
| Caesars | 38 |
| FanDuel | 37 |
| DraftKings | 41 |
| BetMGM | 58 |
| ESPN BET | 68 |
| Bet365 | 2000 |
Writing Code
When the user wants to write code that calls the ESPN API:
Python (requests or httpx)
import requests
def get_nba_scoreboard(date=None):
url = "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard"
params = {}
if date:
params["dates"] = date # YYYYMMDD format
resp = requests.get(url, params=params, timeout=30)
resp.raise_for_status()
data = resp.json()
return data["events"]JavaScript/TypeScript (fetch)
async function getNBAScoreboard(date?: string) {
const url = new URL("https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard");
if (date) url.searchParams.set("dates", date);
const resp = await fetch(url.toString());
if (!resp.ok) throw new Error(`ESPN API error: ${resp.status}`);
const data = await resp.json();
return data.events;
}Best practices for ESPN API code
- Always set a timeout (30s recommended)
- Implement caching for data that does not change frequently (teams, standings, rosters)
- Handle 404s gracefully (invalid IDs, offseason endpoints)
- Handle 429s (rate limiting) with exponential backoff
- The API is undocumented, so always validate response shape before accessing nested fields
- Use
User-Agentheader to identify your app
For Deeper Reference
- Full endpoint catalog: references/endpoints.md
- All sport and league slugs: references/league-slugs.md
- JSON response schemas with examples: references/response-schemas.md
- Common pitfalls and gotchas: references/gotchas.md
- Python fetch helper: scripts/espn_fetch.py
- Bash fetch helper: scripts/espn_fetch.sh
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

