Get ESPN NBA PBP data
Value
A play-by-play data frame.
Plays
| col_name | types | description |
| id | character | Id. |
| sequence_number | character | Sequence number representing a shot-possession (V3 PBP). |
| text | character | Text description of the play / record. |
| away_score | integer | Away team score at the time of the play. |
| home_score | integer | Home team score at the time of the play. |
| scoring_play | logical | TRUE if the play resulted in points scored. |
| score_value | integer | Point value of the play (2 / 3 / 1). |
| wallclock | character | Wallclock. |
| shooting_play | logical | TRUE if the play was a shooting attempt. |
| type_id | integer | Type identifier (numeric). |
| type_text | character | Display text for the type field. |
| period_number | integer | Numeric period (1-4 for quarters; 5+ for OT). |
| period_display_value | character | Period display label (e.g. '1st Quarter', 'OT'). |
| clock_display_value | character | Game clock display string (e.g. '8:32'). |
| team_id | integer | Unique team identifier. |
| coordinate_x_raw | numeric | X coordinate as returned by the API before any adjustment. |
| coordinate_y_raw | numeric | Y coordinate as returned by the API before any adjustment. |
| coordinate_x | numeric | X coordinate on the court (half-court layout). |
| coordinate_y | numeric | Y coordinate on the court (half-court layout). |
| play_id | character | Unique play identifier within a game. |
| athlete_id_1 | integer | Primary athlete identifier (e.g. shooter). |
| athlete_id_2 | integer | Secondary athlete identifier (e.g. assister / fouler). |
| athlete_id_3 | integer | Athlete id 3. |
| home_team_id | integer | Unique identifier for the home team. |
| home_team_mascot | character | Home team mascot. |
| home_team_name | character | Home team name. |
| home_team_abbrev | character | Home team three-letter abbreviation. |
| home_team_logo | character | Home team logo URL. |
| home_team_logo_dark | character | Home team logo URL for dark backgrounds. |
| home_team_full_name | character | Full home team name (e.g. 'Las Vegas Aces'). |
| home_team_color | character | Home team primary color (hex). |
| home_team_alternate_color | character | Home team alternate color (hex). |
| home_team_score | integer | Home team's score. |
| home_team_winner | logical | TRUE if the home team won this game. |
| home_team_record | character | Home team's win-loss record. |
| away_team_id | integer | Unique identifier for the away team. |
| away_team_mascot | character | Away team mascot. |
| away_team_name | character | Away team name. |
| away_team_abbrev | character | Away team three-letter abbreviation. |
| away_team_logo | character | Away team logo URL. |
| away_team_logo_dark | character | Away team logo URL for dark backgrounds. |
| away_team_full_name | character | Full away team name (e.g. 'Las Vegas Aces'). |
| away_team_color | character | Away team primary color (hex). |
| away_team_alternate_color | character | Away team alternate color (hex). |
| away_team_score | integer | Away team's score. |
| away_team_winner | logical | TRUE if the away team won this game. |
| away_team_record | character | Away team's win-loss record. |
| game_id | integer | Unique game identifier. |
| season | integer | Season identifier (4-digit year or 'YYYY-YY' string). |
| season_type | integer | Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats). |
| game_date | Date | Game date (YYYY-MM-DD). |
| game_date_time | POSIXct | Game start date/time (ISO 8601). |
See also
Other ESPN NBA Functions:
espn_nba_athlete_awards(),
espn_nba_athlete_career_stats(),
espn_nba_athlete_contract(),
espn_nba_athlete_contracts(),
espn_nba_athlete_eventlog(),
espn_nba_athlete_eventlog_v2(),
espn_nba_athlete_gamelog(),
espn_nba_athlete_info(),
espn_nba_athlete_overview(),
espn_nba_athlete_seasons(),
espn_nba_athlete_splits(),
espn_nba_athlete_statisticslog(),
espn_nba_athlete_stats(),
espn_nba_athletes_index(),
espn_nba_award(),
espn_nba_betting(),
espn_nba_calendar(),
espn_nba_coach(),
espn_nba_coach_record(),
espn_nba_coach_season(),
espn_nba_coaches(),
espn_nba_conferences(),
espn_nba_draft(),
espn_nba_draft_athlete_detail(),
espn_nba_draft_athletes(),
espn_nba_draft_pick(),
espn_nba_draft_rounds(),
espn_nba_draft_status(),
espn_nba_event_broadcasts(),
espn_nba_event_competitor_leaders(),
espn_nba_event_competitor_linescores(),
espn_nba_event_competitor_records(),
espn_nba_event_competitor_roster(),
espn_nba_event_competitor_roster_entry(),
espn_nba_event_competitor_score(),
espn_nba_event_competitor_statistics(),
espn_nba_event_odds(),
espn_nba_event_official_detail(),
espn_nba_event_officials(),
espn_nba_event_play(),
espn_nba_event_play_personnel(),
espn_nba_event_player_box(),
espn_nba_event_powerindex(),
espn_nba_event_predictor(),
espn_nba_event_probabilities(),
espn_nba_event_propbets(),
espn_nba_event_situation(),
espn_nba_franchise(),
espn_nba_franchises(),
espn_nba_freeagents(),
espn_nba_futures(),
espn_nba_game_all(),
espn_nba_game_rosters(),
espn_nba_injuries(),
espn_nba_leaders(),
espn_nba_news(),
espn_nba_player_box(),
espn_nba_player_stats(),
espn_nba_position(),
espn_nba_positions(),
espn_nba_powerindex(),
espn_nba_scoreboard(),
espn_nba_season_awards(),
espn_nba_season_draft(),
espn_nba_season_group(),
espn_nba_season_group_children(),
espn_nba_season_group_teams(),
espn_nba_season_groups(),
espn_nba_season_info(),
espn_nba_season_leaders(),
espn_nba_season_ranking(),
espn_nba_season_rankings(),
espn_nba_season_type(),
espn_nba_season_types(),
espn_nba_season_week(),
espn_nba_season_weeks(),
espn_nba_seasons(),
espn_nba_standings(),
espn_nba_team(),
espn_nba_team_box(),
espn_nba_team_current_roster(),
espn_nba_team_depthchart(),
espn_nba_team_injuries(),
espn_nba_team_leaders(),
espn_nba_team_news(),
espn_nba_team_odds_records(),
espn_nba_team_record(),
espn_nba_team_record_detail(),
espn_nba_team_roster(),
espn_nba_team_schedule(),
espn_nba_team_season_profile(),
espn_nba_team_season_roster(),
espn_nba_team_season_statistics(),
espn_nba_team_stats(),
espn_nba_teams(),
espn_nba_tournament(),
espn_nba_tournament_season(),
espn_nba_tournament_seasons(),
espn_nba_tournaments(),
espn_nba_transactions(),
espn_nba_venues(),
espn_nba_week_ranking(),
espn_nba_week_rankings(),
espn_nba_wp()
Examples
# \donttest{
try(espn_nba_pbp(game_id = 401071880))
#> ── ESPN NBA Play-by-Play Information from ESPN.com ────────────── hoopR 3.1.0 ──
#> ℹ Data updated: 2026-05-19 19:26:50 UTC
#> # A tibble: 475 × 54
#> id sequence_number text away_score home_score scoring_play score_value
#> <chr> <chr> <chr> <int> <int> <lgl> <int>
#> 1 4010718… 4 Jahl… 0 0 FALSE 0
#> 2 4010718… 7 Nema… 0 3 TRUE 3
#> 3 4010718… 9 Elfr… 2 3 TRUE 2
#> 4 4010718… 10 Ian … 2 3 FALSE 0
#> 5 4010718… 12 Kenr… 2 3 FALSE 0
#> 6 4010718… 13 Jahl… 4 3 TRUE 2
#> 7 4010718… 15 Harr… 4 5 TRUE 2
#> 8 4010718… 16 King… 4 5 FALSE 0
#> 9 4010718… 17 Ian … 7 5 TRUE 3
#> 10 4010718… 19 Chri… 7 5 FALSE 0
#> # ℹ 465 more rows
#> # ℹ 47 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>, …
# }
