Skip to contents

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.

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 the following columns:

col_nametypes
jersey_numbercharacter
person_idinteger
person_full_namecharacter
person_linkcharacter
position_codecharacter
position_namecharacter
position_typecharacter
position_abbreviationcharacter
status_codecharacter
status_descriptioncharacter
linkcharacter
team_idinteger
roster_typecharacter
seasonnumeric
datecharacter

Examples

# \donttest{
  try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'active'))
#> ── MLB Roster data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:40 UTC
#> # A tibble: 49 × 15
#>    jersey_number person_id person_full_name person_link    position_code
#>    <chr>             <int> <chr>            <chr>          <chr>        
#>  1 13               605113 Nick Ahmed       /api/v1/peopl… 6            
#>  2 35               542882 Matt Andriese    /api/v1/peopl… 1            
#>  3 5                488671 Alex Avila       /api/v1/peopl… 2            
#>  4 33               545332 Jake Barrett     /api/v1/peopl… 1            
#>  5 31               502202 Brad Boxberger   /api/v1/peopl… 1            
#>  6 61               611093 Silvino Bracho   /api/v1/peopl… 1            
#>  7 25               605151 Archie Bradley   /api/v1/peopl… 1            
#>  8 19               593647 Sócrates Brito   /api/v1/peopl… 9            
#>  9 32               453329 Clay Buchholz    /api/v1/peopl… 1            
#> 10 40               605177 Andrew Chafin    /api/v1/peopl… 1            
#> # ℹ 39 more rows
#> # ℹ 10 more variables: position_name <chr>, position_type <chr>,
#> #   position_abbreviation <chr>, status_code <chr>,
#> #   status_description <chr>, link <chr>, team_id <int>,
#> #   roster_type <chr>, season <dbl>, date <chr>
  try(mlb_rosters(team_id = 109, season = 2018, roster_type = 'coach'))
#> ── MLB Roster data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:40 UTC
#> # A tibble: 20 × 12
#>    jersey_number job             job_id title person_id person_full_name
#>    <chr>         <chr>           <chr>  <chr>     <int> <chr>           
#>  1 "17"          Manager         MNGR   Mana…    117950 Torey Lovullo   
#>  2 "82"          Bench Coach     COAB   Benc…    110529 Jeff Banister   
#>  3 "12"          Bench Coach     COAB   Benc…    119655 Jerry Narron    
#>  4 "18"          Hitting Coach   COAT   Hitt…    118132 Dave Magadan    
#>  5 "74"          Hitting Coach   COAT   Hitt…    458628 Joe Mather      
#>  6 "75"          Assistant Hitt… COAA   Assi…    113702 Damion Easley   
#>  7 "78"          Assistant Hitt… COAA   Assi…    572913 Drew Hedman     
#>  8 "73"          Assistant Hitt… COAA   Assi…    430907 Rick Short      
#>  9 "23"          Pitching Coach  COAP   Pitc…    111807 Mike Butcher    
#> 10 "72"          Pitching Coach  COAP   Pitc…    122884 Brent Strom     
#> 11 "76"          Assistant Pitc… COPA   Assi…    112004 Dan Carlson     
#> 12 "39"          First Base Coa… COA1   Firs…    118763 Dave McKay      
#> 13 "21"          Third Base Coa… COA3   Thir…    120418 Tony Perezchica 
#> 14 "71"          Bullpen Coach   COAU   Bull…    114097 Mike Fetters    
#> 15 "59"          Assistant Hitt… COAA   Assi…    117420 Tim Laker       
#> 16 "7"           Quality Contro… QCCC   Qual…    425631 Robby Hammock   
#> 17 "60"          Coach           COAC   Majo…    468222 Luis Urueta     
#> 18 "83"          Bullpen Catcher BCAT   Bull…    461861 Mark Reed       
#> 19 "84"          Bullpen Catcher BCAT   Bull…    279827 Humberto Quinte…
#> 20 ""            Senior Basebal… SBAD   Seni…    678771 Shawn Marette   
#> # ℹ 6 more variables: person_link <chr>, link <chr>, team_id <int>,
#> #   roster_type <chr>, season <dbl>, date <chr>
# }