GET/api/v1/game/{gamePk}/playByPlay
Play-by-play
Every play and pitch event for a game.
On this page
Try it
https://statsapi.mlb.com/api/v1/game/744914/playByPlayconst res = await fetch('https://statsapi.mlb.com/api/v1/game/744914/playByPlay')
const data = await res.json()curl -s 'https://statsapi.mlb.com/api/v1/game/744914/playByPlay'
Reference
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
gamePk | number | yes | Game id from the schedule endpoint. |
Response
Type: PlayByPlayResponse
/** `GET /api/v1/game/{gamePk}/playByPlay` — partial. */
export interface PlayByPlayResponse extends WithCopyright {
allPlays: unknown[]
currentPlay?: Record<string, unknown>
scoringPlays: number[]
playsByInning: unknown[]
}Build with it
Live examples powered by this endpoint with real data. Inspiration — restyle and remix freely.
Play-by-play ticker
The most recent plays with the running score, newest on top.
Finding a game…
Example URLs
- Play-by-play for a game:
https://statsapi.mlb.com/api/v1/game/744914/playByPlay