MLB Stats API Docs

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

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

Win probability

Per-play win probability across the game.

On this page

Try it

Path
https://statsapi.mlb.com/api/v1/game/744914/winProbability
const res = await fetch('https://statsapi.mlb.com/api/v1/game/744914/winProbability')
const data = await res.json()
curl -s 'https://statsapi.mlb.com/api/v1/game/744914/winProbability'

Reference

Path parameters

NameTypeRequiredDescription
gamePknumberyes

Game id from the schedule endpoint.

Response

Type: WinProbabilityResponse

/** `GET /api/v1/game/{gamePk}/winProbability` — array of play states (partial). */
export type WinProbabilityResponse = Array<Record<string, unknown>>

Notes

  • Returns a bare array (one entry per play), not an object wrapper.

Build with it

Live examples powered by this endpoint with real data. Inspiration — restyle and remix freely.

Win-probability graph

The momentum swing of the game plotted play-by-play as a single inline-SVG line.

Finding a game…

Example URLs

  • Win probability for a game: https://statsapi.mlb.com/api/v1/game/744914/winProbability