Skip to main content
Version: 0.2.0

NHL — NHL Stats REST API

sportsdataverse.nhl — 21 endpoints.

nhl_stats_rest_ping​

Ping the NHL Stats REST API database.

Endpoint URL: GET https://api.nhle.com/stats/rest/ping

Valid URL: https://api.nhle.com/stats/rest/ping

API ParameterPythonPatternRequiredNullableDescription

Returns​

Ping the NHL Stats REST API database.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_ping()

nhl_stats_rest_component_season​

Retrieve the component-season configuration.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/componentSeason

Valid URL: https://api.nhle.com/stats/rest/en/componentSeason

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

Retrieve the component-season configuration.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_component_season()

nhl_stats_rest_config​

Retrieve the Stats REST API configuration payload.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/config

Valid URL: https://api.nhle.com/stats/rest/en/config

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

Retrieve the Stats REST API configuration payload.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_config()

nhl_stats_rest_content_module​

Retrieve a content module by template key.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/content/module/{template_key}

Valid URL: https://api.nhle.com/stats/rest/en/content/module/X

API ParameterPythonPatternRequiredNullableDescription
template_keytemplate_keyYtemplate_key path parameter.
langlangYlang path parameter.

Returns​

Retrieve a content module by template key.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_content_module(template_key='X')

nhl_stats_rest_country​

Retrieve the list of countries used in NHL data.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/country

Valid URL: https://api.nhle.com/stats/rest/en/country

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idStringUnique player identifier.
country3_codeStringThree-letter ISO country code used by the NHL api-web country reference endpoint.
country_codeStringPlayer country code.
country_nameStringFull English display name of the country as provided by the NHL api-web country reference.
has_player_statsInt64Flag (1/0) indicating whether the NHL api-web tracks player statistics for this country.
image_urlStringPlayer headshot URL.
ioc_codeStringInternational Olympic Committee three-letter country code assigned to this nation.
is_activeInt64Whether the team is active.
nationality_nameStringNationality label string used on player profiles in the NHL api-web (e.g., 'Canadian', 'American').
olympic_urlStringURL to the country's Olympic profile page linked from the NHL api-web country record.
thumbnail_urlStringURL to a small thumbnail image representing the country's flag or emblem in the NHL api-web.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_country()

nhl_stats_rest_draft​

Retrieve draft data, optionally filtered with Cayenne expressions.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/draft

Valid URL: https://api.nhle.com/stats/rest/en/draft

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
draft_yearInt64Draft year the lottery applies to.
roundsInt64Number of rounds in the draft.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_draft()

nhl_stats_rest_franchise​

Retrieve franchise data.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/franchise

Valid URL: https://api.nhle.com/stats/rest/en/franchise

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
full_nameStringPlayer full name.
team_common_nameStringTeam common (nickname) name.
team_place_nameStringTeam place (city/location) name.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_franchise()

nhl_stats_rest_game​

Retrieve game-level data.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/game

Valid URL: https://api.nhle.com/stats/rest/en/game

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
eastern_start_timeStringGame start time in Eastern time.
game_dateStringGame date.
game_numberInt64Game number within the schedule.
game_schedule_state_idInt64Schedule state identifier.
game_state_idInt64Game state identifier.
game_typeInt64Game type the row belongs to.
home_scoreInt64Home team final score.
home_team_idInt64Home team identifier.
periodInt64Period number.
seasonInt64Season year (echoed from arg).
visiting_scoreInt64Visiting team score.
visiting_team_idInt64Visiting team identifier.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_game()

nhl_stats_rest_glossary​

Retrieve the NHL Stats glossary of stat definitions.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/glossary

Valid URL: https://api.nhle.com/stats/rest/en/glossary

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
abbreviationStringTeam abbreviation.
definitionStringDefinition of the stat or term.
first_season_for_statFloat64First season the stat was tracked (YYYYYYYY).
full_nameStringPlayer full name.
language_codeStringLanguage code of the entry.
last_updatedStringTimestamp the entry was last updated.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_glossary()

nhl_stats_rest_goalie_report​

Retrieve a goalie statistical report.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/goalie/{report}

Valid URL: https://api.nhle.com/stats/rest/en/goalie/summary

API ParameterPythonPatternRequiredNullableDescription
reportreportYreport path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
assistsInt64Assists.
games_playedInt64Games played.
games_startedInt64Games started (goalies).
goalie_full_nameStringGoalie full name.
goalsInt64Goals scored.
goals_againstInt64Goals against.
goals_against_averageFloat64Goals against average.
last_nameStringPlayer last name.
lossesInt64Losses.
ot_lossesInt64Overtime losses.
penalty_minutesInt64Penalty minutes.
player_idInt64Unique player identifier.
pointsInt64Total points (goals + assists).
save_pctFloat64Save percentage.
savesInt64Saves made.
season_idInt64Season identifier.
shoots_catchesStringHandedness (shoots/catches).
shots_againstInt64Shots faced.
shutoutsInt64Shutouts recorded.
team_abbrevsStringTeam abbreviation(s).
tiesStringTotal ties.
time_on_iceInt64Time on ice in seconds.
winsInt64Wins.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_goalie_report(report='summary')

nhl_stats_rest_leaders_goalies​

Retrieve league leaders for a goalie statistical attribute.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/leaders/goalies/{attribute}

Valid URL: https://api.nhle.com/stats/rest/en/leaders/goalies/X

API ParameterPythonPatternRequiredNullableDescription
attributeattributeYattribute path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
save_pctgFloat64Save percentage.
player_idInt64Unique player identifier.
player_current_team_idInt64Player's current team identifier.
player_first_nameStringPlayer first name.
player_full_nameStringPlayer full name.
player_last_nameStringPlayer last name.
player_position_codeStringPlayer position code.
player_sweater_numberFloat64Player jersey number.
team_idInt64Unique team identifier.
team_franchise_idInt64Team franchise identifier.
team_full_nameStringFull team name.
team_league_idInt64League identifier of the team.
team_logosStringTeam logo metadata.
team_raw_tricodeStringTeam raw three-letter code.
team_tri_codeStringTeam tri-code abbreviation.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_leaders_goalies(attribute='X')

nhl_stats_rest_leaders_skaters​

Retrieve league leaders for a skater statistical attribute.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/leaders/skaters/{attribute}

Valid URL: https://api.nhle.com/stats/rest/en/leaders/skaters/X

API ParameterPythonPatternRequiredNullableDescription
attributeattributeYattribute path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
goalsInt64Goals scored.
player_idInt64Unique player identifier.
player_current_team_idInt64Player's current team identifier.
player_first_nameStringPlayer first name.
player_full_nameStringPlayer full name.
player_last_nameStringPlayer last name.
player_position_codeStringPlayer position code.
player_sweater_numberInt64Player jersey number.
team_idInt64Unique team identifier.
team_franchise_idInt64Team franchise identifier.
team_full_nameStringFull team name.
team_league_idInt64League identifier of the team.
team_logosStringTeam logo metadata.
team_raw_tricodeStringTeam raw three-letter code.
team_tri_codeStringTeam tri-code abbreviation.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_leaders_skaters(attribute='X')

nhl_stats_rest_milestones_goalies​

Retrieve milestone data for goalies.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/milestones/goalies

Valid URL: https://api.nhle.com/stats/rest/en/milestones/goalies

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
current_team_idInt64Player's current team identifier.
first_nameStringPlayer first name.
game_type_idInt64Game type identifier (regular/playoffs).
games_playedInt64Games played.
last_nameStringPlayer last name.
milestoneStringMilestone category.
milestone_amountInt64Amount remaining to reach the milestone.
player_full_nameStringPlayer full name.
player_idInt64Unique player identifier.
soInt64Shutouts.
team_abbrevStringTeam abbreviation.
team_common_nameStringTeam common (nickname) name.
team_full_nameStringFull team name.
team_place_nameStringTeam place (city/location) name.
toi_minutesInt64Time on ice in minutes.
winsInt64Wins.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_milestones_goalies()

nhl_stats_rest_milestones_skaters​

Retrieve milestone data for skaters.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/milestones/skaters

Valid URL: https://api.nhle.com/stats/rest/en/milestones/skaters

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
assistsInt64Assists.
current_team_idInt64Player's current team identifier.
first_nameStringPlayer first name.
game_type_idInt64Game type identifier (regular/playoffs).
games_playedInt64Games played.
goalsInt64Goals scored.
last_nameStringPlayer last name.
milestoneStringMilestone category.
milestone_amountInt64Amount remaining to reach the milestone.
player_full_nameStringPlayer full name.
player_idInt64Unique player identifier.
pointsInt64Total points (goals + assists).
team_abbrevStringTeam abbreviation.
team_common_nameStringTeam common (nickname) name.
team_full_nameStringFull team name.
team_place_nameStringTeam place (city/location) name.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_milestones_skaters()

nhl_stats_rest_players​

Retrieve the NHL player registry.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/players

Valid URL: https://api.nhle.com/stats/rest/en/players

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame (parser: parse_nhl_stats_rest); pass return_as_pandas=True for a pandas.DataFrame. return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_players()

nhl_stats_rest_season​

Retrieve the list of all NHL seasons.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/season

Valid URL: https://api.nhle.com/stats/rest/en/season

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
all_star_game_in_useInt64Whether an All-Star Game was held this season.
conferences_in_useInt64Whether conferences were in use that season.
divisions_in_useInt64Whether divisions were in use that season.
end_dateStringSeason end date.
entry_draft_in_useInt64Whether an entry draft was in use this season.
formatted_season_idStringHuman-readable season string (e.g. "2023-24").
minimum_playoff_minutes_for_goalie_stats_leadersInt64Minimum playoff minutes to qualify for goalie stats leaders.
minimum_regular_games_for_goalie_stats_leadersInt64Minimum regular-season games to qualify for goalie stats leaders.
nhl_stanley_cup_ownerInt64Whether the NHL owned the Stanley Cup this season.
number_of_gamesInt64Number of games per team this season.
olympics_participationInt64Whether NHL players participated in the Olympics this season.
point_for_ot_loss_in_useInt64Whether the overtime-loss point was in use this season.
preseason_startdateStringPreseason start date.
regular_season_end_dateStringRegular-season end date.
row_in_useInt64Whether the regulation/overtime/shootout format was in use.
season_ordinalInt64Ordinal sequence number of the season.
start_dateStringSeason start date.
supplemental_draft_in_useInt64Whether a supplemental draft was in use this season.
ties_in_useInt64Whether ties were in use that season.
total_playoff_gamesInt64Total number of playoff games this season.
total_regular_season_gamesInt64Total number of regular-season games this season.
wildcard_in_useInt64Whether the wild-card playoff format was in use this season.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_season()

nhl_stats_rest_shiftcharts​

Retrieve shift-chart data.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/shiftcharts

Valid URL: https://api.nhle.com/stats/rest/en/shiftcharts

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
detail_codeInt64Numeric code identifying the specific detail type or sub-category within the shift or event record.
durationStringPenalty duration in minutes.
end_timeStringShift end time (MM:SS countdown clock).
event_descriptionString
event_detailsStringSerialized details describing the on-ice event associated with the shift, such as play type and participants.
event_numberInt64
first_nameStringPlayer first name.
game_idInt64Unique game identifier.
hex_valueStringHexadecimal color code associated with the event or team, used for display rendering.
last_nameStringPlayer last name.
periodInt64Period number.
player_idInt64Unique player identifier.
shift_numberInt64Sequential number identifying the shift within the game, ordered chronologically by start time.
start_timeStringShift start time (MM:SS countdown clock).
team_abbrevStringTeam abbreviation.
team_idInt64Unique team identifier.
team_nameStringTeam name.
type_codeInt64Numeric code identifying the high-level event type (e.g., faceoff, goal, penalty) for this shift record.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_shiftcharts()

nhl_stats_rest_skater_report​

Retrieve a skater statistical report.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/skater/{report}

Valid URL: https://api.nhle.com/stats/rest/en/skater/summary

API ParameterPythonPatternRequiredNullableDescription
reportreportYreport path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
assistsInt64Assists.
ev_goalsInt64Even-strength goals.
ev_pointsInt64Even-strength points.
faceoff_win_pctFloat64Faceoff win percentage.
game_winning_goalsInt64Game-winning goals.
games_playedInt64Games played.
goalsInt64Goals scored.
last_nameStringPlayer last name.
ot_goalsInt64Overtime goals.
penalty_minutesInt64Penalty minutes.
player_idInt64Unique player identifier.
plus_minusInt64Plus/minus rating.
pointsInt64Total points (goals + assists).
points_per_gameFloat64Points per game.
position_codeStringPlayer position code.
pp_goalsInt64Power-play goals.
pp_pointsInt64Power-play points.
season_idInt64Season identifier.
sh_goalsInt64Short-handed goals.
sh_pointsInt64Short-handed points.
shooting_pctFloat64Shooting percentage.
shoots_catchesStringHandedness (shoots/catches).
shotsInt64Shots on goal.
skater_full_nameStringPlayer full name.
team_abbrevsStringTeam abbreviation(s).
time_on_ice_per_gameFloat64Average time on ice per game.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_skater_report(report='summary')

nhl_stats_rest_team​

Retrieve the list of all NHL teams.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/team

Valid URL: https://api.nhle.com/stats/rest/en/team

API ParameterPythonPatternRequiredNullableDescription
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
franchise_idInt64Unique franchise identifier.
full_nameStringPlayer full name.
league_idInt64League identifier of the team.
raw_tricodeStringTeam raw three-letter code.
tri_codeStringTeam three-letter code.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_team()

nhl_stats_rest_team_by_id​

Retrieve a single team by its numeric ID.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/team/id/{team_id}

Valid URL: https://api.nhle.com/stats/rest/en/team/id/10

API ParameterPythonPatternRequiredNullableDescription
team_idteam_idYteam_id path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
idInt64Unique player identifier.
franchise_idInt64Unique franchise identifier.
full_nameStringPlayer full name.
league_idInt64League identifier of the team.
raw_tricodeStringTeam raw three-letter code.
tri_codeStringTeam three-letter code.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_team_by_id(team_id=10)

nhl_stats_rest_team_report​

Retrieve a team statistical report.

Endpoint URL: GET https://api.nhle.com/stats/rest/{lang}/team/{report}

Valid URL: https://api.nhle.com/stats/rest/en/team/summary

API ParameterPythonPatternRequiredNullableDescription
reportreportYreport path parameter.
langlangYlang path parameter.

Returns​

return_parsed=True (default) — a tidy polars.DataFrame with the columns below; pass return_as_pandas=True for a pandas.DataFrame.

col_nametypedescription
faceoff_win_pctFloat64Faceoff win percentage.
games_playedInt64Games played.
goals_againstInt64Goals against.
goals_against_per_gameFloat64Goals against per game.
goals_forInt64Goals for.
goals_for_per_gameFloat64Goals for per game.
lossesInt64Losses.
ot_lossesInt64Overtime losses.
penalty_kill_net_pctFloat64Net penalty kill percentage.
penalty_kill_pctFloat64Penalty kill percentage.
point_pctFloat64Points percentage.
pointsInt64Total points (goals + assists).
power_play_net_pctFloat64Net power play percentage.
power_play_pctFloat64Power play percentage.
regulation_and_ot_winsInt64Wins in regulation and overtime.
season_idInt64Season identifier.
shots_against_per_gameFloat64Shots against per game.
shots_for_per_gameFloat64Shots for per game.
team_full_nameStringFull team name.
team_idInt64Unique team identifier.
team_shutoutsInt64Team shutouts.
tiesStringTotal ties.
winsInt64Wins.
wins_in_regulationInt64Wins in regulation.
wins_in_shootoutInt64Wins in shootout.

return_parsed=False — the raw JSON Dict payload, unparsed.

Raises​

ExceptionDescription
NoDataErrorThe host answered 404 -- the requested resource does not exist.
ValueErrorThe host answered 400 / 422 -- the request is wrong; retrying cannot help.
AssetFetchErrorThe fetch failed (a non-2xx answer or a connection failure after retries, e.g. 401/403/429/5xx, or an empty or unreadable 200 body) -- the answer is unknown, not empty.

Example​

nhl_stats_rest_team_report(report='summary')