Skip to main content

Function: hockeytechPlayerToi()

hockeytechPlayerToi(league, gameId): Promise<Row[]>

Defined in: src/analytics/hockeytech_family.ts:128

<lg>_player_toi (py player_toi over the live shift feed): per-player time-on-ice totals for a game.

Parameters​

league​

string

HockeyTech league slug from HOCKEYTECH_LEAGUES.

gameId​

GameId

The league's game id (number or string).

Returns​

Promise<Row[]>

The player_toi rows — player_id (decimal string), first_name, last_name, toi_seconds, num_shifts, avg_shift_s — sorted by toi_seconds descending. [] for a game with no shifts.

Throws​

AssetFetchError when the fetch fails or a 200 body lacks the SiteKit.Gameshifts envelope (propagated).

Throws​

NoDataError on a 404 (propagated from the getter).

Example​

import sdv from "sportsdataverse";
const toi = await sdv.hockeytech.hockeytech_player_toi({ league: "pwhl", game_id: 42 });
toi[0].toi_seconds; // the game's ice-time leader

Remarks​

One modulekit/gameshifts request. Ids become decimal strings on the way out.