fastRhockey is an R package for accessing hockey data via public web APIs: the NHL (National Hockey League), the PWHL (Professional Women’s Hockey League), the AHL and the three Canadian major-junior leagues (OHL, WHL, QMJHL), thirteen European leagues, and NCAA men’s and women’s college hockey through ESPN. It exports 880 functions that return structured data frames of play-by-play, schedule, standings, roster, draft, player stats, and team data. The package also includes integrated expected goals (xG) models trained via XGBoost.
Part of the SportsDataverse family of R/Python packages for sports analytics.
Key Features
-
NHL Data – Game feeds, boxscores, play-by-play with shifts, schedules, standings, rosters, draft picks, player/team stats, playoffs, and broadcast information via
api-web.nhle.comandapi.nhle.com/stats -
NHL Edge Analytics (35 functions, including the two
/cat/edgedetail wrappersnhl_cat_edge_skater_detail()andnhl_cat_edge_goalie_detail()) – Skater, goalie, and team advanced metrics fromapi-web.nhle.com/v1/edge/...covering shot location, shot speed, skating speed, skating distance, zone time, comparisons, landing pages, and top-10 leaderboards. Each wrapper accepts an optionalseasonargument and falls back to the current season via the/nowform -
NHL Records API (25 functions) – First-time integration with
records.nhl.com/site/api/for franchise totals, player/skater/goalie career and real-time stats, draft lottery, hall of fame, trophies, awards, attendance, venues, officials, and combine data -
NHL Stats REST (19 dedicated wrappers) –
nhl_stats_franchise(),nhl_stats_players(),nhl_stats_glossary(),nhl_stats_country(),nhl_stats_skater_leaders(),nhl_stats_goalie_leaders(),nhl_stats_skater_milestones(),nhl_stats_goalie_milestones(), plus the originalnhl_stats_skaters()/nhl_stats_goalies()/nhl_stats_teams()/nhl_stats_draft()/nhl_stats_seasons()/nhl_stats_misc()family - PWHL Data – Schedules, standings, play-by-play, player box scores, team rosters, stat leaders, player profiles, game logs, career stats, player search, league leaders, transactions, streaks, playoff brackets, game summaries, and scorebar via the HockeyTech API
-
ESPN NHL (126 functions,
espn_nhl_*) – Play-by-play, team and player box scores, scoreboards, schedules, standings, teams, rosters, athletes, odds, win probability, injuries, transactions and the draft from ESPN’s site, web and core APIs -
Fox Sports NHL (8 functions,
fox_nhl_*) – Play-by-play, box scores, odds, team rosters, team stats, game logs, standings and league leaders from Fox Sports’ Bifrost API -
AHL, OHL, WHL and QMJHL (48 functions,
ahl_*,ohl_*,whl_*,qmjhl_*) – Schedules, play-by-play, standings, teams, rosters, player stats, leaders, game summaries and on-ice shift / TOI / Corsi analytics through the same HockeyTech API as the PWHL -
European leagues (211 functions) – Thirteen leagues: DEL (
del_*), ICE Hockey League (icehl_*), EIHL (eihl_*), Metal Ligaen (metal_*), KHL (khl_*), VHL (vhl_*), SHL (shl_*), HockeyAllsvenskan (ha_*), Liiga (liiga_*), the Swiss federation (sihf_*) and National League (nl_*), the Czech Extraliga (elh_*) and Ligue Magnus (magnus_*). Seasons are end years (2027 = 2026-27), requests to one host are spaced at least a second apart, and failures raise classed conditions (fastRhockey_no_data,fastRhockey_asset_fetch,fastRhockey_bad_request) -
NCAA college hockey (242 functions) – ESPN men’s (
espn_mch_*) and women’s (espn_wch_*) college hockey: play-by-play, box scores, scoreboards, schedules, standings, teams, rosters, rankings and leaders - xG Models – Expected goals predictions for NHL play-by-play data using XGBoost models (5v5, special teams, penalty shots)
-
Helper Aggregators – Convenience functions inspired by
nhl-api-pythat combine multiple endpoint calls into a single tidy frame:nhl_game_ids_by_season(),nhl_all_players_by_season(),nhl_player_career_stats(),nhl_team_summary_range(),nhl_skater_summary_range(),nhl_goalie_summary_range() -
Full Season Loaders – Twenty-three NHL loaders covering play-by-play (full + lite), schedules, season + per-game rosters, player/skater/goalie/team boxscores, game info, scoring & penalty summaries, three stars, scratches, linescores, shifts, officials, shots-by-period, shootouts, and conference / division reference tables (
load_nhl_pbp(),load_nhl_pbp_lite(),load_nhl_schedule(),load_nhl_rosters(),load_nhl_game_rosters(),load_nhl_team_box(),load_nhl_player_box(),load_nhl_skater_box(),load_nhl_goalie_box(),load_nhl_game_info(),load_nhl_scoring(),load_nhl_penalties(),load_nhl_three_stars(),load_nhl_scratches(),load_nhl_linescore(),load_nhl_shifts(),load_nhl_officials(),load_nhl_shots_by_period(),load_nhl_shootout(),load_nhl_groups(),load_nhl_group_seasons(),load_nhl_group_aliases(),load_nhl_team_group_seasons()); for the PWHL, seventeen loaders covering play-by-play (plain and xG-enriched), schedules, season + per-game rosters, player/skater/goalie/team boxscores, game info, scoring & penalty summaries, three stars, officials, shots-by-period, shootouts, and shifts (load_pwhl_pbp(),load_pwhl_xg_pbp(),load_pwhl_schedule(),load_pwhl_rosters(),load_pwhl_game_rosters(),load_pwhl_player_box(),load_pwhl_skater_box(),load_pwhl_goalie_box(),load_pwhl_team_box(),load_pwhl_game_info(),load_pwhl_scoring_summary(),load_pwhl_penalty_summary(),load_pwhl_three_stars(),load_pwhl_officials(),load_pwhl_shots_by_period(),load_pwhl_shootout(),load_pwhl_shifts()). Both families also export aliases named to match sportsdataverse-py (load_nhl_schedules(),load_pwhl_team_boxscores(), …).
Note: PHF (Premier Hockey Federation) functions have been defunct since v1.0.0: they stop with an error. The league ceased operations; use PWHL functions instead.

Data status
The load_nhl_*() and load_pwhl_*() functions read release assets on sportsdataverse-data. The badges below are rebuilt nightly from each producer’s latest workflow run and newest release files; idle means the sport is out of season. Full detail: sportsdataverse.org/status.
| Dataset | Data updated | Through | Pipeline | Update workflows |
|---|---|---|---|---|
| NHL |
|
|||
| PWHL |
|
|||
| Conference, division and ballpark reference | — |
Installation
You can install the CRAN version of fastRhockey with:
install.packages("fastRhockey")You can install the development version from GitHub with:
# You can install using the pak package using the following code:
if (!requireNamespace('pak', quietly = TRUE)){
install.packages('pak')
}
pak::pak("sportsdataverse/fastRhockey")If you would prefer the remotes installation:
if (!requireNamespace('remotes', quietly = TRUE)){
install.packages('remotes')
}
remotes::install_github(repo = "sportsdataverse/fastRhockey")Quick Start
library(fastRhockey)
# NHL
nhl_schedule(season = "20242025")
nhl_standings(season = "20242025")
nhl_game_feed(game_id = 2024020001)
# NHL Edge advanced metrics
nhl_edge_skater_detail(player_id = 8478402) # Connor McDavid, current season
nhl_edge_goalie_save_percentage_detail(player_id = 8475883)
nhl_edge_team_zone_time_details(team_id = 10) # Toronto Maple Leafs
# NHL Records API
nhl_records_franchise()
nhl_records_draft_lottery_odds()
nhl_records_skater_real_time_stats_career(limit = 50)
# Helper aggregators
nhl_game_ids_by_season(season = 2025, team_abbr = "TOR")
nhl_player_career_stats(player_id = 8478402)
nhl_team_summary_range(start_season = 2023, end_season = 2024)
# PWHL
pwhl_schedule(season = 2025)
pwhl_standings(season = 2025)
pwhl_pbp(game_id = 27)
pwhl_player_info(player_id = 28)
pwhl_leaders(position = "skaters", season = 2025)
pwhl_game_summary(game_id = 27)
# ESPN and Fox Sports NHL
espn_nhl_scoreboard(dates = 20250301)
fox_nhl_standings(team_id = "1")
# AHL, OHL, WHL and QMJHL (HockeyTech)
ahl_schedule(season = 2026)
# European leagues (seasons are end years: 2026 = 2025-26)
liiga_schedule(season = 2026)
khl_standings(season = 2026)
# NCAA men's and women's college hockey (ESPN)
espn_mch_scoreboard(dates = 20250301)
espn_wch_standings()
# Full season loaders
load_nhl_pbp(seasons = 2024)
load_nhl_schedule(seasons = 2024)
load_pwhl_pbp(seasons = 2024)
load_pwhl_schedule(seasons = 2024)
load_pwhl_team_box(seasons = 2024)
load_pwhl_skater_box(seasons = 2024)
load_pwhl_scoring_summary(seasons = 2024)
load_pwhl_penalty_summary(seasons = 2024)
load_pwhl_game_info(seasons = 2024)Documentation
You can find the documentation for fastRhockey on GitHub pages.
There is also a printable fastRhockey cheat sheet (PDF), one of a set covering every SportsDataverse package.
You can view CSVs of historical boxscore and play-by-play on the fastRhockey data repo, as well as the process for scraping that historical data.
Companion packages
-
sdvplotR(pak::pak("sportsdataverse/sdvplotR")) adds NHL team logos and colours toggplot2charts and draws shot maps from thefastRhockeyloaders; see its NHL visualization and NHL shot map articles. -
sportyR(install.packages("sportyR")) draws regulation rinks (sportyR::geom_hockey("nhl")) to plot thex_coord_fixed/y_coord_fixedplay-by-play coordinates on. -
hockeyR(Daniel Morse) is the other NHL play-by-play package for R. ThefastRhockeyNHL xG feature pipeline is adapted from hockeyR’s. -
sportsdataverse-pyis the Python package; mostfastRhockeyfunctions have a Python twin of the same name.
Cheat sheet
A printable one-page reference for fastRhockey — the function families, the loaders, and what each one returns.
📄 Download the fastRhockey cheat sheet (PDF)
Free to download, print and hand out; light and dark, US Letter landscape. Every SportsDataverse package has one — browse them all at sportsdataverse.org/cheatsheets.
Citations
To cite the fastRhockey R package in publications, use:
BibTeX Citation
@misc{howell_gilani_fastRhockey,
author = {Ben Howell and Saiem Gilani},
title = {fastRhockey: Functions to Access Professional Women's Hockey League and National Hockey League Play by Play Data.},
url = {https://fastRhockey.sportsdataverse.org/},
doi = {10.32614/CRAN.package.fastRhockey},
year = {2026}
}
