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_nametypes
all_star_statuscharacter
team_idinteger
team_full_namecharacter
linkcharacter
seasoninteger
team_codecharacter
file_codecharacter
team_abbreviationcharacter
team_namecharacter
location_namecharacter
first_year_of_playcharacter
short_namecharacter
franchise_namecharacter
club_namecharacter
activelogical
venue_idinteger
venue_namecharacter
venue_linkcharacter
spring_venue_idinteger
spring_venue_linkcharacter
league_idinteger
league_namecharacter
league_linkcharacter
sport_idinteger
sport_linkcharacter
sport_namecharacter

Examples

# \donttest{
  try(mlb_team_info(team_id = 147))
#> ── MLB Team Info data from MLB.com ────────────────── baseballr 1.6.0 ──
#>  Data updated: 2024-04-13 21:56:51 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…   2024 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>, …
# }