Skip to contents

Get ESPN men's college basketball PBP data

Usage

espn_mbb_pbp(game_id)

Arguments

game_id

Game ID

Value

A play-by-play data frame.

Plays

col_nametypesdescription
idcharacterId.
sequence_numbercharacterSequence number representing a shot-possession (V3 PBP).
textcharacterText description of the play / record.
away_scoreintegerAway team score at the time of the play.
home_scoreintegerHome team score at the time of the play.
scoring_playlogicalTRUE if the play resulted in points scored.
score_valueintegerPoint value of the play (2 / 3 / 1).
wallclockcharacterWallclock.
shooting_playlogicalTRUE if the play was a shooting attempt.
type_idintegerType identifier (numeric).
type_textcharacterDisplay text for the type field.
period_numberintegerNumeric period (1-4 for quarters; 5+ for OT).
period_display_valuecharacterPeriod display label (e.g. '1st Quarter', 'OT').
clock_display_valuecharacterGame clock display string (e.g. '8:32').
team_idintegerUnique team identifier.
coordinate_x_rawnumericX coordinate as returned by the API before any adjustment.
coordinate_y_rawnumericY coordinate as returned by the API before any adjustment.
coordinate_xnumericX coordinate on the court (half-court layout).
coordinate_ynumericY coordinate on the court (half-court layout).
play_idcharacterUnique play identifier within a game.
athlete_id_1integerPrimary athlete identifier (e.g. shooter).
athlete_id_2integerSecondary athlete identifier (e.g. assister / fouler).
home_team_idintegerUnique identifier for the home team.
home_team_mascotcharacterHome team mascot.
home_team_namecharacterHome team name.
home_team_abbrevcharacterHome team three-letter abbreviation.
home_team_logocharacterHome team logo URL.
home_team_logo_darkcharacterHome team logo URL for dark backgrounds.
home_team_full_namecharacterFull home team name (e.g. 'Las Vegas Aces').
home_team_colorcharacterHome team primary color (hex).
home_team_alternate_colorcharacterHome team alternate color (hex).
home_team_scoreintegerHome team's score.
home_team_winnerlogicalTRUE if the home team won this game.
home_team_recordcharacterHome team's win-loss record.
away_team_idintegerUnique identifier for the away team.
away_team_mascotcharacterAway team mascot.
away_team_namecharacterAway team name.
away_team_abbrevcharacterAway team three-letter abbreviation.
away_team_logocharacterAway team logo URL.
away_team_logo_darkcharacterAway team logo URL for dark backgrounds.
away_team_full_namecharacterFull away team name (e.g. 'Las Vegas Aces').
away_team_colorcharacterAway team primary color (hex).
away_team_alternate_colorcharacterAway team alternate color (hex).
away_team_scoreintegerAway team's score.
away_team_winnerlogicalTRUE if the away team won this game.
away_team_recordcharacterAway team's win-loss record.
game_idintegerUnique game identifier.
seasonintegerSeason identifier (4-digit year or 'YYYY-YY' string).
season_typeintegerSeason type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats).
game_dateDateGame date (YYYY-MM-DD).
game_date_timePOSIXctGame start date/time (ISO 8601).

See also

Other ESPN MBB Functions: espn_mbb_athlete_awards(), espn_mbb_athlete_career_stats(), espn_mbb_athlete_eventlog_v2(), espn_mbb_athlete_eventlog(), espn_mbb_athlete_gamelog(), espn_mbb_athlete_info(), espn_mbb_athlete_overview(), espn_mbb_athlete_seasons(), espn_mbb_athlete_splits(), espn_mbb_athlete_statisticslog(), espn_mbb_athlete_stats(), espn_mbb_athletes_index(), espn_mbb_award(), espn_mbb_betting(), espn_mbb_calendar(), espn_mbb_coach_record(), espn_mbb_coach_season(), espn_mbb_coaches(), espn_mbb_coach(), espn_mbb_conferences(), espn_mbb_event_broadcasts(), espn_mbb_event_competitor_leaders(), espn_mbb_event_competitor_linescores(), espn_mbb_event_competitor_records(), espn_mbb_event_competitor_roster_entry(), espn_mbb_event_competitor_roster(), espn_mbb_event_competitor_score(), espn_mbb_event_competitor_statistics(), espn_mbb_event_odds(), espn_mbb_event_official_detail(), espn_mbb_event_officials(), espn_mbb_event_play_personnel(), espn_mbb_event_player_box(), espn_mbb_event_play(), espn_mbb_event_powerindex(), espn_mbb_event_predictor(), espn_mbb_event_probabilities(), espn_mbb_event_propbets(), espn_mbb_event_situation(), espn_mbb_franchises(), espn_mbb_franchise(), espn_mbb_futures(), espn_mbb_game_all(), espn_mbb_game_rosters(), espn_mbb_injuries(), espn_mbb_leaders(), espn_mbb_news(), espn_mbb_player_box(), espn_mbb_player_stats(), espn_mbb_positions(), espn_mbb_position(), espn_mbb_powerindex(), espn_mbb_rankings(), espn_mbb_scoreboard(), espn_mbb_season_awards(), espn_mbb_season_group_children(), espn_mbb_season_group_teams(), espn_mbb_season_groups(), espn_mbb_season_group(), espn_mbb_season_info(), espn_mbb_season_leaders(), espn_mbb_season_rankings(), espn_mbb_season_ranking(), espn_mbb_season_types(), espn_mbb_season_type(), espn_mbb_season_weeks(), espn_mbb_season_week(), espn_mbb_seasons(), espn_mbb_standings(), espn_mbb_team_box(), espn_mbb_team_current_roster(), espn_mbb_team_injuries(), espn_mbb_team_leaders(), espn_mbb_team_news(), espn_mbb_team_odds_records(), espn_mbb_team_record_detail(), espn_mbb_team_record(), espn_mbb_team_roster(), espn_mbb_team_schedule(), espn_mbb_team_season_profile(), espn_mbb_team_season_roster(), espn_mbb_team_season_statistics(), espn_mbb_team_stats(), espn_mbb_teams(), espn_mbb_team(), espn_mbb_tournament_seasons(), espn_mbb_tournament_season(), espn_mbb_tournaments(), espn_mbb_tournament(), espn_mbb_venues(), espn_mbb_week_rankings(), espn_mbb_week_ranking(), espn_mbb_wp()

Author

Saiem Gilani

Examples

# \donttest{
try(espn_mbb_pbp(game_id = 401479672))
#> ── ESPN MBB Play-by-Play Information from ESPN.com ────────────── hoopR 3.1.0 ──
#>  Data updated: 2026-05-29 23:25:37 UTC
#> # A tibble: 360 × 53
#>    id       sequence_number text  away_score home_score scoring_play score_value
#>    <chr>    <chr>           <chr>      <int>      <int> <lgl>              <int>
#>  1 4014796… 101799901       Jump…          0          0 FALSE                  0
#>  2 4014796… 101805501       Jess…          0          0 FALSE                  2
#>  3 4014796… 101805502       RJ M…          0          0 FALSE                  0
#>  4 4014796… 101805503       Skyy…          0          0 FALSE                  0
#>  5 4014796… 101808101       Terr…          0          0 FALSE                  3
#>  6 4014796… 101808102       RJ M…          0          0 FALSE                  0
#>  7 4014796… 101809301       RJ M…          0          0 FALSE                  2
#>  8 4014796… 101809302       Benn…          0          0 FALSE                  0
#>  9 4014796… 101809501       Foul…          0          0 FALSE                  0
#> 10 4014796… 101814601       Juda…          0          0 FALSE                  2
#> # ℹ 350 more rows
#> # ℹ 46 more variables: wallclock <chr>, shooting_play <lgl>,
#> #   points_attempted <int>, short_description <chr>, type_id <int>,
#> #   type_text <chr>, period_number <int>, period_display_value <chr>,
#> #   clock_display_value <chr>, team_id <int>, coordinate_x_raw <dbl>,
#> #   coordinate_y_raw <dbl>, coordinate_x <dbl>, coordinate_y <dbl>,
#> #   play_id <chr>, athlete_id_1 <int>, athlete_id_2 <int>, …
# }