STAT-API

MLB team_player_rosters API

team_player_rostersmlb.team_player_rosters
Day-by-day player-to-team affiliations across the MLB season — who was on each 40-man roster, who was on the IL, who was optioned to the minors, and who was designated for assignment.
GET/api/v1/mlb/team_player_rosters
Requires one of: team_id — requests satisfying none of these return 400.
Parameters
team_idquerybigintoptional
Filter by team.
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_player_rosters?team_id=1'
Responses
200team_player_rosters rows matching the declared filter set, wrapped in { team_player_rosters, 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(9 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
player_id
bigint—
e.g. 165
season_id
bigint—
e.g. 2024
team_id
bigint—
e.g. 30
day
integer——
e.g. 20260621
position
stringnullable——
Values:PCRF3BLF2B1BCFSSDHOFIFTWP
position_depth
integernullable——
e.g. 1
position_group
stringnullable——
Values:PitcherInfielderOutfielderCatcherHitterTwo-Way Player
roster_type
string——
Values:40ManactivefullSeason
GET/api/v1/mlb/team_player_rosters/{id}
Parameters
idpathbigintrequired
Primary key (id) of the team_player_roster 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_player_rosters/{pk_value}'
Responses
200Single team_player_roster row.application/jsonshow example ▸
404Row not found.
Response Schema(9 fields)show schema ▸
FieldTypeReferencesDescription
idkey
bigint—Primary Key
player_id
bigint—
e.g. 165
season_id
bigint—
e.g. 2024
team_id
bigint—
e.g. 30
day
integer——
e.g. 20260621
position
stringnullable——
Values:PCRF3BLF2B1BCFSSDHOFIFTWP
position_depth
integernullable——
e.g. 1
position_group
stringnullable——
Values:PitcherInfielderOutfielderCatcherHitterTwo-Way Player
roster_type
string——
Values:40ManactivefullSeason