ESPN game summary
Everything ESPN has for one game: header (teams, score, status, venue), game info (venue, attendance, officials, weather), box score (team statistics and every player's stats by category), leaders, plays (play-by-play with clock, score, coordinates and participants) or drives (football), scoring plays, win probability by play, odds and against-the-spread, injuries, rosters/line-ups (soccer, baseball), key events and commentary (soccer), at-bats (baseball), season series, last five games, standings, related news and the recap headline. Use sections to return only some parts.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
leaguerequired | string | League slug: nfl, college-football, nba, wnba, mens-college-basketball, womens-college-basketball, mlb, nhl, soccer competitions (eng.1 Premier League, esp.1 LaLiga, ita.1, ger.1, fra.1, usa.1 MLS, uefa.champions, uefa.europa, fifa.world ...), f1, irl, nascar-premier, pga, lpga, atp, wta, ufc. Other ESPN leagues work with sport. Example: nba |
sport | football | basketball | baseball | hockey | soccer | racing | golf | tennis | mma | lacrosse | volleyball | rugby | field-hockey | water-polo | australian-football | rugby-league | cricket | boxing | Only needed for a league not listed under league (it is inferred for those). |
event_idrequired | string | ESPN event id from /espn/v1/scoreboard or /espn/v1/schedule (401656363 = 2024 NBA Finals game 5). Example: 401656363 |
sections | string | Comma-separated subset: header, boxscore, leaders, plays, drives, scoring_plays, win_probability, odds, injuries, rosters, key_events, commentary, game_info, standings, season_series, last_five_games, news, at_bats (default: all). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/espn/v1/game?league=nba&event_id=401656363" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/espn/v1/game",
params={"league": "nba", "event_id": "401656363"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/espn/v1/game");
url.searchParams.set("league", "nba");
url.searchParams.set("event_id", "401656363");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).