视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
espn-api【文档与办公】Raw reference for ESPN's undocumented public JSON endpoints, for a sport, league, or operation that no dedicated sports-skills skill covers, or when a developer explicitly asks to work with raw ESPN endpoints. Prompt-only: endpoint catalog, documented league slugs, observed response shapes, pitfalls, and stdlib fetch helpers. Output is provider-nativ…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: espn-api description: | Raw reference for ESPN's undocumented public JSON endpoints, for a sport, league, or operation that no dedicated sports-skills skill covers, or when a developer explicitly asks to work with raw ESPN endpoints. Prompt-only: endpoint catalog, documented league slugs, observed response shapes, pitfalls, and stdlib fetch helpers. Output is provider-native ESPN JSON, not normalized or canonical data.
Use when: the requested league or operation is genuinely not covered by a dedicated skill (e.g. MMA, lacrosse, rugby, Australian football, NCAA volleyball, field hockey, water polo, IndyCar/NASCAR), or the user explicitly asks to write, debug, or inspect code against ESPN endpoints.
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.
The existing skills and the sports-skills CLI are the normal default. Use this skill only when no dedicated skill covers the league and operation, or when the developer explicitly asks for raw ESPN endpoints.
| Request | Use instead |
|---|---|
| NBA, WNBA, NFL, NHL, MLB | nba-data, wnba-data, nfl-data, nhl-data, mlb-data |
| NCAA football / NCAA men's basketball | cfb-data / cbb-data |
Soccer leagues listed by football-data | football-data |
| ATP/WTA tennis, PGA/LPGA/DP World golf, cricket | tennis-data, golf-data, cricket-data |
| Formula 1 | fastf1 |
| Dutch (Nevobo) volleyball | volleyball-data — it does not cover NCAA volleyball |
| News headlines / written articles | sports-news / sports-reporter |
| Odds math, cross-market comparison, prediction markets | betting, markets, kalshi, polymarket |
sports_skills response envelope ({"status", "data", "message"}), not a canonical observation, and not interchangeable across sports — the same endpoint name can return different shapes per sport and per season phase.sports_skills.canonical (canonicalize_event / to_observation + to_envelope for football, canonicalize_nba_event for NBA) or the CLI's --format=machina-canonical on football get_event_summary / football get_daily_schedule. Those take the package's normalized events, not raw ESPN JSON. Never hand-build a canonical document from this skill's output."2025-03-15T00:00Z" is minute precision — do not add seconds or a time zone guess), record the request URL and fetch time as provenance, and leave missing fields missing (not 0, "", or a guess). Report uncertainty when a shape differs from the references.espn_s2, SWID) or any other credential.SPORTS_SKILLS_REPLAY. Both helpers refuse to run, before any network access, when SPORTS_SKILLS_REPLAY is set to anything other than off (record, replay, fill). Do not use raw URLs in offline or replay evaluations either; use the supported sports-skills package runtime there.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 | Cross-league news headlines; can be thin or stale — prefer Site API news |
The NBA URLs below show URL shape only; for NBA data itself, use nba-data.
curl "https://site.api.espn.com/apis/site/v2/sports/{sport}/{league}/scoreboard"
# Example: Premier Lacrosse League scores
curl "https://site.api.espn.com/apis/site/v2/sports/lacrosse/pll/scoreboard"
# Scores for a specific date
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/scoreboard?dates=20250315"
# 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"
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams"
# Team IDs: look them up from the teams endpoint first
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/teams/9/roster"
curl "https://site.api.espn.com/apis/site/v2/sports/basketball/nba/summary?event={eventId}"
# 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/3975/stats"
curl "https://site.web.api.espn.com/apis/common/v3/sports/basketball/nba/athletes/3975/gamelog"
# Raw sportsbook lines only. For odds math or market comparison use betting / markets.
curl "https://sports.core.api.espn.com/v2/sports/basketball/leagues/nba/events/{eventId}/competitions/{eventId}/odds"
curl "https://site.api.espn.com/apis/site/v2/sports/football/nfl/injuries"
# Preferred: league-scoped Site API news
curl "https://site.api.espn.com/apis/site/v2/sports/lacrosse/pll/news?limit=20"
# Now API: cross-league headlines under headlines[] and breakingNews[].
# Results can be few or stale; check each item's published time.
curl "https://now.core.api.espn.com/v1/sports/news?limit=20"
# Returns gamepackageJSON with drives, plays, win probability, boxscore, odds
curl "https://cdn.espn.com/core/nba/game?xhr=1&gameId={eventId}"
curl "https://cdn.espn.com/core/nfl/boxscore?xhr=1&gameId={eventId}"
| 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 |
| Type | Value | Description |
|---|---|---|
| Preseason | 1 | Exhibition/preseason games |
| Regular Season | 2 | Regular season |
| Postseason | 3 | Playoffs/postseason |
| Off Season | 4 | Off season |
When filtering odds by provider:
| Provider | ID |
|---|---|
| Caesars | 38 |
| FanDuel | 37 |
| DraftKings | 41 |
| BetMGM | 58 |
| ESPN BET | 68 |
| Bet365 | 2000 |
When the user wants to write code that calls the ESPN API:
import requests
def get_pll_scoreboard(date=None):
url = "https://site.api.espn.com/apis/site/v2/sports/lacrosse/pll/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.get("events", [])
async function getPLLScoreboard(date?: string) {
const url = new URL("https://site.api.espn.com/apis/site/v2/sports/lacrosse/pll/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 ?? [];
}
User-Agent header to identify your appUser says: "Show me this week's Premier Lacrosse League scores" User says: "Get the latest AFL ladder from ESPN" User says: "Write a Python client for ESPN's NCAA women's volleyball scoreboard endpoint"
Both helpers make live requests, are not covered by SPORTS_SKILLS_REPLAY, and exit with an error when it is set to a mode other than off.