Learn R Programming

nhlscraper

Overview

nhlscraper is a CRAN-approved R-package for scraping NHL data using the NHL and ESPN APIs. It primarily wraps endpoints documented by Zachary Maludzinski, Drew Hynes, and Joseph Wilson; it also includes newly discovered endpoints by myself. It covers data from high-level multi-season summaries and award winners to low-level play-by-play logs and sports books' odds. Since the NHL API endpoints got reworked in 2023, many of the earlier scrapers became defunct; this one should be updated for the new endpoints.

Prerequisite

  • R/RStudio; you can check out my tutorial if you are not familiar!

Installation

Install the official version from CRAN with:

install.packages('nhlscraper')

Install the development version from GitHub with:

install.packages('devtools')
devtools::install_github('RentoSaijo/nhlscraper')

Disclosure

  1. The ESPN API functions (all starts with get_espn_) uses different sets of IDs and terminologies than the NHL API functions. For example, seasons are encoded in YYYY, the last 4 numbers in the YYYY-YYYY format; athletes refer to players; and events refer to games. These functions exist to help you access information that may not be available solely with the NHL API functions; therefore, I purposely ignored endpoints like those to access basic statistics as they're redundant if they co-exist with the NHL API functions.
  2. Most, if not, all of these endpoints are unofficially documented (i.e. hidden); therefore, it is all of our responsibilities to hit these endpoints with care. For example, endpoints that contain historical data and other mostly static data should only be hit once and stored in a database (e.g. MySQL) for further query. We do not know the exact rate limits for these APIs; don't ruin the fun for all of us!

Copy Link

Version

Install

install.packages('nhlscraper')

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Rento Saijo

Last Published

July 17th, 2025

Functions in nhlscraper (0.2.0)

get_espn_team

Get team by season and ESPN Team ID
get_espn_event

Get event (game) by ESPN ID
get_espn_event_odds

Get event (game) odds by ESPN Event (Game) ID
get_espn_event_stars

Get event (game) stars by ESPN Event (Game) ID
get_franchise_team_totals

Get all franchises' teams' all-time totals
get_espn_transactions

Get ESPN transactions by start and end dates
get_espn_athlete

Get athlete (player) by ESPN Athlete (Player) ID and season
get_espn_injuries

Get ESPN injury reports as of now
get_game_landing

Get GameCenter (GC) game-landing by game
get_standings

Get standings by date
get_glossary

Get glossary
get_player_game_log

Get game-log by player, season, and game-type
get_game_story

Get World Showcase (WSC) game-story by game
get_espn_futures

Get ESPN futures by season
get_series

Get series by season and round
get_partner_odds

Get partner odds as of now
get_franchise_season_by_season

Get all franchises' season-by-season results
get_spotlight_players

Get 'spotlight' players as of now
get_drafts

Get all drafts
get_games

Get all games
get_espn_teams

Get ESPN teams by season
get_game_boxscore

Get boxscore by game, team, and player-type
get_team_scoreboard

Get team scoreboard as of now
get_team_seasons

Get season(s) for which team played in regular season and/or playoffs
get_espn_events

Get ESPN events (games) by start and end dates
get_goalies

Get goalies' biographies by range of seasons
get_franchises

Get all franchises
get_team_statistics

Get team statistics
get_series_schedule

Get schedule by season and series
get_season_now

Get season as of now
get_shift_charts

Get shift charts
get_scores

Get score(s) by date
get_team_roster

Get roster by team, season, and player-type
get_franchise_vs_franchise

Get all franchises' all-time records versus other franchises
get_gc_play_by_play

Get GameCenter (GC) play-by-play by game
get_team_roster_statistics

Get roster statistics by team, season, game-type, and player-type
get_officials

Get all officials
get_players

Get all players
get_player_landing

Get landing by player
get_team_schedule

Get schedule by team and season
get_skater_statistics

Get skater statistics
get_schedule

Get schedule by date
get_goalie_statistics

Get goalie statistics
get_skaters

Get skaters' biographies by range of seasons
get_scoreboards

Get scoreboard(s) by date
get_goalie_milestones

Get goalie milestones
get_teams

Get all teams
get_streams

Get all streams
ping

Ping
get_skater_leaders

Get skater statistics leaders by season, game-type, and category
get_venues

Get all venues
get_standings_information

Get standings information for all seasons
get_tv_schedule

Get TV schedule by date
nhl_api

Call NHL API
get_seasons

Get all seasons
get_goalie_leaders

Get goalie statistics leaders by season, game-type, and category
get_wsc_play_by_play

Get World Showcase (WSC) play-by-play by game
get_team_prospects

Get prospects by team and player-type
get_skater_milestones

Get skater milestones
get_countries

Get all countries
get_attendance

Get attendance for all seasons
get_award_winners

Get all award winners/finalists
espn_api

Call ESPN API
get_awards

Get all awards
get_configuration

Get configuration for skater, goalie, and team statistics
get_bracket

Get bracket by season
get_espn_coach_career

Get career coaching records by ESPN Coach ID and game-type
get_espn_event_play_by_play

Get event (game) play-by-play by ESPN Event (Game) ID
get_espn_event_officials

Get event (game) officials by ESPN Event (Game) ID
get_espn_coaches

Get ESPN coaches by season
get_draft_picks

Get all draft picks
get_draft_rankings

Get draft rankings by year and player-type
get_draft_tracker

Get draft tracker as of now
get_espn_athletes

Get all ESPN athletes
get_espn_coach

Get coach by ESPN Coach ID (and season)