Skip to contents

Returns NHL team player-level stats (skaters and goalies) for a given team abbreviation and season. Uses the new NHL API club-stats endpoint (api-web.nhle.com).

Breaking change: The old team_id (integer) parameter has been replaced by team_abbr (3-letter string). The season parameter now accepts a 4-digit year (e.g., 2024 for the 2024-25 season).

Usage

nhl_teams_stats(team_abbr, season = NULL, game_type = 2)

Arguments

team_abbr

Three-letter team abbreviation (e.g., "TBL", "TOR", "SEA")

season

Integer 4-digit year (e.g., 2024 for the 2024-25 season). If NULL, returns current season stats.

game_type

Integer game type: 2 = regular season (default), 3 = playoffs

Value

A data frame (fastRhockey_data) with the following columns:

col_nametypesdescription
player_idintegerUnique player identifier.
headshotcharacterURL to the player's headshot image.
position_codecharacterPlayer position code.
games_playedintegerGames played.
goalsintegerGoals scored.
assistsintegerAssists.
pointsintegerTotal points (goals + assists).
plus_minusintegerPlus/minus rating.
penalty_minutesintegerPenalty minutes.
power_play_goalsintegerPower-play goals.
shorthanded_goalsintegerShort-handed goals.
game_winning_goalsintegerGame-winning goals.
overtime_goalsintegerOvertime goals.
shotsintegerShots on goal.
shooting_pctgnumericShooting percentage.
avg_time_on_ice_per_gamenumericAverage time on ice per game.
avg_shifts_per_gamenumericAverage shifts per game.
faceoff_win_pctgnumericFaceoff win percentage.
first_name_defaultcharacterPlayer first name (default language).
last_name_defaultcharacterPlayer last name (default language).
last_name_cscharacterPlayer last name (Czech localization).
last_name_ficharacterPlayer last name (Finnish localization).
last_name_skcharacterPlayer last name (Slovak localization).
player_typecharacterPlayer type ("skater" or "goalie").
games_startedintegerGames started (goalies).
winsintegerWins (goalies).
lossesintegerLosses (goalies).
overtime_lossesintegerOvertime losses (goalies).
goals_against_averagenumericGoals-against average (goalies).
save_percentagenumericSave percentage (goalies).
shots_againstintegerShots faced (goalies).
savesintegerSaves made (goalies).
goals_againstintegerGoals against (goalies).
shutoutsintegerShutouts (goalies).
time_on_iceintegerTotal time on ice (goalies).
first_name_cscharacterPlayer first name (Czech localization).
first_name_skcharacterPlayer first name (Slovak localization).
team_abbrcharacterTeam abbreviation.
seasoncharacterSeason identifier.
game_typeintegerGame type (2 = regular season, 3 = playoffs).

Examples

# \donttest{
  try(nhl_teams_stats(team_abbr = "TBL"))
#> ── NHL Teams Stats Information from NHL.com ─────────────── fastRhockey 1.0.0 ──
#>  Data updated: 2026-06-13 03:26:10 UTC
#> # A tibble: 23 × 40
#>    player_id headshot position_code games_played goals assists points plus_minus
#>        <int> <chr>    <chr>                <int> <int>   <int>  <int>      <int>
#>  1   8470621 https:/… R                        7     0       0      0         -2
#>  2   8474151 https:/… D                        7     0       1      1          2
#>  3   8476453 https:/… R                        7     1       5      6          2
#>  4   8476826 https:/… C                        7     0       1      1          0
#>  5   8476878 https:/… C                        7     0       0      0         -2
#>  6   8477149 https:/… R                        2     0       0      0          0
#>  7   8477404 https:/… C                        7     2       6      8          3
#>  8   8477416 https:/… R                        4     0       0      0         -3
#>  9   8477426 https:/… L                        6     0       0      0         -2
#> 10   8478010 https:/… C                        7     1       0      1         -1
#> # ℹ 13 more rows
#> # ℹ 32 more variables: penalty_minutes <int>, power_play_goals <int>,
#> #   shorthanded_goals <int>, game_winning_goals <int>, overtime_goals <int>,
#> #   shots <int>, shooting_pctg <dbl>, avg_time_on_ice_per_game <dbl>,
#> #   avg_shifts_per_game <dbl>, faceoff_win_pctg <dbl>,
#> #   first_name_default <chr>, last_name_default <chr>, last_name_cs <chr>,
#> #   last_name_fi <chr>, last_name_sk <chr>, player_type <chr>, …
# }