STAT-API

MLB team_starting_lineups API

team_starting_lineupsmlb.team_starting_lineups
Each MLB team's starting lineup for each game — the nine batters in batting order plus the starting pitcher (and DH where applicable).
GET/api/v1/mlb/team_starting_lineups
Requires one of: team_id or game_id — requests satisfying none of these return 400.
Parameters
team_idquerybigintoptional
Filter by team.
game_idquerybigintoptional
Filter to a single game.
limitqueryintegeroptionaldefault 50
Page size. Defaults to 50; max 5000.
from_idquerybigintoptional
Return rows with id strictly greater than this value; page using the previous response's `next_from_id`. Omit on the first page.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  'https://api.stat-api.com/api/v1/mlb/team_starting_lineups?team_id=1'
Responses
200team_starting_lineups rows matching the declared filter set, wrapped in { team_starting_lineups, limit, next_from_id }. next_from_id is the last row's id on a full page — pass it back via ?from_id= to walk the full result; null marks the terminal page.application/jsonshow example ▸
400No declared filter set was satisfied — response body matches MissingRequiredFiltersError; pick one combo from the accepted-sets hint and resend.application/json
Response Schema(6 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
game_id
bigint—
e.g. 64
pitcher_id
bigintnullable—
e.g. 50028
team_id
bigint—
e.g. 27
batter_status
integer——
e.g. 1
pitcher_status
integer——
e.g. 1
GET/api/v1/mlb/team_starting_lineups/{id}
Parameters
idpathbigintrequired
Primary key (id) of the team_starting_lineup row.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  'https://api.stat-api.com/api/v1/mlb/team_starting_lineups/{pk_value}'
Responses
200Single team_starting_lineup row.application/jsonshow example ▸
404Row not found.
Response Schema(6 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
game_id
bigint—
e.g. 64
pitcher_id
bigintnullable—
e.g. 50028
team_id
bigint—
e.g. 27
batter_status
integer——
e.g. 1
pitcher_status
integer——
e.g. 1