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.2.0 ──
#>  Data updated: 2022-04-30 07:16:35 UTC
#> # A tibble: 16 × 7
#>    sport_id sport_code sport_link sport_name sport_abbreviat… sort_order
#>       <int> <chr>      <chr>      <chr>      <chr>                 <int>
#>  1        1 mlb        /api/v1/s… Major Lea… MLB                      11
#>  2       11 aaa        /api/v1/s… Triple-A   AAA                     101
#>  3       12 aax        /api/v1/s… Double-A   AA                      201
#>  4       13 afa        /api/v1/s… High-A     A+                      301
#>  5       14 afx        /api/v1/s… Single-A   A                       401
#>  6       16 rok        /api/v1/s… Rookie     ROK                     701
#>  7       17 win        /api/v1/s… Winter Le… WIN                    1301
#>  8        8 bbl        /api/v1/s… Organized… Pros                   1401
#>  9       21 min        /api/v1/s… Minor Lea… Minors                 1402
#> 10       23 ind        /api/v1/s… Independe… IND                    2101
#> 11       51 int        /api/v1/s… Internati… INT                    3501
#> 12      508 nat        /api/v1/s… Internati… INTC                   3502
#> 13      509 nae        /api/v1/s… Internati… 18U                    3503
#> 14      510 nas        /api/v1/s… Internati… 16U                    3505
#> 15       22 bbc        /api/v1/s… College B… College                5101
#> 16      586 hsb        /api/v1/s… High Scho… H.S.                   6201
#> # … with 1 more variable: active_status <lgl>
# }