ESPN play-by-play

GET https://api.api.sh/espn/v1/play-by-play
1 credit / call sports try it in the playground →

Every play of a game in order: id, period and clock, play text and type, team, running away and home score, scoring flag and points, time stamp, participants with names, and for football the drive and the down and distance. Basketball, hockey, baseball and football games return plays; soccer games return the key events or commentary. Filter by period or scoring_only.

Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
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, uefa.champions ...), f1, pga, atp, 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
period integer Only this period (quarter, half, inning or period number). Example: 2
scoring_only boolean true keeps only the scoring plays (default false). Example: false

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/espn/v1/play-by-play?league=nba&event_id=401656363" \
  -H "x-api-key: $APISH_KEY"

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).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.