Skip to main content

NHL recipes

Hockey lives under sdv.nhl and spans the richest native surface in the package — the ESPN wrappers plus four NHL-operated APIs:

FamilyMethodsHostWhat it covers
ESPNespnNhl*site.api.espn.comscoreboard, rosters, summary
api-webnhlApiWeb*api-web.nhle.complay-by-play, boxscores, standings, leaders
EDGEnhlEdge*api-web.nhle.complayer/team puck & skating tracking
Stats RESTnhlStatsRest*api.nhle.com/stats/restfranchises, seasons, glossary
RecordsnhlRecords*records.nhl.comall-time franchise & player records

All honor { parsed: true }.

ESPN scoreboard

import sdv from 'sportsdataverse';

const games = await sdv.nhl.espnNhlScoreboard({ parsed: true });
console.table(games);

Open in playground ▶

Full-season standings (api-web)

No parameters needed — the current season's standings, tidied.

import sdv from 'sportsdataverse';

const standings = await sdv.nhl.nhlApiWebStandingsSeason({ parsed: true });
console.table(standings);

Live and inline — a native api-web.nhle.com request, no params:

Loading live cell…

Open in playground ▶

Play-by-play for one game (api-web)

import sdv from 'sportsdataverse';

// 2023030417 = a 2023 Stanley Cup Final game
const plays = await sdv.nhl.nhlApiWebPbp({ game_id: '2023030417', parsed: true });
console.table(plays.slice(0, 10));

The game feed, parsed to plays — change game_id and re-run:

Loading live cell…

Open in playground ▶

The other native families

EDGE player tracking

Skating-speed top-10 board. Pass positions, sort_by, a season (e.g. 20242025), and game_type (2 = regular season).

import sdv from 'sportsdataverse';

const fastest = await sdv.nhl.nhlEdgeSkaterSpeedTop10({
positions: 'forwards',
sort_by: 'maxSkatingSpeed',
season: '20242025',
game_type: 2,
parsed: true,
});
console.table(fastest);

Open in playground ▶

Stats REST — franchises

The lang path param defaults to en.

import sdv from 'sportsdataverse';

const franchises = await sdv.nhl.nhlStatsRestFranchise({ lang: 'en', parsed: true });
console.table(franchises);

Open in playground ▶

Records — every franchise

No params — every NHL franchise with its records metadata.

import sdv from 'sportsdataverse';

const records = await sdv.nhl.nhlRecordsFranchises({ parsed: true });
console.table(records);

Open in playground ▶

Beyond the NHL — HockeyTech (PWHL + junior/minor)

The rest of hockey lives on its own sdv.hockeytech namespace (HockeyTech / LeagueStat), nested under Hockey in the sidebar. One gateway serves every league — pick it with the league param:

leagueLeague
pwhlProfessional Women's Hockey League (major)
ahlAmerican Hockey League
ohl / whlOntario / Western Hockey League (CHL juniors)
qmjhlQuébec Maritimes Junior Hockey League

Keys default in; switch leagues by changing league. Every endpoint honors { parsed: true }.

PWHL schedule

import sdv from 'sportsdataverse';

const games = await sdv.hockeytech.hockeytech_schedule({ league: 'pwhl', parsed: true });
console.table(games);

Live and inline — swap league for ahl / ohl / whl:

Loading live cell…

Open in playground ▶

PWHL standings

import sdv from 'sportsdataverse';

const standings = await sdv.hockeytech.hockeytech_standings({ league: 'pwhl', parsed: true });
console.table(standings);
Loading live cell…

Open in playground ▶

Stat leaders, players & play-by-play

hockeytech_leaders (skater/goalie leaderboards), hockeytech_player_stats (career season stats by player_id) and hockeytech_pbp (per-game events by game_id) round out the surface, alongside teams, team_roster, game_shifts, game_summary, and seasons.

import sdv from 'sportsdataverse';

const leaders = await sdv.hockeytech.hockeytech_leaders({ league: 'pwhl', parsed: true });
console.table(leaders);
Loading live cell…

Open in playground ▶

note

PWHL / AHL / OHL / WHL run live in the playground. QMJHL uses a secondary host (cluster.leaguestat.com) that isn't in the playground's proxy allowlist — league: 'qmjhl' works from the library, but its in-browser playground/RunCell calls won't resolve. Full method + column tables: HockeyTech reference.

Run it live

The cell below runs the published npm package end to end against the native api-web family — the game feed, parsed to plays right in your browser:

const sdv = (await import('sportsdataverse')).default;

// 2023030417 = a 2023 Stanley Cup Final game
const plays = await sdv.nhl.nhlApiWebPbp({ game_id: '2023030417', parsed: true });

// first ten parsed play rows
plays.slice(0, 10);
note

RunKit cells install sportsdataverse from npm, so the v3 method names above (nhlApiWebPbp, nhlEdge*, the parsed option) light up once v3 is published. Until then the embed may resolve v2, whose surface differs. Copy any snippet into Node to run it against your installed version.

tip

Full method + parameter tables: NHL reference (ESPN, api-web, EDGE, Stats REST, and Records families).