Skip to contents

Get ESPN NHL Game Scoring Plays (core-v2)

Usage

espn_nhl_game_scoringplays(event_id, cid = event_id, limit = 300, ...)

Arguments

event_id

ESPN event (game) identifier.

cid

Competition identifier. Defaults to event_id.

limit

Maximum number of plays to fetch for filtering. Defaults to 300. Only used when the dedicated scoringplays endpoint is unavailable and the function falls back to filtering game_plays().

...

Reserved for forward compatibility.

Value

A fastRhockey_data tibble with one row per scoring play (goal). Implementation note: The dedicated /scoringplays core-v2 endpoint returns 404 for NHL; this function falls back to fetching all plays via espn_nhl_game_plays() and filtering to rows where scoring_play == TRUE. Columns are the same as espn_nhl_game_plays():

col_nametypesdescription
event_idcharacterESPN event id (echoed from arg).
cidcharacterCompetition id (echoed from arg).
idcharacterESPN play identifier.
sequence_numberintegerPlay sequence number within the game.
type_idcharacterPlay type id.
type_textcharacterPlay type label (always "Goal" for scoring plays).
textcharacterFull play description text.
period_numberintegerPeriod number of the goal.
clock_displaycharacterClock time of the goal.
away_scoreintegerAway team score after the goal.
home_scoreintegerHome team score after the goal.
scoring_playlogicalAlways TRUE.
score_valueintegerAlways 1 for NHL goals.
coordinate_xnumericX coordinate of the shot.
coordinate_ynumericY coordinate of the shot.
strength_textcharacterStrength situation (e.g. "Even Strength", "Power Play").
team_refcharacter$ref URL for the scoring team.

See also

family_espn_nhl lists every function in this family.

Author

Saiem Gilani

Examples

# \donttest{
  try({
    sb <- espn_nhl_scoreboard(dates = "20250110")
    espn_nhl_game_scoringplays(event_id = sb$game_id[1])
  })
#> ── NHL Game Plays data from ESPN core-v2 ────────────────── fastRhockey 1.1.0 ──
#> ℹ Data updated: 2026-11-13 21:26:59 UTC
#> # A tibble: 8 × 27
#>   event_id cid   id    sequence_number type_id type_text type_abbreviation text 
#>   <chr>    <chr> <chr>           <int> <chr>   <chr>     <chr>             <chr>
#> 1 4016882… 4016… 4016…              15 505     Goal      goal              Alex…
#> 2 4016882… 4016… 4016…              33 505     Goal      goal              Ryan…
#> 3 4016882… 4016… 4016…              77 505     Goal      goal              Luca…
#> 4 4016882… 4016… 4016…             196 505     Goal      goal              Andr…
#> 5 4016882… 4016… 4016…             204 505     Goal      goal              Albe…
#> 6 4016882… 4016… 4016…             221 505     Goal      goal              Teuv…
#> 7 4016882… 4016… 4016…             238 505     Goal      goal              Teuv…
#> 8 4016882… 4016… 4016…             242 505     Goal      goal              Marc…
#> # ℹ 19 more variables: short_text <chr>, period_number <int>,
#> #   period_display <chr>, clock_value <dbl>, clock_display <chr>,
#> #   away_score <int>, home_score <int>, scoring_play <lgl>, score_value <int>,
#> #   priority <lgl>, shooting_play <lgl>, is_penalty <lgl>, wallclock <chr>,
#> #   coordinate_x <dbl>, coordinate_y <dbl>, strength_id <chr>,
#> #   strength_text <chr>, team_ref <chr>, play_ref <chr>
# }