MLB Stats API Docs

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

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

Linescore

Runs by inning, plus current inning/outs/baserunners.

On this page

Try it

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

Reference

Path parameters

NameTypeRequiredDescription
gamePknumberyes

Game id from the schedule endpoint.

Response

Type: LinescoreResponse

/** `GET /api/v1/game/{gamePk}/linescore` — partial. */
export interface LinescoreResponse extends WithCopyright {
	currentInning?: number
	currentInningOrdinal?: string
	inningState?: string
	scheduledInnings: number
	innings: unknown[]
	teams: Record<string, unknown>
	defense?: Record<string, unknown>
	offense?: Record<string, unknown>
	[key: string]: unknown
}

Build with it

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

Linescore grid

Runs by inning with the R/H/E totals, like the back of a ballpark scoreboard.

Finding a game…

Base-runner diamond

Bases, balls/strikes, and outs from the lightweight linescore endpoint.

Finding a game…

Example URLs

  • Linescore for a game: https://statsapi.mlb.com/api/v1/game/744914/linescore