This project is meant to compile various NHL API scraper functions into a re-usable package.
DATA BEING SCRAPED INCLUDES BUT IS NOT LIMITED TOO:
- Game Logs for Skaters & Goalies
- Player Shift Chart Data
- Player Events -- Hits/Goals/Takeaways/Giveaways/etc
- General Manager Bio Info & Tenure Info
- Coach Bio Info & Tenure Info
- NHL Draft Data For every year since 1979
A comprehensive tool for scraping and analyzing NHL player statistics, game logs, shifts, events, and draft data using the official NHL API.
Automatically fetches complete career game logs for all active NHL players by:
- Iterating through each NHL team using their tricode identifiers (e.g., ANA for Anaheim)
- Retrieving current rosters including forwards, defensemen, and goalies
- Accessing individual player profiles via playerId
- Collecting seasonTotals data for each player's NHL career
- Compiling game logs and exporting to position-specific CSV files
Retrieves detailed shift data to analyze shift length patterns and how shifts conclude.
Process:
- Calls NHL shift chart and play-by-play event APIs for specific games
- Normalizes naming conventions across dataframes for easier comparison
- Identifies play stoppages:
- Goals and general stoppages from event details
- Period endings (when shift endTime equals "20:00")
- Determines shift endings by:
- Matching period and time-in-period between stoppages and shift data
- Labeling unmatched shifts as "other" (when NHL data doesn't specify the reason)
- Exports results to CSV
Scrapes play-by-play event data from NHL games.
Collects historical NHL draft pick information.
All data sourced from the official NHL API