agentleFS
sejalduasejaldua/espn-api/SKILL.md

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

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 1

    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
  1. Distinctive:

    When filtering odds by provider:

    line 133
  2. Distinctive:

    When the user wants to write code that calls the ESPN API:

    line 146
  3. Distinctive:

    Always set a timeout (30s recommended)

    line 176
  4. Very specific:

    Use User-Agent header to identify your app

    line 181

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Identify what the user needs (scores, standings, player stats, odds, etc.)
  2. Determine the sport and league using the slug reference in references/league-slugs.md
  3. Pick the right API domain and endpoint from references/endpoints.md
  4. Construct the URL and fetch the data
  5. Parse the JSON response using patterns from references/response-schemas.md
  6. Watch for common pitfalls documented in references/gotchas.md

API Domains

There are six ESPN API domains. Choose based on your data need:

DomainBase URLUse For
Site APIhttps://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/Scores, teams, rosters, news, injuries, game summaries
Site API v2https://site.api.espn.com/apis/v2/sports/{sport}/{league}/Standings only (the site/v2 path returns a stub for standings)
Core API v2https://sports.core.api.espn.com/v2/sports/{sport}/leagues/{league}/Athletes, detailed stats, odds, play-by-play, venues, coaches
Core API v3https://sports.core.api.espn.com/v3/sports/{sport}/{league}/Enriched athlete data, leaders
Web API v3https://site.web.api.espn.com/apis/common/v3/sports/{sport}/{league}/Player season stats, gamelogs, splits, leaderboards
CDNhttps://cdn.espn.com/core/{league-abbrev}/Full game packages (boxscore + plays + win prob). Requires ?xhr=1
Now APIhttps://now.core.api.espn.com/v1/sports/newsReal-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

ParameterDescriptionExample
datesDate filter (YYYYMMDD or range)20250315 or 20250301-20250331
seasonSeason year2025
seasontype1=preseason, 2=regular, 3=postseason, 4=offseason2
weekWeek number1
limitResults per page100
pagePage number1
groupsConference ID (college sports)8 (SEC)
xhrRequired for CDN endpoints1
activeFilter active athletestrue

Season Types

TypeValueDescription
Preseason1Exhibition/preseason games
Regular Season2Regular season
Postseason3Playoffs/postseason
Off Season4Off season

Betting Provider IDs

When filtering odds by provider:

ProviderID
Caesars38
FanDuel37
DraftKings41
BetMGM58
ESPN BET68
Bet3652000

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-Agent header 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.