Skip to contents

MLB Team Info

Usage

mlb_team_info(team_id = NULL, season = NULL, sport_id = NULL)

Arguments

team_id

The team_id to return team data for.

season

The season to return team data for the given year.

sport_id

The sport_id to return a directory of team data for a particular club in a sport.

Value

Returns a tibble with the following columns

col_nametypesdescription
all_star_statuscharacterAll-star status flag.
team_idintegerTeam MLBAM ID.
team_full_namecharacterFull team name.
linkcharacterAPI link to the team.
seasonintegerSeason year.
team_codecharacterInternal team code.
file_codecharacterFile code abbreviation.
team_abbreviationcharacterTeam abbreviation.
team_namecharacterShort team name.
location_namecharacterTeam location (city).
first_year_of_playcharacterFirst year the franchise played.
short_namecharacterShort display name.
franchise_namecharacterFranchise name.
club_namecharacterClub name.
activelogicalWhether the team is active.
spring_league_idintegerSpring league MLBAM ID.
spring_league_namecharacterSpring league name.
spring_league_linkcharacterAPI link to the spring league.
spring_league_abbreviationcharacterSpring league abbreviation.
venue_idintegerHome venue MLBAM ID.
venue_namecharacterHome venue name.
venue_linkcharacterAPI link to the venue.
spring_venue_idintegerSpring training venue MLBAM ID.
spring_venue_linkcharacterAPI link to the spring venue.
league_idintegerLeague MLBAM ID.
league_namecharacterLeague name.
league_linkcharacterAPI link to the league.
division_idintegerDivision MLBAM ID.
division_namecharacterDivision name.
division_linkcharacterAPI link to the division.
sport_idintegerSport MLBAM ID.
sport_linkcharacterAPI link to the sport.
sport_namecharacterSport name (e.g., Major League Baseball).

Examples

# \donttest{
  try(mlb_team_info(team_id = 147))
#> ── MLB Team Info data from MLB.com ────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-08 11:09:29 UTC
#> # A tibble: 1 × 33
#>   all_star_status team_id team_full_name   link         season team_code
#>   <chr>             <int> <chr>            <chr>         <int> <chr>    
#> 1 N                   147 New York Yankees /api/v1/tea…   2026 nya      
#> # ℹ 27 more variables: file_code <chr>, team_abbreviation <chr>,
#> #   team_name <chr>, location_name <chr>, first_year_of_play <chr>,
#> #   short_name <chr>, franchise_name <chr>, club_name <chr>,
#> #   active <lgl>, spring_league_id <int>, spring_league_name <chr>,
#> #   spring_league_link <chr>, spring_league_abbreviation <chr>,
#> #   venue_id <int>, venue_name <chr>, venue_link <chr>,
#> #   spring_venue_id <int>, spring_venue_link <chr>, league_id <int>, …
# }