Skip to contents

MLB Team Alumni

Usage

mlb_team_alumni(team_id = NULL, stat_group = NULL, season = NULL)

Arguments

team_id

Team ID to return information and ranking for a particular statistic for a particular team.

stat_group

Stat group to return information and ranking for a particular statistic in a particular group.

season

Year to return information and ranking for a particular statistic in a given year.

Value

Returns a tibble with the following columns

col_nametypesdescription
player_idintegerMLBAM player ID.
player_full_namecharacterPlayer full name.
linkcharacterAPI link to the player resource.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
primary_numbercharacterPrimary uniform number.
birth_datecharacterDate of birth (YYYY-MM-DD).
current_ageintegerCurrent age in years.
birth_citycharacterCity of birth.
birth_countrycharacterCountry of birth.
heightcharacterListed height (feet and inches).
weightintegerListed weight in pounds.
activelogicalWhether the player is currently active.
use_namecharacterPreferred first name for display.
use_last_namecharacterPreferred last name for display.
middle_namecharacterPlayer middle name.
boxscore_namecharacterName as shown in box scores.
nick_namecharacterPlayer nickname.
gendercharacterPlayer gender code.
name_matrilinealcharacterMatrilineal (maternal) surname.
is_playerlogicalWhether the person is a player.
is_verifiedlogicalWhether the profile is verified.
pronunciationcharacterPhonetic pronunciation of the name.
last_played_datecharacterDate of last MLB appearance.
mlb_debut_datecharacterMLB debut date (YYYY-MM-DD).
name_first_lastcharacterName in first-last order.
name_slugcharacterURL slug for the player.
first_last_namecharacterFirst and last name display.
last_first_namecharacterLast, first name display.
last_init_namecharacterLast name with first initial.
init_last_namecharacterFirst initial with last name.
full_fml_namecharacterFull first-middle-last name.
full_lfm_namecharacterFull last-first-middle name.
strike_zone_topnumericTop of the player's strike zone (feet).
strike_zone_bottomnumericBottom of the player's strike zone (feet).
alumni_last_seasoncharacterLast season the player was with the team.
birth_state_provincecharacterState or province of birth.
draft_yearintegerYear the player was drafted.
primary_position_codecharacterPrimary position code.
primary_position_namecharacterPrimary position name.
primary_position_typecharacterPrimary position type.
primary_position_abbreviationcharacterPrimary position abbreviation.
bat_side_codecharacterBatting side code (L/R/S).
bat_side_descriptioncharacterBatting side description.
pitch_hand_codecharacterThrowing hand code (L/R).
pitch_hand_descriptioncharacterThrowing hand description.

Examples

# \donttest{
  try(mlb_team_alumni(team_id = 137, stat_group = 'hitting', season = 2021))
#> ── MLB Team Alumni data from MLB.com ──────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:56 UTC
#> # A tibble: 43 × 46
#>    player_id player_full_name  link  first_name last_name primary_number
#>        <int> <chr>             <chr> <chr>      <chr>     <chr>         
#>  1    501303 Ehire Adrianza    /api… Ehire      Adrianza  6             
#>  2    542881 Tyler Anderson    /api… Tyler      Anderson  31            
#>  3    641312 Shaun Anderson    /api… Shaun      Anderson  NA            
#>  4    624414 Christian Arroyo  /api… Christian  Arroyo    39            
#>  5    623214 Abiatal Avelino   /api… Abiatal    Avelino   NA            
#>  6    642772 Luis Alexander B… /api… Luis       Basabe    NA            
#>  7    542963 Rob Brantly       /api… Robert     Brantly   NA            
#>  8    518516 Madison Bumgarner /api… Madison    Bumgarner 40            
#>  9    502239 Trevor Cahill     /api… Trevor     Cahill    NA            
#> 10    593525 Orlando Calixte   /api… Orlando    Calixte   16            
#> # ℹ 33 more rows
#> # ℹ 40 more variables: birth_date <chr>, current_age <int>,
#> #   birth_city <chr>, birth_country <chr>, height <chr>, weight <int>,
#> #   active <lgl>, use_name <chr>, use_last_name <chr>,
#> #   middle_name <chr>, boxscore_name <chr>, nick_name <chr>,
#> #   gender <chr>, name_matrilineal <chr>, is_player <lgl>,
#> #   is_verified <lgl>, pronunciation <chr>, last_played_date <chr>, …
# }