NHL game_shifts API
game_shifts
nhl.game_shiftsEvery shift of every player in every NHL game since 2021-22 — the period, when the player came on and went off the ice and how long the shift lasted.
GET/api/v1/nhl/game_shiftsList game_shifts for NHL
Requires one of:
game_id — requests satisfying none of these return 400.Parameters
game_idquerybigintoptionalFilter to a single game.
team_idquerybigintoptionalFilter by team.
player_idquerybigintoptionalFilter to a single player.
periodqueryintegeroptionalFilter to a period (1-3; 4 and up for overtime).
limitqueryintegeroptionaldefault 50Page size. Defaults to 50; max 5000.
from_idquerybigintoptionalReturn rows with id strictly greater than this value; page using the previous response's `next_from_id`. Omit on the first page.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
-H 'Authorization: Bearer YOUR_API_KEY' \
'https://api.stat-api.com/api/v1/nhl/game_shifts?game_id=1'Responses
200game_shifts rows matching the declared filter set, wrapped in { game_shifts, limit, next_from_id, has_more }. has_more is true when another row follows this page. To walk every row, start with ?from_id=0 and pass each next_from_id back as from_id until it is null; the filters stay. A first page without from_id comes in the default order and gives next_from_id null.application/jsonshow example ▸
400No declared filter set was satisfied — response body matches MissingRequiredFiltersError; pick one combo from the accepted-sets hint and resend.
application/jsonResponse Schema(11 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
game_id | bigint | — e.g. 15957 | |
league_shift_id | bigintnullable | — | The league's id for this shift. Empty for a shift rebuilt from the official time-on-ice report. e.g. — (all-null in sample) |
player_id | bigint | — e.g. 6878 | |
team_id | bigint | — e.g. 30 | |
detail_code | integernullable | — | The league's shift detail code (0 for a regular shift). Empty for a shift rebuilt from the official time-on-ice report. e.g. — (all-null in sample) |
duration_seconds | integer | — | — e.g. 43 |
end_seconds | integer | — | Seconds elapsed in the period when the shift ended e.g. 1200 |
period | integer | — | — e.g. 1 |
shift_number | integer | — | The player's shift number in the game e.g. 1 |
start_seconds | integer | — | Seconds elapsed in the period when the shift started e.g. 0 |
GET/api/v1/nhl/game_shifts/{id}Get a single game_shift by id
Parameters
idpathbigintrequiredPrimary key (id) of the game_shift row.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
-H 'Authorization: Bearer YOUR_API_KEY' \
'https://api.stat-api.com/api/v1/nhl/game_shifts/{pk_value}'Responses
200Single game_shift row.application/jsonshow example ▸
404Row not found.
Response Schema(11 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
game_id | bigint | — e.g. 15957 | |
league_shift_id | bigintnullable | — | The league's id for this shift. Empty for a shift rebuilt from the official time-on-ice report. e.g. — (all-null in sample) |
player_id | bigint | — e.g. 6878 | |
team_id | bigint | — e.g. 30 | |
detail_code | integernullable | — | The league's shift detail code (0 for a regular shift). Empty for a shift rebuilt from the official time-on-ice report. e.g. — (all-null in sample) |
duration_seconds | integer | — | — e.g. 43 |
end_seconds | integer | — | Seconds elapsed in the period when the shift ended e.g. 1200 |
period | integer | — | — e.g. 1 |
shift_number | integer | — | The player's shift number in the game e.g. 1 |
start_seconds | integer | — | Seconds elapsed in the period when the shift started e.g. 0 |