Returns season-by-season stats for a given player ID.
Uses the new NHL API player landing endpoint (api-web.nhle.com).
Note: The original statsapi.web.nhl.com endpoint has been retired.
This function now returns the seasonTotals data from the player landing
page, which includes year-by-year stats across all leagues (NHL, AHL, junior, etc.).
Value
A data frame (fastRhockey_data) with the following columns:
| col_name | types | description |
| game_type_id | integer | Game type identifier (2 regular, 3 playoffs). |
| games_played | integer | Games played in the season. |
| goals_against_avg | numeric | Goalie goals-against average. |
| league_abbrev | character | League abbreviation. |
| save_pctg | numeric | Goalie save percentage. |
| season | integer | Season (concluding year, YYYY). |
| sequence | integer | Sequence order of the season row. |
| team_name_default | character | Team name (default localization). |
| goals_against | integer | Goals against. |
| losses | integer | Losses. |
| shutouts | integer | Shutouts. |
| ties | integer | Ties. |
| time_on_ice | character | Time on ice. |
| wins | integer | Wins. |
| shots_against | integer | Shots faced. |
| team_name_cs | character | Team name (Czech localization). |
| team_name_de | character | Team name (German localization). |
| team_name_es | character | Team name (Spanish localization). |
| team_name_fi | character | Team name (Finnish localization). |
| team_name_sk | character | Team name (Slovak localization). |
| team_name_sv | character | Team name (Swedish localization). |
| team_common_name_default | character | Team common name (default localization). |
| team_common_name_cs | character | Team common name (Czech localization). |
| team_common_name_de | character | Team common name (German localization). |
| team_common_name_es | character | Team common name (Spanish localization). |
| team_common_name_fi | character | Team common name (Finnish localization). |
| team_common_name_sk | character | Team common name (Slovak localization). |
| team_common_name_sv | character | Team common name (Swedish localization). |
| team_place_name_with_preposition_default | character | Team place name with preposition (default). |
| ot_losses | integer | Overtime losses. |
| assists | integer | Assists. |
| games_started | integer | Games started (goalies). |
| goals | integer | Goals scored. |
| pim | integer | Penalty minutes. |
| team_name_fr | character | Team name (French localization). |
| team_place_name_with_preposition_fr | character | Team place name with preposition (French). |
| team_common_name_fr | character | Team common name (French localization). |
| player_id | integer | Unique player identifier. |
| first_name | character | Player first name. |
| last_name | character | Player last name. |
| position | character | Player position. |
Examples
# \donttest{
try(nhl_player_stats(player_id = 8476899))
#> ── NHL Player Stats Information from NHL.com ────────────── fastRhockey 1.0.0 ──
#> ℹ Data updated: 2026-06-13 03:25:26 UTC
#> # A tibble: 37 × 41
#> game_type_id games_played goals_against_avg league_abbrev save_pctg season
#> <int> <int> <dbl> <chr> <dbl> <int>
#> 1 2 32 5.92 Bantam 0.87 20072008
#> 2 2 29 2.84 Bantam 0 20082009
#> 3 2 40 1.71 Minor-ON NA 20092010
#> 4 2 28 3.79 OHL NA 20102011
#> 5 2 36 4.08 OHL NA 20112012
#> 6 2 7 2.72 WJ18-A 0.910 20112012
#> 7 2 53 3.67 OHL 0.894 20122013
#> 8 3 6 2.67 OHL 0.910 20122013
#> 9 2 49 2.57 OHL 0.921 20132014
#> 10 2 1 2 AHL 0.92 20132014
#> # ℹ 27 more rows
#> # ℹ 35 more variables: sequence <int>, team_name_default <chr>,
#> # goals_against <int>, losses <int>, shutouts <int>, ties <int>,
#> # time_on_ice <chr>, wins <int>, shots_against <int>, team_name_cs <chr>,
#> # team_name_de <chr>, team_name_es <chr>, team_name_fi <chr>,
#> # team_name_sk <chr>, team_name_sv <chr>, team_common_name_default <chr>,
#> # team_common_name_cs <chr>, team_common_name_de <chr>, …
# }
