From 6eed5c589be4dd4c5112674b8e10ad98a8510638 Mon Sep 17 00:00:00 2001 From: Michael Marchand Date: Sat, 12 Aug 2023 22:37:33 -0600 Subject: [PATCH] folds all json into collapsible bits --- stats-api.md | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 2 deletions(-) diff --git a/stats-api.md b/stats-api.md index 9a3a3a6..25e7702 100644 --- a/stats-api.md +++ b/stats-api.md @@ -4,7 +4,7 @@ Thanks to [erunion](https://github.com/erunion) -Base: +Base: `https://statsapi.web.nhl.com` # Endpoint Tables @@ -67,6 +67,9 @@ Base: `GET https://statsapi.web.nhl.com/api/v1/awards/ID` Get an NHL Award. +
+ click for example + ```json { "copyright": "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -84,6 +87,10 @@ Base: ] } ``` +
+ + + [back to top](#endpoint-tables) ## Conferences @@ -93,6 +100,9 @@ for all current NHL conferences. `GET https://statsapi.web.nhl.com/api/v1/conferences/ID` Same as above but for specific conference, also can look up id 7 for World Cup of Hockey. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -114,6 +124,8 @@ specific conference, also can look up id 7 for World Cup of Hockey. } ``` +
+ [back to top](#endpoint-tables) ## Divisions `GET https://statsapi.web.nhl.com/api/v1/divisions` Returns full list of divisions @@ -123,6 +135,9 @@ Does not show inactive divisions `GET https://statsapi.web.nhl.com/api/v1/divisions/ID` Same as above but only for a single division. This can show old inactive divisions such as 13 Patrick. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -141,6 +156,9 @@ single division. This can show old inactive divisions such as 13 Patrick. ] } ``` + +
+ [back to top](#endpoint-tables) ## Franchises @@ -149,6 +167,7 @@ single division. This can show old inactive divisions such as 13 Patrick. `GET https://statsapi.web.nhl.com/api/v1/franchises/ID` Gets information on a specific franchise [back to top](#endpoint-tables) + ## Tournaments `GET https://statsapi.web.nhl.com/api/v1/tournamentTypes` @@ -159,6 +178,9 @@ Gets the possible different tournament types. This is used for tracking nested tournaments, specifically the Playoffs due to the nature of their structure. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2019. All Rights Reserved.", @@ -221,6 +243,7 @@ This is used for tracking nested tournaments, specifically the Playoffs due to t } ] } ``` +
In order to get additional information the expand modifer can be used such as this example @@ -233,6 +256,9 @@ In order to get additional information the expand modifer can be used such as th `GET https://statsapi.web.nhl.com/api/v1/venues/ID` Get an NHL Venue. +
+ click for example + ```json { "copyright": "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2019. All Rights Reserved.", @@ -246,6 +272,7 @@ In order to get additional information the expand modifer can be used such as th ] } ``` +
[back to top](#endpoint-tables) @@ -310,6 +337,9 @@ This shows all the possible play types found within the liveData/plays portion o `GET https://statsapi.web.nhl.com/api/v1/draft/YEAR` Takes a YYYY format year and returns draft data +
+ click for example + ```json { "copyright": "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -335,11 +365,15 @@ This shows all the possible play types found within the liveData/plays portion o } }, ``` +
+ [back to top](#endpoint-tables) ## Players `GET https://statsapi.web.nhl.com/api/v1/people/ID` Gets details for a player, must specify the id value in order to return data. +
+ click for example ```json { @@ -379,6 +413,9 @@ specify the id value in order to return data. } ] } ``` +
+
+ `GET https://statsapi.web.nhl.com/api/v1/people/ID/stats` Complex endpoint with lots of append options to change what kind of stats you wish to obtain @@ -393,6 +430,8 @@ for a player _note - stats have changed over the years, the below sample is for Wayne Gretzky and does not include things like evenTimeOnIce and other time related stats_ +
+ click for example ```json { @@ -424,9 +463,13 @@ and does not include things like evenTimeOnIce and other time related stats_ } ] } ``` +
_however here is Alex Ovechkin's 20162017 season stats which include time information_ +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -470,9 +513,13 @@ _however here is Alex Ovechkin's 20162017 season stats which include time inform } ``` +
`?stats=yearByYear` Provides a list of every season for a player's career +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2019. All Rights Reserved.", @@ -780,9 +827,13 @@ _however here is Alex Ovechkin's 20162017 season stats which include time inform } ] } ``` +
`?stats=homeAndAway&season=20162017` Provides a split between home and away games. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -856,6 +907,7 @@ _however here is Alex Ovechkin's 20162017 season stats which include time inform } ] } ``` +
`?stats=winLoss&season=20162017` Very similar to the previous modifier except it provides the W/L/OT split instead of Home and Away @@ -874,6 +926,9 @@ _however here is Alex Ovechkin's 20162017 season stats which include time inform `?stats=regularSeasonStatRankings&season=20162017` Returns where someone stands vs the rest of the league for a specific regularSeasonStatRankings +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -902,10 +957,14 @@ the rest of the league for a specific regularSeasonStatRankings } ] } ``` +
`?stats=goalsByGameSituation&season=20162017` Shows number on when goals for a player happened like how many in the shootout, how many in each period, etc. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -938,10 +997,14 @@ player happened like how many in the shootout, how many in each period, etc. } ] } ``` +
`?stats=onPaceRegularSeason&season=20172018` This only works with the current in-progress season and shows **projected** totals based on current onPaceRegularSeason +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -984,6 +1047,8 @@ in-progress season and shows **projected** totals based on current onPaceRegular } ``` +
+ [back to top](#endpoint-tables) @@ -994,6 +1059,8 @@ in-progress season and shows **projected** totals based on current onPaceRegular `GET https://statsapi.web.nhl.com/api/v1/draft/prospects/ID` Get an NHL Entry Draft prospect. +
+ ```json { "copyright": "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -1034,6 +1101,8 @@ in-progress season and shows **projected** totals based on current onPaceRegular ] } ``` +
+ [back to top](#endpoint-tables) # Schedule endpoints @@ -1068,6 +1137,9 @@ in-progress season and shows **projected** totals based on current onPaceRegular `GET https://statsapi.web.nhl.com/api/v1/schedule?teamId=30` Returns Minnesota Wild games for the current day. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -1138,9 +1210,13 @@ in-progress season and shows **projected** totals based on current onPaceRegular } ] } ``` - +
+
`GET https://statsapi.web.nhl.com/api/v1/schedule?teamId=30&startDate=2018-01-02&endDate=2018-01-02` Returns Minnesota Wild games for January 2, 2018 with attached linescores and broadcasts. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -1327,12 +1403,17 @@ in-progress season and shows **projected** totals based on current onPaceRegular } ``` +
+ [back to top](#endpoint-tables) ## Seasons `GET https://statsapi.web.nhl.com/api/v1/seasons` Returns data on each season such as if ties were used, divisions, wildcards or the Olympics were participated in +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2019. All Rights Reserved.", @@ -1350,6 +1431,7 @@ in-progress season and shows **projected** totals based on current onPaceRegular } ] } ``` +
`GET https://statsapi.web.nhl.com/api/v1/seasons/20172018` Gets just the data for a specific season @@ -1365,6 +1447,9 @@ in-progress season and shows **projected** totals based on current onPaceRegular `GET https://statsapi.web.nhl.com/api/v1/standings` Returns ordered standings data for each team broken up by divisions +
+ click for example + ```json { "team" : { @@ -1394,6 +1479,7 @@ for each team broken up by divisions }, } ``` +
#### Modifiers @@ -1401,6 +1487,9 @@ for each team broken up by divisions `?expand=standings.record` Detailed information for each team including home and away records, record in shootouts, last ten games, and split head-to-head records against divisions and conferences +
+ click for example + ```json { "records" : { @@ -1459,6 +1548,7 @@ for each team broken up by divisions } } ``` +
[back to top](#endpoint-tables) @@ -1467,6 +1557,9 @@ for each team broken up by divisions `GET https://statsapi.web.nhl.com/api/v1/standingsTypes` Returns all the standings types to be used in order do get a specific standings +
+ click for example + ```json { [ { @@ -1498,6 +1591,7 @@ to be used in order do get a specific standings "description" : "Standings by League" } ] ``` +
[back to top](#endpoint-tables) @@ -1507,6 +1601,8 @@ to be used in order do get a specific standings `GET https://statsapi.web.nhl.com/api/v1/teams/5/stats` Returns current season stats and the current season rankings for a specific team Ex: +
+ click for example ```json { @@ -1597,6 +1693,8 @@ Ex: } ``` +
+ [back to top](#endpoint-tables) ## Teams @@ -1627,6 +1725,9 @@ Add these to the end of the url `?stats=statsSingleSeasonPlayoffs` Specify which stats to get. Not fully sure all of the values +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -1669,10 +1770,14 @@ Add these to the end of the url "active" : true }, { ``` +
`GET https://statsapi.web.nhl.com/api/v1/teams/ID/roster` Returns entire roster for a team including id value, name, jersey number and position details. +
+ click for example + ```json { "copyright" : "NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2018. All Rights Reserved.", @@ -1692,6 +1797,7 @@ including id value, name, jersey number and position details. },] } ``` +
[back to top](#endpoint-tables)