Skip to contents

MLB Sport IDs Information

Usage

mlb_sports_info(sport_id = 1)

Arguments

sport_id

The sport_id to return information for.

Value

Returns a tibble with the following columns

col_nametypesdescription
sport_idintegerMLBAM sport (level) identifier.
sport_codecharacterShort sport code (e.g. 'mlb', 'aaa').
sport_linkcharacterAPI link to the sport resource.
sport_namecharacterFull sport/level name.
sport_abbreviationcharacterSport abbreviation (e.g. 'MLB').
sort_orderintegerDisplay sort order for the sport.
active_statuslogicalWhether the sport/level is active.

Examples

# \donttest{
  try(mlb_sports_info(sport_id = 1))
#> ── MLB Sports Info data from MLB.com ──────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:52 UTC
#> # A tibble: 1 × 7
#>   sport_id sport_code sport_link       sport_name     sport_abbreviation
#>      <int> <chr>      <chr>            <chr>          <chr>             
#> 1        1 mlb        /api/v1/sports/1 Major League … MLB               
#> # ℹ 2 more variables: sort_order <int>, active_status <lgl>
# }