mirror of
https://gitlab.com/dword4/nhlapi
synced 2024-11-23 19:14:55 +00:00
adds JSON codeblocks
This commit is contained in:
parent
62423fcba8
commit
e0e8c30a1a
50
stats-api.md
50
stats-api.md
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Thanks to [erunion](https://github.com/erunion)
|
Thanks to [erunion](https://github.com/erunion)
|
||||||
|
|
||||||
Base:
|
Base:
|
||||||
`https://statsapi.web.nhl.com`
|
`https://statsapi.web.nhl.com`
|
||||||
|
|
||||||
# Endpoint Tables
|
# Endpoint Tables
|
||||||
@ -93,7 +93,7 @@ for all current NHL conferences.
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/conferences/ID` Same as above but for
|
`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.
|
specific conference, also can look up id 7 for World Cup of Hockey.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"conferences" : [ {
|
"conferences" : [ {
|
||||||
@ -123,7 +123,7 @@ Does not show inactive divisions
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/divisions/ID` Same as above but only for a
|
`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.
|
single division. This can show old inactive divisions such as 13 Patrick.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"divisions" : [ {
|
"divisions" : [ {
|
||||||
@ -135,9 +135,11 @@ single division. This can show old inactive divisions such as 13 Patrick.
|
|||||||
"id" : 6,
|
"id" : 6,
|
||||||
"name" : "Eastern",
|
"name" : "Eastern",
|
||||||
"link" : "/api/v1/conferences/6"
|
"link" : "/api/v1/conferences/6"
|
||||||
},
|
},
|
||||||
"active" : true
|
"active" : true
|
||||||
},
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
[back to top](#endpoint-tables)
|
[back to top](#endpoint-tables)
|
||||||
## Franchises
|
## Franchises
|
||||||
@ -157,7 +159,7 @@ Gets the possible different tournament types.
|
|||||||
|
|
||||||
This is used for tracking nested tournaments, specifically the Playoffs due to the nature of their structure.
|
This is used for tracking nested tournaments, specifically the Playoffs due to the nature of their structure.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"id" : 1,
|
"id" : 1,
|
||||||
@ -308,7 +310,7 @@ 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
|
`GET https://statsapi.web.nhl.com/api/v1/draft/YEAR` Takes a YYYY format year and returns draft data
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"drafts": [{
|
"drafts": [{
|
||||||
@ -339,7 +341,7 @@ This shows all the possible play types found within the liveData/plays portion o
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/people/ID` Gets details for a player, must
|
`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.
|
specify the id value in order to return data.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"people" : [ {
|
"people" : [ {
|
||||||
@ -392,7 +394,7 @@ for a player
|
|||||||
_note - stats have changed over the years, the below sample is for Wayne Gretzky
|
_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_
|
and does not include things like evenTimeOnIce and other time related stats_
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -425,7 +427,7 @@ 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_
|
_however here is Alex Ovechkin's 20162017 season stats which include time information_
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -471,7 +473,7 @@ _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
|
`?stats=yearByYear` Provides a list of every season for a player's career
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -781,7 +783,7 @@ _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.
|
`?stats=homeAndAway&season=20162017` Provides a split between home and away games.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -872,7 +874,7 @@ _however here is Alex Ovechkin's 20162017 season stats which include time inform
|
|||||||
`?stats=regularSeasonStatRankings&season=20162017` Returns where someone stands vs
|
`?stats=regularSeasonStatRankings&season=20162017` Returns where someone stands vs
|
||||||
the rest of the league for a specific regularSeasonStatRankings
|
the rest of the league for a specific regularSeasonStatRankings
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -904,7 +906,7 @@ the rest of the league for a specific regularSeasonStatRankings
|
|||||||
`?stats=goalsByGameSituation&season=20162017` Shows number on when goals for a
|
`?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.
|
player happened like how many in the shootout, how many in each period, etc.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -940,7 +942,7 @@ player happened like how many in the shootout, how many in each period, etc.
|
|||||||
`?stats=onPaceRegularSeason&season=20172018` This only works with the current
|
`?stats=onPaceRegularSeason&season=20172018` This only works with the current
|
||||||
in-progress season and shows **projected** totals based on current onPaceRegularSeason
|
in-progress season and shows **projected** totals based on current onPaceRegularSeason
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -1066,7 +1068,7 @@ 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.
|
`GET https://statsapi.web.nhl.com/api/v1/schedule?teamId=30` Returns Minnesota Wild games for the current day.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"totalItems" : 1,
|
"totalItems" : 1,
|
||||||
@ -1139,7 +1141,7 @@ 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.
|
`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.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"totalItems" : 1,
|
"totalItems" : 1,
|
||||||
@ -1331,7 +1333,7 @@ in-progress season and shows **projected** totals based on current onPaceRegular
|
|||||||
|
|
||||||
`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
|
`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
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"seasons" : [ {
|
"seasons" : [ {
|
||||||
@ -1363,7 +1365,7 @@ in-progress season and shows **projected** totals based on current onPaceRegular
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/standings` Returns ordered standings data
|
`GET https://statsapi.web.nhl.com/api/v1/standings` Returns ordered standings data
|
||||||
for each team broken up by divisions
|
for each team broken up by divisions
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"team" : {
|
"team" : {
|
||||||
"id" : 52,
|
"id" : 52,
|
||||||
@ -1399,7 +1401,7 @@ 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
|
`?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
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"records" : {
|
"records" : {
|
||||||
"divisionRecords" : [ {
|
"divisionRecords" : [ {
|
||||||
@ -1465,7 +1467,7 @@ for each team broken up by divisions
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/standingsTypes` Returns all the standings types
|
`GET https://statsapi.web.nhl.com/api/v1/standingsTypes` Returns all the standings types
|
||||||
to be used in order do get a specific standings
|
to be used in order do get a specific standings
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
[ {
|
[ {
|
||||||
"name" : "regularSeason",
|
"name" : "regularSeason",
|
||||||
@ -1506,7 +1508,7 @@ to be used in order do get a specific standings
|
|||||||
|
|
||||||
Ex:
|
Ex:
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"stats" : [ {
|
"stats" : [ {
|
||||||
@ -1625,7 +1627,7 @@ Add these to the end of the url
|
|||||||
|
|
||||||
`?stats=statsSingleSeasonPlayoffs` Specify which stats to get. Not fully sure all of the values
|
`?stats=statsSingleSeasonPlayoffs` Specify which stats to get. Not fully sure all of the values
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"teams" : [ {
|
"teams" : [ {
|
||||||
@ -1671,7 +1673,7 @@ Add these to the end of the url
|
|||||||
`GET https://statsapi.web.nhl.com/api/v1/teams/ID/roster` Returns entire roster for a team
|
`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.
|
including id value, name, jersey number and position details.
|
||||||
|
|
||||||
```
|
```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.",
|
"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.",
|
||||||
"roster" : [ {
|
"roster" : [ {
|
||||||
|
Loading…
Reference in New Issue
Block a user