mlb_rosters: *Find MLB Rosters by Roster Type*

View source: R/mlb_rosters.R

mlb_rostersR Documentation

Find MLB Rosters by Roster Type

Description

Find MLB Rosters by Roster Type

Usage

mlb_rosters(team_id = NULL, season = NULL, date = NULL, roster_type = NULL)

Arguments

team_id

team_id to return team roster information for a particular club. Look up ids with mlb_teams() – e.g. mlb_teams(season = 2025, sport_ids = 1) returns team_id alongside team_full_name.

season

Year to return team roster information for a particular club in a specific season.

date

Date to return team roster and their coaching staff directorial information for a particular team.

roster_type

roster_type to return team directorial information for. See mlb_roster_types() for more options. Valid options include: '40Man', 'fullSeason', 'fullRoster', 'nonRosterInvitees', 'active', 'allTime', 'depthChart', 'gameday', 'coach'

Value

Returns a tibble with one row per roster member with the following columns (player roster types). The coach roster type instead returns job, job_id, and title columns in place of the position/status columns:

col_name types description
jersey_number character Player's uniform number.
person_id integer MLBAM player ID.
person_full_name character Player's full name.
person_link character API link to the player resource.
position_code character Numeric scorekeeping position code.
position_name character Full position name.
position_type character Position category (e.g. 'Infielder').
position_abbreviation character Position abbreviation (e.g. 'SS').
status_code character Roster status code (e.g. 'A').
status_description character Roster status description (e.g. 'Active').
link character API link to the team roster resource.
team_id integer MLBAM team ID.
roster_type character Roster type returned.
season numeric Season requested.
date character Date requested, or NA if not supplied.

Examples


  try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'active'))
  try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'coach'))


baseballr documentation built on Aug. 27, 2026, 1:07 a.m.