STAT-API

MLB season_run_environments API

season_run_environmentsmlb.season_run_environments
League-wide offensive context per MLB season — average runs per game, league batting line, ERA, and the offensive baseline used to normalize player and team stats across eras.
GET/api/v1/mlb/season_run_environments
Requires one of: season_id — requests satisfying none of these return 400.
Parameters
season_idquerybigintoptional
Filter to a season. Defaults to the current season.
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/season_run_environments?season_id=2027'
Responses
200season_run_environments rows matching the declared filter set, wrapped in { season_run_environments, 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(10 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
season_id
bigint—
e.g. 2021
batting_average_on_balls_in_play
decimal—League average BABIP
e.g. 0.2930
fip_constant
decimal—FIP constant to scale FIP to ERA
e.g. 3.1340
home_run_per_fly_ball
decimal—League average HR/FB rate
e.g. 0.1390
runs_per_out
decimal—League average runs per out made
e.g. 0.2810
runs_per_plate_appearance
decimal—League average runs per plate appearance
e.g. 0.1250
strikeout_rate
decimal—League average strikeout rate
e.g. 0.2440
updated_date
timestamptz——
e.g. 2026-04-12T02:04:46.337Z
walk_rate
decimal—League average walk rate
e.g. 0.0890
GET/api/v1/mlb/season_run_environments/{id}
Parameters
idpathbigintrequired
Primary key (id) of the season_run_environment 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/season_run_environments/{pk_value}'
Responses
200Single season_run_environment row.application/jsonshow example ▸
404Row not found.
Response Schema(10 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
season_id
bigint—
e.g. 2021
batting_average_on_balls_in_play
decimal—League average BABIP
e.g. 0.2930
fip_constant
decimal—FIP constant to scale FIP to ERA
e.g. 3.1340
home_run_per_fly_ball
decimal—League average HR/FB rate
e.g. 0.1390
runs_per_out
decimal—League average runs per out made
e.g. 0.2810
runs_per_plate_appearance
decimal—League average runs per plate appearance
e.g. 0.1250
strikeout_rate
decimal—League average strikeout rate
e.g. 0.2440
updated_date
timestamptz——
e.g. 2026-04-12T02:04:46.337Z
walk_rate
decimal—League average walk rate
e.g. 0.0890