Skip to contents

Get ESPN NHL Play-by-Play

Usage

espn_nhl_pbp(game_id, ...)

Arguments

game_id

ESPN event identifier (character or numeric).

...

Reserved for forward compatibility.

Value

A fastRhockey_data tibble with one row per play:

col_nametypesdescription
idcharacterESPN play identifier.
sequence_numbercharacterPlay sequence number.
type_idcharacterPlay type identifier.
type_textcharacterPlay type display text.
textcharacterPlay description text.
away_scoreintegerAway team score at time of play.
home_scoreintegerHome team score at time of play.
scoring_playlogicalWhether the play resulted in a goal.
score_valueintegerGoal value (1 for regulation/OT goals).
shooting_playlogicalWhether the play was a shot attempt.
wallclockcharacterWall-clock timestamp (ISO 8601).
period_numberintegerPeriod number (1-3 regulation, 4+ OT/SO).
period_display_valuecharacterPeriod display label (e.g. "1st Period").
clock_display_valuecharacterGame clock display string (e.g. "14:32").
team_idcharacterESPN team identifier for the acting team.
coordinate_xnumericX coordinate of play location.
coordinate_ynumericY coordinate of play location.
strength_idcharacterStrength situation identifier.
strength_textcharacterStrength situation text (e.g. "Even Strength").
shot_info_idcharacterShot type identifier.
shot_info_textcharacterShot type text (e.g. "Wrist Shot").
athlete_id_1characterPrimary participant athlete identifier.
athlete_id_2characterSecondary participant athlete identifier.
athlete_id_3characterTertiary participant athlete identifier.
home_team_idcharacterHome team ESPN identifier.
home_team_namecharacterHome team name.
home_team_locationcharacterHome team city/location.
home_team_abbrevcharacterHome team abbreviation.
home_team_display_namecharacterHome team display name.
home_team_colorcharacterHome team primary color hex.
home_team_alternate_colorcharacterHome team alternate color hex.
home_team_logocharacterHome team logo URL.
home_team_scorecharacterHome team final score.
home_team_winnerlogicalWhether the home team won.
away_team_idcharacterAway team ESPN identifier.
away_team_namecharacterAway team name.
away_team_locationcharacterAway team city/location.
away_team_abbrevcharacterAway team abbreviation.
away_team_display_namecharacterAway team display name.
away_team_colorcharacterAway team primary color hex.
away_team_alternate_colorcharacterAway team alternate color hex.
away_team_logocharacterAway team logo URL.
away_team_scorecharacterAway team final score.
away_team_winnerlogicalWhether the away team won.
game_idcharacterESPN event identifier (echoed from arg).
seasonintegerSeason end-year.
season_typeintegerSeason type code.
game_datecharacterGame date-time (ISO 8601).

See also

family_espn_nhl lists every function in this family.

Author

Saiem Gilani

Examples

# \donttest{
  try(espn_nhl_pbp(game_id = "401688263"))
#> ── NHL Play-by-Play data from ESPN.com ──────────────────── fastRhockey 1.1.0 ──
#> ℹ Data updated: 2026-11-13 21:27:06 UTC
#> # A tibble: 244 × 48
#>    id              sequence_number type_id type_text text  away_score home_score
#>    <chr>           <chr>           <chr>   <chr>     <chr>      <int>      <int>
#>  1 40168826300000… 2               518     Period S… Star…          0          0
#>  2 40168826300000… 3               502     Face Off  Dyla…          0          0
#>  3 40168826300000… 4               503     Hit       Vlad…          0          0
#>  4 40168826300000… 5               506     Shot      Vlad…          0          0
#>  5 40168826300000… 6               506     Shot      Albe…          0          0
#>  6 40168826300000… 7               1402    Giveaway  Give…          0          0
#>  7 40168826300000… 8               507     Missed    Fran…          0          0
#>  8 40168826300000… 9               503     Hit       Mich…          0          0
#>  9 40168826300000… 10              1402    Giveaway  Give…          0          0
#> 10 40168826300000… 11              508     Blocked   Ben …          0          0
#> # ℹ 234 more rows
#> # ℹ 41 more variables: scoring_play <lgl>, score_value <int>,
#> #   shooting_play <lgl>, wallclock <chr>, period_number <int>,
#> #   period_display_value <chr>, clock_display_value <chr>, team_id <chr>,
#> #   coordinate_x <dbl>, coordinate_y <dbl>, strength_id <chr>,
#> #   strength_text <chr>, shot_info_id <chr>, shot_info_text <chr>,
#> #   athlete_id_1 <chr>, athlete_id_2 <chr>, athlete_id_3 <chr>, …
# }