All URIs are relative to https://statsapi.web.nhl.com/api/v1
Method | HTTP request | Description |
---|---|---|
get_game | GET /game/{id}/feed/live | Get all available data for an NHL game. |
get_game_boxscore | GET /game/{id}/boxscore | Get the boxscore for an NHL game. |
get_game_content | GET /game/{id}/content | Get editorials, video replays and photo highlights for an NHL game. |
get_game_diff | GET /game/{id}/feed/live/diffPatch | Get all available data for an NHL game after a specific time. |
Game get_game(id)
Get all available data for an NHL game.
This contains all data related to a game, from the boxscore, to play data and even on-ice coordinates. Be forewarned that, depending on the game, this endpoint can return a lot of data.
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = openapi_client.GamesApi()
id = 2017020851 # float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7).
try:
# Get all available data for an NHL game.
api_response = api_instance.get_game(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GamesApi->get_game: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7). |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GameBoxscores get_game_boxscore(id)
Get the boxscore for an NHL game.
If you want detailed play information, you should use /game/{id}/feed/live
or /game/{id}/feed/live/diffPatch
.
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = openapi_client.GamesApi()
id = 2017020851 # float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7).
try:
# Get the boxscore for an NHL game.
api_response = api_instance.get_game_boxscore(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GamesApi->get_game_boxscore: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7). |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GameContent get_game_content(id)
Get editorials, video replays and photo highlights for an NHL game.
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = openapi_client.GamesApi()
id = 2017020851 # float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7).
try:
# Get editorials, video replays and photo highlights for an NHL game.
api_response = api_instance.get_game_content(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GamesApi->get_game_content: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7). |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Game get_game_diff(id, start_time_code)
Get all available data for an NHL game after a specific time.
You can use this to return a small subset of data relating to game.
from __future__ import print_function
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = openapi_client.GamesApi()
id = 2017020851 # float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7).
start_time_code = 20180210_0900 # str | The prospect ID.
try:
# Get all available data for an NHL game after a specific time.
api_response = api_instance.get_game_diff(id, start_time_code)
pprint(api_response)
except ApiException as e:
print("Exception when calling GamesApi->get_game_diff: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
id | float | The ID of the game. The first 4 digits identify the season of the game (ie. 2017 for the 2017-2018 season). The next 2 digits give the type of game, where 01 = preseason, 02 = regular season, 03 = playoffs, 04 = all-star. The final 4 digits identify the specific game number. For regular season and preseason games, this ranges from 0001 to the number of games played. (1271 for seasons with 31 teams (2017 and onwards) and 1230 for seasons with 30 teams). For playoff games, the 2nd digit of the specific number gives the round of the playoffs, the 3rd digit specifies the matchup, and the 4th digit specifies the game (out of 7). | |
start_time_code | str | The prospect ID. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]