Documentation / Inside a game
Goals
GET /v1/games/{game_id}/goalsFree key and upMCP tool: game_scoring
Every goal in order: period, time, side, scorer, assists, strength, empty net and the score after it.
GET
https://api.icehockeyapi.com/v1/games/{game_id}/goalshttps://api.icehockeyapi.com/v1/games/gm_seyr9d88/goalscurl "https://api.icehockeyapi.com/v1/games/gm_seyr9d88/goals" \ -H "X-API-Key: YOUR_KEY"
200 OKExample answer from the data, 12 Oct
{
"data": [
{
"number": 1,
"period": 1,
"time_seconds": 27,
"side": "home",
"scorer": {
"id": "pl_eb1y2yzq",
"name": "Tye Kartye"
},
"assists": [
{
"id": "pl_1rp3dfd1",
"name": "J.T. Miller"
},
{
"id": "pl_k5173zwm",
"name": "Alexis Lafrenière"
}
],
"strength": "even",
"empty_net": false,
"game_winner": false,
"score_after": {
"home": 1,
"away": 0
}
},
{
"number": 2,
"period": 1,
"time_seconds": 1024,
"side": "away",
"scorer": {
"id": "pl_7ztvs1q7",
"name": "Jake DeBrusk"
},
"assists": [
{
"id": "pl_gcq1jn9f",
"name": "Jonathan Lekkerimäki"
}
],
"strength": "even",
"empty_net": false,
"game_winner": false,
"score_after": {
"home": 1,
"away": 1
}
},
{
"number": 3,
"period": 2,
"time_seconds": 129,
"side": "home",
"scorer": {
"id": "pl_tt2g1enk",
"name": "Will Cuylle"
},
"assists": [
{
"id": "pl_hrj96gn4",
"name": "Noah Laba"
}
],
"strength": "even",
"empty_net": false,
"game_winner": false,
"score_after": {
"home": 2,
"away": 1
}
}
],
"meta": {
"game_id": "gm_seyr9d88",
"count": 8,
"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 |
side | string |
scorer | object |
scorer.id | string |
scorer.name | string |
assists | list |
strength | string |
empty_net | bool |
game_winner | bool |
score_after | object |
score_after.home | int |
score_after.away | int |