Skip to contents

MLB Sport IDs

Usage

mlb_sports(sport_id = NULL)

Arguments

sport_id

The sport_id to return information for.

Value

Returns a tibble with the following columns

col_nametypes
sport_idinteger
sport_codecharacter
sport_linkcharacter
sport_namecharacter
sport_abbreviationcharacter
sort_orderinteger
active_statuslogical

and the following values:

sport_idsport_codesport_linksport_namesport_abbreviationsort_orderactive_status
1mlb/api/v1/sports/1Major League BaseballMLB11TRUE
11aaa/api/v1/sports/11Triple-AAAA101TRUE
12aax/api/v1/sports/12Double-AAA201TRUE
13afa/api/v1/sports/13High-AA+301TRUE
14afx/api/v1/sports/14Low-AA401TRUE
16rok/api/v1/sports/16RookieROK701TRUE
17win/api/v1/sports/17Winter LeaguesWIN1301TRUE
8bbl/api/v1/sports/8Organized BaseballPros1401TRUE
21min/api/v1/sports/21Minor League BaseballMinors1402TRUE
23ind/api/v1/sports/23Independent LeaguesIND2101TRUE
51int/api/v1/sports/51International BaseballINT3501TRUE
508nat/api/v1/sports/508International Baseball (Collegiate)INTC3502TRUE
509nae/api/v1/sports/509International Baseball (18 and under)18U3503TRUE
510nas/api/v1/sports/510International Baseball (16 and under)16U3505TRUE
22bbc/api/v1/sports/22College BaseballCollege5101TRUE
586hsb/api/v1/sports/586High School BaseballH.S.6201TRUE

Examples

# \donttest{
  try(mlb_sports())
#> ── MLB Sports data from MLB.com ───────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:46 UTC
#> # A tibble: 18 × 7
#>    sport_id sport_code sport_link          sport_name sport_abbreviation
#>       <int> <chr>      <chr>               <chr>      <chr>             
#>  1        1 mlb        /api/v1/sports/1    Major Lea… MLB               
#>  2       11 aaa        /api/v1/sports/11   Triple-A   AAA               
#>  3       12 aax        /api/v1/sports/12   Double-A   AA                
#>  4       13 afa        /api/v1/sports/13   High-A     A+                
#>  5       14 afx        /api/v1/sports/14   Single-A   A                 
#>  6       16 rok        /api/v1/sports/16   Rookie     ROK               
#>  7       17 win        /api/v1/sports/17   Winter Le… WIN               
#>  8       21 min        /api/v1/sports/21   Minor Lea… Minors            
#>  9       23 ind        /api/v1/sports/23   Independe… IND               
#> 10       61 nlb        /api/v1/sports/61   Negro Lea… NLB               
#> 11       32 kor        /api/v1/sports/32   Korean Ba… KOR               
#> 12       31 jml        /api/v1/sports/31   Nippon Pr… NPB               
#> 13       51 int        /api/v1/sports/51   Internati… INT               
#> 14      509 nae        /api/v1/sports/509  Internati… 18U               
#> 15      510 nas        /api/v1/sports/510  Internati… 16U               
#> 16     6005 ame        /api/v1/sports/6005 Internati… AME               
#> 17       22 bbc        /api/v1/sports/22   College B… College           
#> 18      586 hsb        /api/v1/sports/586  High Scho… H.S.              
#> # ℹ 2 more variables: sort_order <int>, active_status <lgl>
# }