NHL.com Goal Simulations

russ99

Registered User
Jun 9, 2011
3,838
2,856
Check out the new goal simulation feature on NHL.com


I wonder if this data can be scraped. About time puck and player tracker data gets used to create new, more accurate analytics.
 

morehockeystats

Unusual hockey stats
Dec 13, 2016
629
305
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:

Michael Farkas

Celebrate 68
Jun 28, 2006
14,560
9,903
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
305
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.
 
  • Like
Reactions: DatsyukToZetterberg

Ad

Upcoming events

Ad

Ad