Documentation / Inside a game
Play by play
GET /v1/games/{game_id}/eventsLive and up
Every event in order: type, period, time, side, players, goalie, zone, rink position and shot type. While a North American top league game is being played it is read again every minute, and meta.live gives the period, clock and score as they stand.
GET
https://api.icehockeyapi.com/v1/games/{game_id}/eventshttps://api.icehockeyapi.com/v1/games/gm_seyr9d88/eventscurl "https://api.icehockeyapi.com/v1/games/gm_seyr9d88/events" \ -H "X-API-Key: YOUR_KEY"
200 OKExample answer from the data, 12 Oct
{
"data": [
{
"number": 1,
"period": 1,
"time_seconds": 0,
"type": "period_start",
"side": null,
"players": [],
"goalie": null,
"zone": null,
"x": null,
"y": null,
"shot_type": null
},
{
"number": 2,
"period": 1,
"time_seconds": 0,
"type": "faceoff",
"side": "away",
"players": [
{
"id": "pl_fpkynced",
"name": "Elias Pettersson"
},
{
"id": "pl_1rp3dfd1",
"name": "J.T. Miller"
}
],
"goalie": null,
"zone": "neutral",
"x": 0,
"y": 0,
"shot_type": null
},
{
"number": 3,
"period": 1,
"time_seconds": 11,
"type": "hit",
"side": "away",
"players": [
{
"id": "pl_fpkynced",
"name": "Elias Pettersson"
},
{
"id": "pl_qf6kqgj1",
"name": "Vladislav Gavrikov"
}
],
"goalie": null,
"zone": "offensive",
"x": 71,
"y": -39,
"shot_type": null
}
],
"meta": {
"game_id": "gm_seyr9d88",
"count": 307,
"detail": true,
"plan": "Complete"
}
}Run works once the API is live; the code above works now.
Parameters
| Name | In | Type | What it does |
|---|---|---|---|
game_id required | path | id | A game, from /v1/games. |
Returns
| Field | Type |
|---|---|
number | int |
period | int |
time_seconds | int |
type | string |
side | null |
players | list |
goalie | null |
zone | null |
x | null |
y | null |
shot_type | null |