Skip to contents

Find Biographical Information for MLB Players

Usage

mlb_people(person_ids = NULL)

Arguments

person_ids

MLBAMIDs for players of interest. Multiple IDs should be provided in a vector separated by a comma.

Value

Returns a tibble with the following columns:

col_nametypesdescription
idintegerMLB person id (MLBAMID).
full_namecharacterPlayer full name.
linkcharacterAPI relative link to the player.
first_namecharacterPlayer first name.
last_namecharacterPlayer last name.
primary_numbercharacterPlayer primary jersey number.
birth_datecharacterPlayer birth date (YYYY-MM-DD).
current_ageintegerPlayer current age in years.
birth_citycharacterPlayer birth city.
birth_state_provincecharacterPlayer birth state or province.
birth_countrycharacterPlayer birth country.
heightcharacterPlayer height (e.g. "6' 2\"").
weightintegerPlayer weight in pounds.
activelogicalWhether the player is currently active.
use_namecharacterPlayer preferred display first name.
use_last_namecharacterPlayer preferred display last name.
middle_namecharacterPlayer middle name.
boxscore_namecharacterPlayer short box score name.
nick_namecharacterPlayer nickname.
gendercharacterPlayer gender code (e.g. 'M').
is_playerlogicalWhether the person is classified as a player.
is_verifiedlogicalWhether the player profile is verified.
draft_yearintegerYear the player was drafted.
mlb_debut_datecharacterPlayer MLB debut date (YYYY-MM-DD).
name_first_lastcharacterPlayer name in first-last order.
name_slugcharacterURL slug for the player (name plus id).
first_last_namecharacterPlayer name in first-last order.
last_first_namecharacterPlayer name in last, first order.
last_init_namecharacterPlayer name as last, first initial.
init_last_namecharacterPlayer name as first initial last.
full_fml_namecharacterPlayer full first-middle-last name.
full_lfm_namecharacterPlayer full last, first-middle name.
strike_zone_topnumericTop of the player's strike zone (feet).
strike_zone_bottomnumericBottom of the player's strike zone (feet).
pronunciationcharacterPhonetic pronunciation of the player's name.
last_played_datecharacterDate the player last played (YYYY-MM-DD), if inactive.
primary_position_codecharacterPrimary position code.
primary_position_namecharacterPrimary position name (e.g. 'First Base').
primary_position_typecharacterPrimary position type (e.g. 'Infielder').
primary_position_abbreviationcharacterPrimary position abbreviation (e.g. '1B').
bat_side_codecharacterBatting side code (e.g. 'R').
bat_side_descriptioncharacterBatting side description (e.g. 'Right').
pitch_hand_codecharacterThrowing hand code (e.g. 'R').
pitch_hand_descriptioncharacterThrowing hand description (e.g. 'Right').

Examples

# \donttest{
  try(mlb_people(person_ids = 502671))
#> ── MLB People data from MLB.com ───────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:44 UTC
#> # A tibble: 1 × 42
#>       id full_name  link  first_name last_name primary_number birth_date
#>    <int> <chr>      <chr> <chr>      <chr>     <chr>          <chr>     
#> 1 502671 Paul Gold… /api… Paul       Goldschm… 48             1987-09-10
#> # ℹ 35 more variables: current_age <int>, birth_city <chr>,
#> #   birth_state_province <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>, is_player <lgl>, is_verified <lgl>, draft_year <int>,
#> #   mlb_debut_date <chr>, name_first_last <chr>, name_slug <chr>,
#> #   first_last_name <chr>, last_first_name <chr>, …
  try(mlb_people(person_ids = c(502671,605151)))
#> ── MLB People data from MLB.com ───────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:44 UTC
#> # A tibble: 2 × 44
#>       id full_name  link  first_name last_name primary_number birth_date
#>    <int> <chr>      <chr> <chr>      <chr>     <chr>          <chr>     
#> 1 502671 Paul Gold… /api… Paul       Goldschm… 48             1987-09-10
#> 2 605151 Archie Br… /api… Archie     Bradley   25             1992-08-10
#> # ℹ 37 more variables: current_age <int>, birth_city <chr>,
#> #   birth_state_province <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>, is_player <lgl>, is_verified <lgl>, draft_year <int>,
#> #   mlb_debut_date <chr>, name_first_last <chr>, name_slug <chr>,
#> #   first_last_name <chr>, last_first_name <chr>, …
# }