Skip to contents

MLB Sport Players

Usage

mlb_sports_players(sport_id = 1, season = 2021)

Arguments

sport_id

The sport_id to return information for.

season

The season to return information for.

Value

Returns a tibble with the following columns:

col_nametypes
player_idinteger
full_namecharacter
linkcharacter
first_namecharacter
last_namecharacter
primary_numbercharacter
birth_datecharacter
current_ageinteger
birth_citycharacter
birth_countrycharacter
heightcharacter
weightinteger
activelogical
use_namecharacter
middle_namecharacter
boxscore_namecharacter
nick_namecharacter
gendercharacter
is_playerlogical
is_verifiedlogical
pronunciationcharacter
mlb_debut_datecharacter
name_first_lastcharacter
name_slugcharacter
first_last_namecharacter
last_first_namecharacter
last_init_namecharacter
init_last_namecharacter
full_fml_namecharacter
full_lfm_namecharacter
strike_zone_topnumeric
strike_zone_bottomnumeric
birth_state_provincecharacter
draft_yearinteger
name_matrilinealcharacter
name_titlecharacter
last_played_datecharacter
current_team_idinteger
current_team_namecharacter
current_team_linkcharacter
primary_position_codecharacter
primary_position_namecharacter
primary_position_typecharacter
primary_position_abbreviationcharacter
bat_side_codecharacter
bat_side_descriptioncharacter
pitch_hand_codecharacter
pitch_hand_descriptioncharacter

Examples

# \donttest{
  try(mlb_sports_players(sport_id = 1, season = 2021))
#> ── MLB Sports - Players data from MLB.com ─────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:46 UTC
#> # A tibble: 1,508 × 50
#>    player_id full_name        link   first_name last_name primary_number
#>        <int> <chr>            <chr>  <chr>      <chr>     <chr>         
#>  1    472551 Fernando Abad    /api/… Fernando   Abad      58            
#>  2    676265 Cory Abbott      /api/… Cory       Abbott    15            
#>  3    656061 Albert Abreu     /api/… Albert     Abreu     84            
#>  4    650556 Bryan Abreu      /api/… Bryan      Abreu     66            
#>  5    547989 José Abreu       /api/… José       Abreu     79            
#>  6    642758 Domingo Acevedo  /api/… Domingo    Acevedo   68            
#>  7    660670 Ronald Acuña Jr. /api/… Ronald     Acuña     13            
#>  8    592094 Jason Adam       /api/… Jason      Adam      60            
#>  9    642715 Willy Adames     /api/… Willy      Adames    27            
#> 10    613534 Austin Adams     /api/… Austin     Adams     54            
#> # ℹ 1,498 more rows
#> # ℹ 44 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>, is_player <lgl>, is_verified <lgl>,
#> #   pronunciation <chr>, mlb_debut_date <chr>, name_first_last <chr>, …
# }