name: nhl-api description: Use when answering questions about the NHL (National Hockey League) that need current or live data — player or goalie stats, team standings, today's scores, schedules, rosters, playoffs, or filtering/ranking players by nationality, team, position, or season. Covers the free no-auth public NHL APIs (api-web.nhle.com and api.nhle.com/stats/rest).
NHL API
Overview
The NHL exposes two free, no-auth, JSON public APIs (the same backend powering NHL.com). No API key, no User-Agent required (they return 200 to a plain client).
- Web API —
https://api-web.nhle.com/v1/...— ready-to-read nested objects: scores, schedule, standings, player profiles (with last-5-games), rosters./nowpaths 307-redirect to a dated URL → follow redirects (curl -L). - Stats API —
https://api.nhle.com/stats/rest/en/...— queryable stat tables (skater/goalie/team summary, season list) with acayenneExpfilter +sort. This is how you filter, rank, and aggregate (by nationality, team, season, position). Returns{"total":N,"data":[...]}.
Always pull live — do NOT answer NHL stat questions from training memory (it's stale). For deeper endpoint/field catalogs and more examples, read reference.md in this skill directory.
Quick reference
| Need | Endpoint |
|---|---|
| Today's scores / live | api-web.nhle.com/v1/score/now |
| Standings (current) | api-web.nhle.com/v1/standings/now |
| Player profile + season stats + last 5 games | api-web.nhle.com/v1/player/{id}/landing |
| Player full game log | api-web.nhle.com/v1/player/{id}/game-log/now |
| Team roster | api-web.nhle.com/v1/roster/{TEAM}/current |
| Team schedule | api-web.nhle.com/v1/club-schedule-season/{TEAM}/now |
| Find a player's ID by name | search.d3.nhle.com/api/v1/search/player?culture=en-us&q={name} |
| Current season id | api.nhle.com/stats/rest/en/season?sort=[{"property":"id","direction":"DESC"}]&limit=1 → data[0].id |
| Skater stats (filter/rank) | api.nhle.com/stats/rest/en/skater/summary?cayenneExp=... |
| Goalie stats (filter/rank) | api.nhle.com/stats/rest/en/goalie/summary?cayenneExp=... |
| Team stats | api.nhle.com/stats/rest/en/team/summary?cayenneExp=... |
{TEAM} = 3-letter abbrev (TBL, BOS…). {id} = numeric player ID (from the search endpoint).
cayenneExp — the filter language
Stats endpoints take cayenneExp (SQL-like WHERE) + optional sort (JSON) + start/limit. Let curl encode it:
# All Latvian skaters, 2025-26 regular season, ranked by points
curl -sG https://api.nhle.com/stats/rest/en/skater/summary \
--data-urlencode 'sort=[{"property":"points","direction":"DESC"}]' \
--data-urlencode 'cayenneExp=seasonId=20252026 and gameTypeId=2 and nationalityCode="LVA"'
seasonId— e.g.20252026(auto-detect via the season endpoint above).gameTypeId— 2 = regular season, 3 = playoffs.- Filterable fields:
nationalityCode,birthCountryCode,teamId,positionCode,seasonId, plus any numeric stat (points>=50). - String values need double quotes inside the expression:
nationalityCode="LVA".
Key gotchas
savePct(stats API) ≠savePctg(web API/landing). Same for GAA:goalsAgainstAverage(stats) vsgoalsAgainstAvg(landing). Sorting/filtering on the wrong name →{"message":"Invalid report property"}.nationalityCodevsbirthCountryCode— nationality = national-team eligibility; birthCountry = where born. Usually identical; differ for players born abroad. Choose deliberately ("Latvian players" →nationalityCode="LVA")./nowendpoints 307-redirect to a dated path — always follow redirects.summaryexcludes 0-GP players — a rostered player who hasn't dressed won't appear; use the roster endpoint for full rosters.- Off-season:
score/nowreturnsgames:[]; the season endpoint can flip to the next (not-yet-started) season sosummaryreturnstotal:0until games begin — fall back to the previousseasonIdif you need last season's numbers. gameState: FUT/PRE = upcoming, LIVE/CRIT = in progress, OFF/FINAL = final. Times are UTC (startTimeUTC).
Worked example
"How many points does Zemgus Girgensons have, and which Latvian goalie has the best save %?"
skater/summary?cayenneExp=seasonId=20252026 and gameTypeId=2 and nationalityCode="LVA"sorted bypoints→ Girgensons 20 P (9G 11A, 74 GP).goalie/summary?...nationalityCode="LVA"→ sort bysavePct(not savePctg) → Šilovs .888, ahead of Merzļikins .883.
Two filtered calls, no per-player lookups, no dead-ends.