Algobook
- The developer's handbook
mode-switch
back-button
Buy Me A Coffee

NHL schedule API

The NHL schedule API allows you to fetch past, live and future games in one single call. Simply provide the start date, and then the API will provide games from that day and the upcoming four days. If the game is live, we will provide the current period and current time. We also support playoffs, where each game will contain the series current stats.

Example call

To fetch the schedule, simply call our sports API with the date you are interested in.

const response = await fetch( "https://sports.algobook.info/api/v1/nhl/schedule/2023-12-14" );

The response, will look like this (for upcoming games):

{ "gameWeeks": [ { "date": "2023-12-14", "games": [ { "id": "2023020448", "startTimeUTC": "2023-12-15T00:00:00Z", "gameState": "FUT", "gameScheduleState": "OK", "homeTeam": { "id": "4", "abbrev": "PHI", "logo": "https://assets.nhle.com/logos/nhl/svg/PHI_light.svg" }, "awayTeam": { "id": "15", "abbrev": "WSH", "logo": "https://assets.nhle.com/logos/nhl/svg/WSH_light.svg" }, "periodDescriptor": { "number": 0 } }, } ..., ] }

For past games, we will provide a score for each team.

Example:

{ "gameWeeks": [ { "date": "2023-12-12", "games": [ { "id": "2023020428", "startTimeUTC": "2023-12-12T00:00:00Z", "gameState": "OFF", "gameScheduleState": "OK", "homeTeam": { "id": "7", "abbrev": "BUF", "logo": "https://assets.nhle.com/logos/nhl/svg/BUF_light.svg", "score": 5 }, "awayTeam": { "id": "53", "abbrev": "ARI", "logo": "https://assets.nhle.com/logos/nhl/svg/ARI_light.svg", "score": 2 }, "periodDescriptor": { "number": 3 } } ..., ] }

And for live games, we will provide a Clock object with time information of the game, which looks like this:

{ "gameWeeks": [ { "date": "2023-12-12", "games": [ { "id": "2023020428", "startTimeUTC": "2023-12-12T00:00:00Z", "gameState": "OFF", "gameScheduleState": "OK", "homeTeam": { "id": "7", "abbrev": "BUF", "logo": "https://assets.nhle.com/logos/nhl/svg/BUF_light.svg", "score": 5 }, "awayTeam": { "id": "53", "abbrev": "ARI", "logo": "https://assets.nhle.com/logos/nhl/svg/ARI_light.svg", "score": 2 }, "periodDescriptor": { "number": 3 }, "clock": { "timeRemaining": "07:22", "secondsRemaining": 442, "running": true, "inIntermission": false } } ..., ] }

For playoffs, an object called seriesStatuss will be included with information about the current stats for the series

{ "date": "2022-05-25", "games": [ { "id": 2021030235, "startTimeUTC": "2022-05-26T00:00:00Z", "gameState": "OFF", "gameScheduleState": "OK", "homeTeam": { "id": 21, "logo": "https://assets.nhle.com/logos/nhl/svg/COL_light.svg", "abbrev": "COL", "score": 4 }, "awayTeam": { "id": 19, "logo": "https://assets.nhle.com/logos/nhl/svg/STL_light.svg", "abbrev": "STL", "score": 5 }, "periodDescriptor": { "number": 4, "periodType": "OT" }, "seriesStatus": { "round": 2, "gameNumberOfSeries": 5, "roundAbbrev": "R2", "roundCode": "2nd_round", "seriesLetter": "K", "neededToWin": 4, "length": 7, "topSeedTeamId": 21, "topSeedWins": 3, "bottomSeedTeamId": 19, "bottomSeedWins": 2, "awayTeamWins": 2, "homeTeamWins": 3 } } ] }

Game state values

The enums that we provide for the gameState are the following:

LIVE, FUT, PRE, OFF, FINAL;

Summary

This API is intended to provide you with data about past, live and upcoming games for the NHL. If you have any ideas on how to make it even better, or if you want more data - don't hesitate to contact us.

Thanks for using our services.

signature
See all our articlesSee all our open source projects