Skip to contents

Find MLB Seasons

Usage

mlb_seasons(sport_id = 1, with_game_type_dates = TRUE)

Arguments

sport_id

The sport_id to return season information for.

with_game_type_dates

with_game_type_dates to return season information

Value

Returns a tibble with the following columns:

col_nametypesdescription
season_idcharacterSeason year identifier.
has_wildcardlogicalWhether the season has a wild card round.
pre_season_start_datecharacterPre-season start date.
pre_season_end_datecharacterPre-season end date.
season_start_datecharacterSeason start date.
spring_start_datecharacterSpring training start date.
spring_end_datecharacterSpring training end date.
regular_season_start_datecharacterRegular season start date.
last_date1st_halfcharacterLast date of the first half.
all_star_datecharacterAll-Star Game date.
first_date2nd_halfcharacterFirst date of the second half.
regular_season_end_datecharacterRegular season end date.
post_season_start_datecharacterPost-season start date.
post_season_end_datecharacterPost-season end date.
season_end_datecharacterSeason end date.
offseason_start_datecharacterOff-season start date.
off_season_end_datecharacterOff-season end date.
season_level_gameday_typecharacterSeason-level Gameday data feed type.
game_level_gameday_typecharacterGame-level Gameday data feed type.
qualifier_plate_appearancesnumericPlate appearances per team game to qualify.
qualifier_outs_pitchedintegerOuts pitched per team game to qualify.

Examples

# \donttest{
 try(mlb_seasons(sport_id = 1))
#> ── MLB Seasons data from MLB.com ──────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:51 UTC
#> # A tibble: 1 × 21
#>   season_id has_wildcard pre_season_start_date pre_season_end_date
#>   <chr>     <lgl>        <chr>                 <chr>              
#> 1 2026      TRUE         2026-01-01            2026-02-19         
#> # ℹ 17 more variables: season_start_date <chr>,
#> #   spring_start_date <chr>, spring_end_date <chr>,
#> #   regular_season_start_date <chr>, last_date1st_half <chr>,
#> #   all_star_date <chr>, first_date2nd_half <chr>,
#> #   regular_season_end_date <chr>, post_season_start_date <chr>,
#> #   post_season_end_date <chr>, season_end_date <chr>,
#> #   offseason_start_date <chr>, off_season_end_date <chr>, …
# }