my-puckzone-nhl-api
v1.0.0
Published
TypeScript client library for the NHL API. Used internally by the my-puckzone app.
Downloads
49
Readme
my-puckzone-nhl-api
TypeScript client library for the NHL API. Used internally by the my-puckzone app.
Installation
npm installUsage
import { getStandings, getScoreboard, getGamePlayByPlay } from "my-puckzone-nhl-api";Endpoints
Teams
getMasterTeamsList()— full NHL team list with IDs and abbreviations
Standings
getStandings()— current standings
Playoffs
getPlayoffBracket(year)— playoff bracket for a given yeargetSeriesSchedule(season, seriesLetter)— schedule for a specific playoff series
Leaders
getGoalieStatsLeaders({ seasonId, gameTypeId, categories })— goalie stat leadersgetSkaterStatsLeaders({ seasonId, gameTypeId, categories })— skater stat leaders
Player
getPlayerLanding(playerId)— player profile and featured statsgetPlayerGameLogs(playerId, seasonId, gameTypeId)— player game log
Schedule
getSchedule(date?)— schedule for a given date or today
Scoreboard
getScoreboard()— live scoreboard
Game
getBoxscore(gameId)— boxscore with player statsgetGameSummary(gameId)— game summary with scoring and three starsgetGameStory(gameId)— full game story with pre-game matchup datagetGamePlayByPlay(gameId)— full play-by-play event streamgetShiftChart(gameId)— shift data for all players
Team
getTeamPlayerStats(teamAbbrev, season, gameTypeId)— club stats for skaters and goaliesgetTeamSchedule(teamAbbrev, season)— full season schedule for a team
Stats (NHL Stats API)
fetchSkaterSummary,fetchSkaterRealtimeStats,fetchSkaterTimeOnIceStats, and morefetchGoalieSummary,fetchGoalieAdvancedStats,fetchGoalieBios, and morefetchTeamSummary,fetchTeamPowerPlay,fetchTeamPenaltyKill, and more
Edge Data
- Goalie: 5v5 save%, save percentages by zone, shot location
- Skater: shot location, shot speed, skating distance, skating speed, zone time
- Team: shot location, shot speed, skating distance, skating speed, zone time
- Top 10 leaderboards for all of the above
Base URLs
| Constant | URL |
|---|---|
| NHL_API_BASE | https://api-web.nhle.com/v1 |
| NHL_STATS_BASE | https://api.nhle.com/stats/rest/en |
| NHL_EDGE_BASE | https://api-web.nhle.com/v1/edge |
