Skip to contents

Retrieve additional game information for major and minor league games

Usage

mlb_game_info(game_pk)

Arguments

game_pk

The unique game_pk identifier for the game

Value

Returns a tibble that includes supplemental information, such as weather, official scorer, attendance, etc., for the game_pk provided

col_nametypesdescription
game_datecharacterGame date (YYYY-MM-DD).
game_pknumericUnique game identifier.
venue_namecharacterStadium name.
venue_idintegerVenue ID.
temperaturecharacterGame-time temperature (degrees F).
other_weathercharacterWeather condition description.
windcharacterWind speed and direction.
attendancecharacterReported game attendance.
start_timecharacterFirst-pitch local start time.
elapsed_timecharacterTotal elapsed game time (H:MM).
game_idcharacterHuman-readable game ID slug.
game_typecharacterGame type code (R, P, etc.).
home_sport_codecharacterHome sport code (always 'mlb').
official_scorercharacterOfficial scorer name.
datecharacterLong-form game date label.
status_indcharacterGame status code.
home_league_idintegerHome team league ID.
gameday_swcharacterGameday data type code.

Examples

# \donttest{
  try(mlb_game_info(game_pk = 566001))
#> ── MLB Game Info data from MLB.com ────────────────── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:09:31 UTC
#> # A tibble: 1 × 18
#>   game_date  game_pk venue_name venue_id temperature other_weather wind 
#>   <chr>        <dbl> <chr>         <int> <chr>       <chr>         <chr>
#> 1 2019-04-29  566001 Citi Field     3289 51          Cloudy        10 m…
#> # ℹ 11 more variables: attendance <chr>, start_time <chr>,
#> #   elapsed_time <chr>, game_id <chr>, game_type <chr>,
#> #   home_sport_code <chr>, official_scorer <chr>, date <chr>,
#> #   status_ind <chr>, home_league_id <int>, gameday_sw <chr>
# }