Skip to contents

MLB Standings

Usage

mlb_standings(
  season = NULL,
  date = NULL,
  standings_type = NULL,
  league_id = NULL
)

Arguments

season

Year(s) to return to return standings information for.

date

Date to return to return standings information for.

standings_type

The standings_type(s) to return standings information for. Description of all standings_types

  1. regularSeason - Regular Season Standings

  2. wildCard - Wild card standings

  3. divisionLeaders - Division Leader standings

  4. wildCardWithLeaders - Wild card standings with Division Leaders

  5. firstHalf - First half standings. Only valid for leagues with a split season (Mexican League).

  6. secondHalf - Second half standings. Only valid for leagues with a split season (Mexican League).

  7. springTraining - Spring Training Standings

  8. postseason - Postseason Standings

  9. byDivision - Standings by Division

  10. byConference - Standings by Conference

  11. byLeague - Standings by League

league_id

The league_id(s) to return standings information for.

Value

Returns a tibble with the following columns

col_nametypesdescription
standings_typecharacterType of standings returned (e.g., regularSeason).
last_updatedcharacterTimestamp the standings record was last updated.
team_records_seasoncharacterSeason for the team record.
team_records_clinch_indicatorcharacterClinch status indicator code.
team_records_division_rankcharacterRank within the division.
team_records_league_rankcharacterRank within the league.
team_records_sport_rankcharacterRank across the sport.
team_records_games_playedintegerGames played.
team_records_games_backcharacterGames back of the division leader.
team_records_wild_card_games_backcharacterGames back of the wild card.
team_records_league_games_backcharacterGames back within the league.
team_records_spring_league_games_backcharacterGames back within the spring league.
team_records_sport_games_backcharacterGames back across the sport.
team_records_division_games_backcharacterGames back within the division.
team_records_conference_games_backcharacterGames back within the conference.
team_records_last_updatedcharacterTimestamp the team record was last updated.
team_records_runs_allowedintegerTotal runs allowed.
team_records_runs_scoredintegerTotal runs scored.
team_records_division_champlogicalWhether the team clinched the division.
team_records_division_leaderlogicalWhether the team leads its division.
team_records_has_wildcardlogicalWhether the team holds a wild card spot.
team_records_clinchedlogicalWhether the team has clinched a playoff berth.
team_records_elimination_numbercharacterOverall elimination number.
team_records_elimination_number_sportcharacterElimination number across the sport.
team_records_elimination_number_leaguecharacterElimination number within the league.
team_records_elimination_number_divisioncharacterElimination number within the division.
team_records_elimination_number_conferencecharacterElimination number within the conference.
team_records_wild_card_elimination_numbercharacterWild card elimination number.
team_records_magic_numbercharacterMagic number to clinch.
team_records_winsintegerTotal wins.
team_records_lossesintegerTotal losses.
team_records_run_differentialintegerRun differential (runs scored minus allowed).
team_records_winning_percentagecharacterWinning percentage.
team_records_wild_card_rankcharacterRank in the wild card race.
team_records_wild_card_leaderlogicalWhether the team leads the wild card race.
team_records_team_idintegerTeam MLBAM ID.
team_records_team_namecharacterTeam name.
team_records_team_linkcharacterAPI link to the team.
team_records_streak_streak_codecharacterCurrent streak code (e.g., W3, L1).
team_records_streak_streak_typecharacterStreak type (wins or losses).
team_records_streak_streak_numberintegerLength of the current streak.
team_records_league_record_winsintegerWins in league play.
team_records_league_record_lossesintegerLosses in league play.
team_records_league_record_tiesintegerTies in league play.
team_records_league_record_pctcharacterLeague play winning percentage.
team_records_records_split_recordslistNested split records (home/away/etc.).
team_records_records_division_recordslistNested records by division.
team_records_records_overall_recordslistNested overall records.
team_records_records_league_recordslistNested records by league.
team_records_records_expected_recordslistNested expected (Pythagorean) records.
league_idintegerLeague MLBAM ID.
league_linkcharacterAPI link to the league.
division_idintegerDivision MLBAM ID.
division_linkcharacterAPI link to the division.
sport_idintegerSport MLBAM ID.
sport_linkcharacterAPI link to the sport.
round_robin_statuscharacterRound robin status indicator.

Examples

# \donttest{
  try(mlb_standings(season = 2021, league_id = 103))
#> ── MLB Standings data from MLB.com ────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-08 11:09:27 UTC
#> # A tibble: 15 × 57
#>    standings_type last_updated             team_records_season
#>    <chr>          <chr>                    <chr>              
#>  1 regularSeason  2025-03-05T17:14:31.247Z 2021               
#>  2 regularSeason  2025-03-05T17:14:31.247Z 2021               
#>  3 regularSeason  2025-03-05T17:14:31.247Z 2021               
#>  4 regularSeason  2025-03-05T17:14:31.247Z 2021               
#>  5 regularSeason  2025-03-05T17:14:31.247Z 2021               
#>  6 regularSeason  2026-04-22T20:08:37.147Z 2021               
#>  7 regularSeason  2026-04-22T20:08:37.147Z 2021               
#>  8 regularSeason  2026-04-22T20:08:37.147Z 2021               
#>  9 regularSeason  2026-04-22T20:08:37.147Z 2021               
#> 10 regularSeason  2026-04-22T20:08:37.147Z 2021               
#> 11 regularSeason  2026-04-22T20:08:35.072Z 2021               
#> 12 regularSeason  2026-04-22T20:08:35.072Z 2021               
#> 13 regularSeason  2026-04-22T20:08:35.072Z 2021               
#> 14 regularSeason  2026-04-22T20:08:35.072Z 2021               
#> 15 regularSeason  2026-04-22T20:08:35.072Z 2021               
#> # ℹ 54 more variables: team_records_clinch_indicator <chr>,
#> #   team_records_division_rank <chr>, team_records_league_rank <chr>,
#> #   team_records_sport_rank <chr>, team_records_games_played <int>,
#> #   team_records_games_back <chr>,
#> #   team_records_wild_card_games_back <chr>,
#> #   team_records_league_games_back <chr>,
#> #   team_records_spring_league_games_back <chr>, …
# }