Skip to contents

MLB Team Affiliates

Usage

mlb_team_affiliates(team_ids = NULL, sport_ids = NULL, season = NULL)

Arguments

team_ids

The team_id(s) to return affiliates data for.

sport_ids

The sport_id to return team affiliates information for.

season

The season to return team affiliates data for the particular season.

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.
parent_org_namecharacterParent organization name.
parent_org_idintegerParent organization MLBAM ID.
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_affiliates(team_ids = 147))
#> ── MLB Team Affiliates data from MLB.com ──────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-08 11:09:28 UTC
#> # A tibble: 11 × 35
#>    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…   2026 nya      
#>  2 F                   386 New York Yankees Pros… /api…   2026 nyp      
#>  3 N                   531 Scranton/Wilkes-Barre… /api…   2026 swb      
#>  4 N                  1956 Somerset Patriots      /api…   2026 som      
#>  5 N                   537 Hudson Valley Renegad… /api…   2026 hdv      
#>  6 N                   634 DSL NYY Bombers        /api…   2026 dyb      
#>  7 N                   635 DSL NYY Yankees        /api…   2026 dya      
#>  8 N                   475 FCL Yankees            /api…   2026 fya      
#>  9 N                   587 Tampa Tarpons          /api…   2026 tpa      
#> 10 N                  3308 Yankees Alternate Tra… /api…   2026 nys      
#> 11 O                  3309 Yankees Organization   /api…   2026 nyo      
#> # ℹ 29 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>, parent_org_name <chr>, parent_org_id <int>,
#> #   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>, …
# }