NHL API

SKRusty

Napalm
Jan 20, 2016
2,611
1,062
I am planning a project using the NHL API
The best documentation I have found is from here:
Drew Hynes / nhlapi · GitLab

From analyzing the documentation the only way to get players stats properly is to query the league schedule then take each game game entry and pull the statistics that you want to track... Write them to your database and then manipulate them the way you want.

Essentially I am looking for somebody to confirm that supposition...

To further add to that thought, to my knowledge there is no way to query the players. Is this correct?
 

Kane One

Moderator
Feb 6, 2010
43,087
10,605
Brooklyn, New NY
I am planning a project using the NHL API
The best documentation I have found is from here:
Drew Hynes / nhlapi · GitLab

From analyzing the documentation the only way to get players stats properly is to query the league schedule then take each game game entry and pull the statistics that you want to track... Write them to your database and then manipulate them the way you want.

Essentially I am looking for somebody to confirm that supposition...

To further add to that thought, to my knowledge there is no way to query the players. Is this correct?
Look at the “people” documentation here:

stats-api.md · master · Drew Hynes / nhlapi · GitLab
 

SKRusty

Napalm
Jan 20, 2016
2,611
1,062
That is what I was looking at.

To my understanding you need to have a ID to query the data. And yes you could start at the first entry and role through the numbers but only about 1/4 of the players are relevant in the last 10 years.

To get all the players that will play in the NHL this year it appears that you have to start with the schedule and keep a game by game log of the data you wish to track. (If you tracked it all the database would be gargantuan.) From the games played you get team id's player id's and can easily pull data from people and teams but from what I have seen you can't just query all people for

?stats=statsSingleSeason&season=20192020
To my knowledge you need to have the player id before you pull that query. Please correct me if I am wrong.
 

Kane One

Moderator
Feb 6, 2010
43,087
10,605
Brooklyn, New NY
That is what I was looking at.

To my understanding you need to have a ID to query the data. And yes you could start at the first entry and role through the numbers but only about 1/4 of the players are relevant in the last 10 years.

To get all the players that will play in the NHL this year it appears that you have to start with the schedule and keep a game by game log of the data you wish to track. (If you tracked it all the database would be gargantuan.) From the games played you get team id's player id's and can easily pull data from people and teams but from what I have seen you can't just query all people for

?stats=statsSingleSeason&season=20192020
To my knowledge you need to have the player id before you pull that query. Please correct me if I am wrong.
There is an endpoint to get team rosters. From there you can get their ID.

stats-api.md · master · Drew Hynes / nhlapi · GitLab
 

KirkAlbuquerque

#WeNeverGetAGoodCoach
Mar 12, 2014
31,644
36,380
New York
That is what I was looking at.

To my understanding you need to have a ID to query the data. And yes you could start at the first entry and role through the numbers but only about 1/4 of the players are relevant in the last 10 years.

To get all the players that will play in the NHL this year it appears that you have to start with the schedule and keep a game by game log of the data you wish to track. (If you tracked it all the database would be gargantuan.) From the games played you get team id's player id's and can easily pull data from people and teams but from what I have seen you can't just query all people for

?stats=statsSingleSeason&season=20192020
To my knowledge you need to have the player id before you pull that query. Please correct me if I am wrong.
for my project I just queried all the teams, and then got a list of all the players for each team, then for each player you can query their individual stats for any season.

I wasn't able to find a way to just pull all stats to make like a leaderboard or anything. However I didn't use my own database it was purely a front end project.
 

SKRusty

Napalm
Jan 20, 2016
2,611
1,062
for my project I just queried all the teams, and then got a list of all the players for each team, then for each player you can query their individual stats for any season.

I wasn't able to find a way to just pull all stats to make like a leaderboard or anything. However I didn't use my own database it was purely a front end project.
To create a leaderboard I believe you would have to treat it like a general ledger in accounting software. Each game is entered into the ledger the then you can start making queries by anything you want. Team stats, player stats, situational stats and so on.

Not the most convenient way of getting a leaderboard but the possibilities are endless.
 

Ad

Upcoming events

Ad

Ad

-->