Skip to contents

Retrieve boxscore data for a specific NHL game from the NHL web API (api-web.nhle.com).

Usage

nhl_game_boxscore(game_id)

Arguments

game_id

(integer) NHL game ID, e.g. 2024020001.

Value

A named list of data frames: game_info, team_box, skater_stats, goalie_stats.

game_info

col_nametypesdescription
game_idintegerUnique game identifier.
seasonintegerSeason (concluding year, YYYY).
game_typeintegerGame type code (2 = regular, 3 = playoffs).
game_datecharacterGame date.
venuecharacterVenue name.
game_statecharacterGame state (e.g., FINAL, LIVE).
away_team_idintegerAway team identifier.
away_team_abbrevcharacterAway team abbreviation.
away_team_namecharacterAway team name.
away_scoreintegerAway team final score.
away_sogintegerAway team shots on goal.
home_team_idintegerHome team identifier.
home_team_abbrevcharacterHome team abbreviation.
home_team_namecharacterHome team name.
home_scoreintegerHome team final score.
home_sogintegerHome team shots on goal.
last_period_typecharacterType of the last period played (REG, OT, SO).

team_box

col_nametypesdescription
home_awaycharacterHome or away indicator.
team_idintegerUnique team identifier.
team_abbrevcharacterTeam abbreviation.
team_namecharacterTeam name.
goalsintegerGoals scored.
shots_on_goalintegerShots on goal.
pimintegerPenalty minutes.
hitsintegerHits.
blocked_shotsintegerBlocked shots.
giveawaysintegerGiveaways.
takeawaysintegerTakeaways.
power_play_goalsintegerPower-play goals.
faceoff_win_pctgnumericFaceoff win percentage.
savesintegerSaves made.
save_pctgnumericSave percentage.
goals_againstintegerGoals against.

skater_stats

col_nametypesdescription
home_awaycharacterHome or away indicator.
team_idintegerUnique team identifier.
team_abbrevcharacterTeam abbreviation.
player_idintegerUnique player identifier.
player_namecharacterPlayer name.
sweater_numberintegerJersey number.
positioncharacterPlayer position.
goalsintegerGoals scored.
assistsintegerAssists.
pointsintegerTotal points (goals + assists).
plus_minusintegerPlus/minus rating.
pimintegerPenalty minutes.
hitsintegerHits.
power_play_goalsintegerPower-play goals.
shots_on_goalintegerShots on goal.
faceoff_winning_pctgnumericFaceoff win percentage.
toicharacterTime on ice.
blocked_shotsintegerBlocked shots.
shiftsintegerNumber of shifts.
giveawaysintegerGiveaways.
takeawaysintegerTakeaways.

goalie_stats

col_nametypesdescription
home_awaycharacterHome or away indicator.
team_idintegerUnique team identifier.
team_abbrevcharacterTeam abbreviation.
player_idintegerUnique player identifier.
player_namecharacterPlayer name.
sweater_numberintegerJersey number.
even_strength_shots_againstcharacterEven-strength shots against (saves/total).
power_play_shots_againstcharacterPower-play shots against (saves/total).
shorthanded_shots_againstcharacterShorthanded shots against (saves/total).
save_shots_againstcharacterTotal shots against (saves/total).
save_pctgnumericSave percentage.
even_strength_goals_againstintegerEven-strength goals against.
power_play_goals_againstintegerPower-play goals against.
shorthanded_goals_againstintegerShorthanded goals against.
pimintegerPenalty minutes.
goals_againstintegerGoals against.
toicharacterTime on ice.
starterlogicalWhether the goalie started the game.
decisioncharacterGoalie decision (W, L, O).
shots_againstintegerShots faced.
savesintegerSaves made.

Details

Uses the endpoint https://api-web.nhle.com/v1/gamecenter/{game_id}/boxscore.

Examples

if (FALSE) { # \dontrun{
  box <- nhl_game_boxscore(2024020001)
  box$game_info
  box$skater_stats
} # }