MLB games API
games
mlb.gamesEvery scheduled and played MLB game — spring training exhibitions, the 162-game regular season, the Wild Card Series, the Division and Championship Series, and the World Series.
GET/api/v1/mlb/gamesList games for MLB
Requires one of:
season_id — requests satisfying none of these return 400.Parameters
season_idquerybigintoptionalFilter to a season. Defaults to the current season.
home_team_idquerybigintoptionalFilter by home team.
away_team_idquerybigintoptionalFilter by away team.
statusquerystringoptionalFilter by game status.
dayqueryintegeroptionalFilter by calendar day (YYYYMMDD integer, US Eastern) — e.g. day=20260609 for today's slate. season_id defaults to the current season; pass it explicitly for past-season days. Range syntax: day__gte=, day__lte=, day__between=.
limitqueryintegeroptionaldefault 50Page size. Defaults to 50; max 5000.
from_idquerybigintoptionalReturn 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/games?season_id=2027'Responses
200games rows matching the declared filter set, wrapped in { games, 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/jsonResponse Schema(31 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
away_team_id | bigint | — e.g. 38 | |
home_team_id | bigint | — e.g. 33 | |
league_game_id | integernullable | — | Official MLB gamePk (issued by the league) e.g. 745080 |
league_id | stringnullable | — | Official MLB game identifier e.g. — (all-null in sample) |
losing_pitcher_id | bigintnullable | Losing pitcher of record e.g. 1177 | |
save_pitcher_id | bigintnullable | Save pitcher (if any) e.g. 1415 | |
season_id | bigint | — e.g. 2025 | |
venue_id | bigintnullable | — e.g. 16 | |
winning_pitcher_id | bigintnullable | Winning pitcher of record e.g. 272 | |
attendance | integernullable | — | — e.g. — (all-null in sample) |
away_team_score | integer | — | — e.g. 3 |
channel | stringnullable | — | — e.g. MLBN (out-of-market only) |
day | integer | — | — e.g. 20180317 |
day_night | stringnullable | — | D=Day, N=Night e.g. — (all-null in sample) |
doubleheader | boolean | — | — Values:falsetrue |
duration_minutes | integernullable | — | Total game duration in minutes e.g. — (all-null in sample) |
end_time | timestamptznullable | — | — e.g. — (all-null in sample) |
game_label | stringnullable | — | — e.g. Regular Season Game 1 |
game_number | integer | — | For doubleheaders: 1 or 2 e.g. 1 |
game_time | timestamptz | — | Canonical game start time. The ONLY one on any games table — nba and nfl carried a duplicate `start_time` until 2026-08-27 and nhl carried `date_time` and `date_time_utc`; all four sports now expose `game_time` alone. e.g. 2018-03-17T17:05:00.000Z |
game_type | string | — | R=Regular, S=Spring, F=Wild Card, D=Division, L=League, W=World Series, E=Exhibition, A=All-Star Values:RSDFLW |
home_team_score | integer | — | — e.g. 4 |
if_necessary | booleannullable | — | — e.g. false |
neutral_venue | boolean | — | — e.g. false |
postponed_status | stringnullable | — | — e.g. — (all-null in sample) |
season_type | string | — | Canonical season phase. Postseason round detail (Wild Card/Division/LCS/World Series) is in the league-native `game_type` code. Values:regular_seasonspring_trainingpostseason |
series_game_number | stringnullable | — | — e.g. 1 |
series_name | stringnullable | — | — Values:Regular SeasonSpring TrainingNL Division SeriesAL Division SeriesAL Championship SeriesWorld SeriesAL Wild Card SeriesNL Wild Card SeriesNL Championship Series |
series_text | stringnullable | — | — Values:1-02-12-01-13-03-12-24-00-03-23-34-34-15-04-2 |
status | string | — | Final, Live, Scheduled, Postponed, Suspended, Cancelled Values:FinalCompleted EarlyCancelled |
GET/api/v1/mlb/games/{id}Get a single game by id
Parameters
idpathbigintrequiredPrimary key (id) of the game 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/games/{pk_value}'Responses
200Single game row.application/jsonshow example ▸
404Row not found.
Response Schema(31 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
away_team_id | bigint | — e.g. 38 | |
home_team_id | bigint | — e.g. 33 | |
league_game_id | integernullable | — | Official MLB gamePk (issued by the league) e.g. 745080 |
league_id | stringnullable | — | Official MLB game identifier e.g. — (all-null in sample) |
losing_pitcher_id | bigintnullable | Losing pitcher of record e.g. 1177 | |
save_pitcher_id | bigintnullable | Save pitcher (if any) e.g. 1415 | |
season_id | bigint | — e.g. 2025 | |
venue_id | bigintnullable | — e.g. 16 | |
winning_pitcher_id | bigintnullable | Winning pitcher of record e.g. 272 | |
attendance | integernullable | — | — e.g. — (all-null in sample) |
away_team_score | integer | — | — e.g. 3 |
channel | stringnullable | — | — e.g. MLBN (out-of-market only) |
day | integer | — | — e.g. 20180317 |
day_night | stringnullable | — | D=Day, N=Night e.g. — (all-null in sample) |
doubleheader | boolean | — | — Values:falsetrue |
duration_minutes | integernullable | — | Total game duration in minutes e.g. — (all-null in sample) |
end_time | timestamptznullable | — | — e.g. — (all-null in sample) |
game_label | stringnullable | — | — e.g. Regular Season Game 1 |
game_number | integer | — | For doubleheaders: 1 or 2 e.g. 1 |
game_time | timestamptz | — | Canonical game start time. The ONLY one on any games table — nba and nfl carried a duplicate `start_time` until 2026-08-27 and nhl carried `date_time` and `date_time_utc`; all four sports now expose `game_time` alone. e.g. 2018-03-17T17:05:00.000Z |
game_type | string | — | R=Regular, S=Spring, F=Wild Card, D=Division, L=League, W=World Series, E=Exhibition, A=All-Star Values:RSDFLW |
home_team_score | integer | — | — e.g. 4 |
if_necessary | booleannullable | — | — e.g. false |
neutral_venue | boolean | — | — e.g. false |
postponed_status | stringnullable | — | — e.g. — (all-null in sample) |
season_type | string | — | Canonical season phase. Postseason round detail (Wild Card/Division/LCS/World Series) is in the league-native `game_type` code. Values:regular_seasonspring_trainingpostseason |
series_game_number | stringnullable | — | — e.g. 1 |
series_name | stringnullable | — | — Values:Regular SeasonSpring TrainingNL Division SeriesAL Division SeriesAL Championship SeriesWorld SeriesAL Wild Card SeriesNL Wild Card SeriesNL Championship Series |
series_text | stringnullable | — | — Values:1-02-12-01-13-03-12-24-00-03-23-34-34-15-04-2 |
status | string | — | Final, Live, Scheduled, Postponed, Suspended, Cancelled Values:FinalCompleted EarlyCancelled |