NHL.com Goal Simulations

morehockeystats

Unusual hockey stats
Dec 13, 2016
629
302
Columbus
morehockeystats.com
Yes you can!

Get the boxscore JSON:
Assume GAME_ID = 2024020008 (8th game of 2024/25 season)

Then in the boxscore['plays'] there are events, which have key 'typeDescKey'. For those of them that are of type 'goal', note the url appearing in the field pptReplayUrl :
E.g.

The result will be a 120-item collection of when who was onIce where. A sample entry of an on-ice entry is like that:
"52004": {
"id": 52004,
"playerId": 8480145,
"x": 2299.7315,
"y": 212.9376,

"sweaterNumber": 4,
"teamId": 52,
"teamAbbrev": "WPG"
},

Note that the ID is team Id and a sweater number padded to 3 digits with zeroes.
But really you should work with the playerId, which is the universal nhl player ID. The items are separated by 0.1 seconds, so the whole collection covers the 12 seconds preceding the goal. Noe that the timeStamp is in REAL EPOCH TIME, not in game time at all (use the event data from PBP for that)

The PUCK object is one indexed as "1"

Attempting to scrape other (than goal) events leads to error 'Access denied'.
 
Last edited:
  • Like
Reactions: Michael Farkas

Michael Farkas

Celebrate 68
Jun 28, 2006
14,531
9,870
NYC
www.youtube.com
Not that I could find.
I figured. That's what the private firms are getting...but our access is denied. Oh well, that's life. But this has some interesting upside.

A good goalie is aware of all the shooting options and he has to track them. So, if we have the player positioning, we could adjust that for shooting bias and prowess (approximately) and make some in-roads with that.
 

morehockeystats

Unusual hockey stats
Dec 13, 2016
629
302
Columbus
morehockeystats.com
I figured. That's what the private firms are getting...but our access is denied. Oh well, that's life. But this has some interesting upside.

A good goalie is aware of all the shooting options and he has to track them. So, if we have the player positioning, we could adjust that for shooting bias and prowess (approximately) and make some in-roads with that.
I wonder if the coordinates in the sprite will correspond to the coordinates in the boxscore. But I won't make that test myself yet, I've my hands full with other things, I just got everything seemingly stable with this season changes, and ARI -> UTA shift.
 

Ad

Upcoming events

Ad

Ad