Skip to contents

Get ESPN College Baseball PBP data

Usage

espn_college_baseball_pbp(game_id)

Arguments

game_id

Game ID

Value

A play-by-play data frame.

col_nametypesdescription
idcharacterPlay / record identifier.
sequence_numbercharacterPlay sequence number within the game.
textcharacterText description of the play.
away_scoreintegerAway team run total after the play.
home_scoreintegerHome team run total after the play.
scoring_playlogicalTRUE if the play scored a run.
score_valueintegerRuns scored on the play.
wallclockcharacterWall-clock timestamp of the play (ISO 8601).
at_bat_idcharacterIdentifier of the at-bat the play belongs to.
summary_typecharacterPlay summary type.
outsintegerOuts in the inning after the play.
typecharacterType.
bat_orderintegerSpot in the batting order (1-9; NA if not applicable).
at_bat_pitch_numberintegerPitch number within the at-bat.
pitch_velocityintegerPitch velocity (mph).
trajectorycharacterBatted-ball trajectory.
alternative_playcharacterAlternative play.
type_idintegerType id.
type_textcharacterType text.
type_typecharacterType type.
type_alternative_textcharacterType alternative text.
type_abbreviationcharacterType abbreviation.
period_typecharacterPeriod type ('inning').
period_numberintegerInning number.
period_display_valuecharacterInning display value (e.g. 'Top 1st').
team_idintegerUnique ESPN team identifier.
pitch_count_ballsintegerBalls in the count when the pitch was thrown.
pitch_count_strikesintegerStrikes in the count when the pitch was thrown.
result_count_ballsintegerBalls in the count after the pitch.
result_count_strikesintegerStrikes in the count after the pitch.
bats_typecharacterBats type.
bats_abbreviationcharacterBats abbreviation.
bats_display_valuecharacterBats display value.
pitch_coordinate_xintegerPitch location x-coordinate.
pitch_coordinate_yintegerPitch location y-coordinate.
pitch_type_idcharacterPitch type identifier.
pitch_type_textcharacterPitch type description (e.g. 'Four-seam FB').
pitch_type_abbreviationcharacterPitch type abbreviation.
hit_coordinate_xintegerBatted-ball location x-coordinate.
hit_coordinate_yintegerBatted-ball location y-coordinate.
alternative_type_idcharacterAlternative type id.
alternative_type_textcharacterAlternative type text.
alternative_type_abbreviationcharacterAlternative type abbreviation.
alternative_type_alternative_textcharacterAlternative type alternative text.
alternative_type_typecharacterAlternative type type.
on_first_athlete_idcharacterAthlete id of the runner on first base.
on_second_athlete_idcharacterAthlete id of the runner on second base.
play_idcharacterPlay id.
athlete_id_1integerPrimary participating athlete id (batter).
athlete_id_2integerSecond participating athlete id (pitcher).
athlete_id_3integerThird participating athlete id (fielder).
home_team_idintegerHome team id.
home_team_mascotcharacterHome team mascot.
home_team_namecharacterHome team name.
home_team_abbrevcharacterHome team abbrev.
home_team_logocharacterHome team logo.
home_team_logo_darkcharacterHome team logo dark.
home_team_full_namecharacterHome team full name.
home_team_colorcharacterHome team color.
home_team_alternate_colorcharacterHome team alternate color.
home_team_scoreintegerHome team score.
home_team_winnerlogicalHome team winner.
home_team_recordcharacterHome team record.
away_team_idintegerAway team id.
away_team_mascotcharacterAway team mascot.
away_team_namecharacterAway team name.
away_team_abbrevcharacterAway team abbrev.
away_team_logocharacterAway team logo.
away_team_logo_darkcharacterAway team logo dark.
away_team_full_namecharacterAway team full name.
away_team_colorcharacterAway team color.
away_team_alternate_colorcharacterAway team alternate color.
away_team_scoreintegerAway team score.
away_team_winnerlogicalAway team winner.
away_team_recordcharacterAway team record.
game_idintegerUnique ESPN game/event identifier.
seasonintegerSeason (4-digit year).
season_typeintegerESPN season type (1=pre, 2=regular, 3=postseason, 4=off-season).
game_dateDateGame date (YYYY-MM-DD).
game_date_timePOSIXctGame start date/time (US/Eastern).

See also

Other ESPN College Baseball Functions: espn_college_baseball_athletes_index(), espn_college_baseball_calendar(), espn_college_baseball_coach(), espn_college_baseball_coach_record(), espn_college_baseball_coach_season(), espn_college_baseball_coaches(), espn_college_baseball_conferences(), espn_college_baseball_game_all(), espn_college_baseball_game_broadcasts(), espn_college_baseball_game_official_detail(), espn_college_baseball_game_officials(), espn_college_baseball_game_play(), espn_college_baseball_game_play_personnel(), espn_college_baseball_game_player_box(), espn_college_baseball_game_rosters(), espn_college_baseball_game_situation(), espn_college_baseball_game_team_leaders(), espn_college_baseball_game_team_linescores(), espn_college_baseball_game_team_records(), espn_college_baseball_game_team_roster(), espn_college_baseball_game_team_roster_entry(), espn_college_baseball_game_team_score(), espn_college_baseball_game_team_statistics(), espn_college_baseball_leaders(), espn_college_baseball_news(), espn_college_baseball_player_awards(), espn_college_baseball_player_box(), espn_college_baseball_player_career_stats(), espn_college_baseball_player_eventlog(), espn_college_baseball_player_gamelog(), espn_college_baseball_player_info(), espn_college_baseball_player_overview(), espn_college_baseball_player_seasons(), espn_college_baseball_player_splits(), espn_college_baseball_player_statisticslog(), espn_college_baseball_scoreboard(), espn_college_baseball_season_group(), espn_college_baseball_season_group_children(), espn_college_baseball_season_group_teams(), espn_college_baseball_season_groups(), espn_college_baseball_season_info(), espn_college_baseball_season_leaders(), espn_college_baseball_season_ranking(), espn_college_baseball_season_rankings(), espn_college_baseball_season_type(), espn_college_baseball_season_types(), espn_college_baseball_season_week(), espn_college_baseball_season_weeks(), espn_college_baseball_seasons(), espn_college_baseball_standings(), espn_college_baseball_team(), espn_college_baseball_team_box(), espn_college_baseball_team_leaders(), espn_college_baseball_team_news(), espn_college_baseball_team_record(), espn_college_baseball_team_record_detail(), espn_college_baseball_team_roster(), espn_college_baseball_team_schedule(), espn_college_baseball_team_season_profile(), espn_college_baseball_team_season_roster(), espn_college_baseball_team_season_statistics(), espn_college_baseball_teams(), espn_college_baseball_tournament(), espn_college_baseball_tournament_season(), espn_college_baseball_tournament_seasons(), espn_college_baseball_tournaments(), espn_college_baseball_venues(), espn_college_baseball_week_ranking(), espn_college_baseball_week_rankings()

Author

Saiem Gilani

Examples

# \donttest{
try(espn_college_baseball_pbp(game_id = "401778093"))
#> New names:
#>  `` -> `...45`
#>  `` -> `...46`
#> ── ESPN MLB Play-by-Play Information from ESPN.com ── baseballr 2.0.0 ──
#>  Data updated: 2026-06-12 14:07:57 UTC
#> # A tibble: 581 × 72
#>    id           sequence_number text  away_score home_score scoring_play
#>    <chr>        <chr>           <chr>      <int>      <int> <lgl>       
#>  1 40177809300… 1               "Top…          0          0 FALSE       
#>  2 40177809300… 1               "E. …          0          0 FALSE       
#>  3 40177809300… 2               "Pit…          0          0 FALSE       
#>  4 40177809300… 3               "Pit…          0          0 FALSE       
#>  5 40177809300… 4               "Pit…          0          0 FALSE       
#>  6 40177809300… 5               "C. …          0          0 FALSE       
#>  7 40177809300… 6                NA            0          0 FALSE       
#>  8 40177809300… 1               "E. …          0          0 FALSE       
#>  9 40177809300… 2               "C. …          1          0 FALSE       
#> 10 40177809300… 3               "C. …          1          0 FALSE       
#> # ℹ 571 more rows
#> # ℹ 66 more variables: score_value <int>, wallclock <chr>,
#> #   at_bat_id <chr>, summary_type <chr>, outs <int>, type <list<chr>>,
#> #   bat_order <int>, at_bat_pitch_number <int>, alternative_play <chr>,
#> #   type_id <int>, type_text <chr>, type_abbreviation <chr>,
#> #   period_type <chr>, period_number <int>, period_display_value <chr>,
#> #   team_id <int>, pitch_count_balls <int>, …
# }