NHL.com Goal Simulations

morehockeystats

Unusual hockey stats
Dec 13, 2016
626
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)

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

Ad

Upcoming events

Ad

Ad