MLB Stats API Docs

Type to search endpoints by name, path, or keyword.

GET/api/v1/game/{gamePk}/playByPlay

Play-by-play

Every play and pitch event for a game.

On this page

Try it

Path
https://statsapi.mlb.com/api/v1/game/744914/playByPlay
const 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

NameTypeRequiredDescription
gamePknumberyes

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