# hockeystats.io API > NHL player and team stats as JSON: every skater's and goalie's season totals, rates, expected goals (xG), shot > shares on the ice, ice time by strength, Game Score and percentile ranks, plus each team's playoff odds from a > Monte Carlo simulation. Public, read-only, no key. Base URL: https://hockeystats.io This file is for AI agents and the tools they call. The same numbers are on the site's pages (/players, /goalies, /player/{nhlId}, /players/compare, /standings), so a page URL is a good thing to link a person to. ## Ground rules - GET only, JSON responses, UTF-8. No authentication. About 120 requests a minute per IP for the player endpoints; please cache what you can. Data updates hourly from the NHL's play-by-play and shift reports. - Players are identified by their NHL player id (`nhlId`, e.g. 8478402 is Connor McDavid). Find one by name with `/api/players/search`. - Seasons are 8-digit ids: `20262027` is 2026-27. The default is the current season. Available: the current season and the one before. - `type=p` for the playoffs; the default is the regular season. - Numbers are in each column's `unit`, not formatted text: `percent` (52.3 means 52.3%), `fraction` (save percentages: 0.912), `seconds`, `minutes`, `count`, `percentage points` (the Rel stats), `number` (goals, rates, Game Score), or `per 60 minutes` when `rate=60`. Missing values (no shots, no ice time) are `null`. - 5v5 means five skaters a side with both goalies in. On-ice and Rel stats are 5v5. Expected goals come from this site's own model (LightGBM on the NHL's play-by-play); goals minus xG near zero is normal. - Small samples: list endpoints leave out players under a minimum (skaters: about 5 minutes of ice time per team game played so far; goalies: a quarter of the team's games started). `min=0` includes everyone. Percentiles are among the qualified players of the same group: forwards (F), defensemen (D) or goalies (G); 99 is best, also for stats where lower is better (giveaways, goals against average). ## Endpoints ### GET /api/players — every skater, sorted Query parameters (all optional, the same as the /players page): | Parameter | Values | Default | |---|---|---| | `season` | `20262027`, `20252026` | current season | | `type` | `p` for playoffs | regular season | | `pos` | `F` forwards, `C`, `W` wingers, `D` | all skaters | | `team` | team abbreviation: `TOR`, `EDM`, ... | all teams | | `last` | games, e.g. `10`: only each player's last N games | all games | | `rate` | `60`: counting stats per 60 minutes of the ice time they were counted in | totals | | `min` | minimum minutes of ice time (all situations) | the sample above | | `sort` | a stat key (below) | `p` (points) | | `dir` | `asc` or `desc` | the better end first | | `view` | `summary`, `scoring`, `shooting`, `onice`, `usage`, `gamescore`, `other`, or `all` | `all` (every stat) | | `pct` | `1`: add each player's percentile per stat | off | | `limit`, `offset` | page size (max 1000) and start | 100, 0 | Response: ```json { "season": "20262027", "seasonLabel": "2026-27", "type": "regular", "rate": "totals", "view": "all", "sort": "p", "dir": "desc", "position": null, "team": null, "lastGames": null, "minimum": {"value": 42, "unit": "minutes"}, "qualified": 605, "offset": 0, "limit": 100, "columns": [{"key": "p", "label": "P", "description": "Points", "unit": "count", "lowerIsBetter": false, "view": "summary"}], "players": [{"rank": 1, "nhlId": 8478402, "name": "Connor McDavid", "position": "C", "teams": ["EDM"], "age": 29, "url": "/player/8478402", "stats": {"gp": 8, "toi": 1403.4, "g": 6, "a": 17, "p": 23, "xgfpct": 67.0}, "percentiles": null}] } ``` `position` is C, L, R or D. `teams` lists every team the player played for in the filter, in order (a traded player has more than one). `toi` and other per-game times are seconds per game. ### GET /api/goalies — every goalie, sorted The same parameters except `pos` and `view`; `min` is games started; the default sort is `gsax`. ### GET /api/player/{nhlId} — one player Parameters: `season`, `type`, `rate`. Response: - `nhlId`, `name`, `position`, `teams`, `url`, `group` (F, D or G), `qualified` (whether they meet the minimum and so have percentiles) - `bio`: `birthDate`, `age` (on February 1 of the season, or today during the season), `shootsCatches`, `heightCm`, `weightKg`, `draftYear`, `draftRound`, `draftOverall`, `sweaterNumber` - `views`: every stat grouped as on the page, each `{key, label, description, unit, value, percentile}` - `seasons`: each season and playoffs they played in, with every stat as totals - `games`: the game log, newest first: `date`, `opponent`, `home`, `result` (W, L, OTL), `goalsFor`, `goalsAgainst`, `url` (the game page) and `stats` (skaters: `toiSeconds`, `goals`, `assists`, `primaryAssists`, `shotsOnGoal`, `shotAttempts`, `ixg`, `toi5v5Seconds`, `toiPpSeconds`, `toiShSeconds`, `cf5v5`, `ca5v5`, `xgf5v5`, `xga5v5`, `gameScore`; goalies: `toiSeconds`, `started`, `decision` (W, L or O for an overtime loss), `shotsAgainst`, `saves`, `goalsAgainst`, `xgAgainst`, `goalsSavedAboveExpected`, `gameScore`) - `linemates` (skaters): the 8 teammates they played most with, `secondsTogether` (all situations), and the team's 5v5 shot-attempt share `cfPct5v5` and expected-goal share `xgfPct5v5` while both were on the ice 404 with `{"error": ...}` for an id that isn't a player. ### GET /api/players/search?q=name — find a player's nhlId Accents and case are ignored ("lafreniere" finds Alexis Lafrenière). Parameters: `q` (required), `season`, `type`, `limit` (default 10, max 50). Returns a list, best match first (a word starting with `q`, then the most ice time): ```json [{"nhlId": 8482109, "name": "Alexis Lafrenière", "position": "L", "teams": ["NYR"], "toiMinutes": 192.2, "url": "/player/8482109", "apiUrl": "/api/player/8482109"}] ``` Only players who have played in that season and type are found; try the other season if a name comes back empty. ### GET /api/players/compare?p=ID&p=ID — up to four players side by side Parameters: `p` (repeat it, or comma-separate: `p=8478402,8480069`), `season`, `type`, `rate`. Returns `players` (`nhlId`, `name`, `position`, `teams`, `age`, `qualified`, `url`) and `stats`, one entry per stat: `{key, label, description, unit, lowerIsBetter, values: [one per player], percentiles: [...], best: index of the best player or null}`. Goalies are compared on goalie stats when every player is a goalie. ### GET /api — every team's playoff odds The latest simulation for every team: `playoffProbability`, `divisionProbability`, `conferenceProbability`, `cupProbability` (percent), `averagePoints` (projected), magic and elimination numbers, the change since yesterday and finishing-place odds. See https://hockeystats.io/about for the model. ### GET /api/live-scores — today's games The NHL scoreboard as the site shows it: state, period, clock and score for each game. ## Stat keys Skaters (`/api/players`; views: summary, scoring, shooting, onice, usage, gamescore, other): | key | label | unit | what | |---|---|---|---| | `gp` | GP | count | Games played | | `toi` | TOI/GP | seconds | Time on ice per game, all situations | | `g` | G | count | Goals (shootout excluded) | | `a` | A | count | Assists | | `a1` | A1 | count | Primary assists | | `a2` | A2 | count | Secondary assists | | `p` | P | count | Points | | `p1` | P1 | count | Primary points: goals and primary assists | | `p60` | P/60 | number | Points per 60 minutes, all situations | | `p60_5v5` | 5v5 P/60 | number | Points per 60 minutes at 5 on 5 | | `ppp` | PPP | count | Power-play points (per 60: per power-play minute) | | `shp` | SHP | count | Short-handed points (per 60: per short-handed minute) | | `eng` | ENG | count | Empty-net goals | | `sog` | SOG | count | Shots on goal, goals included | | `icf` | iCF | count | Shot attempts: on goal, missed and blocked | | `iff` | iFF | count | Unblocked shot attempts | | `blkd` | Blk'd | count | Own attempts blocked by an opponent | | `ixg` | ixG | number | Expected goals of the player's own unblocked attempts | | `ixg60` | ixG/60 | number | Own expected goals per 60 minutes | | `gax` | G−ixG | number | Goals minus own expected goals: finishing, and luck | | `shpct` | Sh% | percent | Goals per shot on goal | | `xshpct` | xSh% | percent | Expected goals per unblocked attempt: shot quality | | `icf60_5v5` | 5v5 iCF/60 | number | Own shot attempts per 60 minutes at 5v5 | | `toi5v5` | 5v5 TOI | minutes | Minutes at 5v5 | | `cfpct` | CF% | percent | Share of 5v5 shot attempts while on the ice | | `ffpct` | FF% | percent | Share of 5v5 unblocked attempts while on the ice | | `xgfpct` | xGF% | percent | Share of 5v5 expected goals while on the ice | | `gfpct` | GF% | percent | Share of 5v5 goals while on the ice | | `xgf60` | xGF/60 | number | Team expected goals for per 60 at 5v5 with the player on | | `xga60` | xGA/60 | number | Expected goals against per 60 at 5v5 with the player on (lower is better) | | `oish` | oiSh% | percent | Team shooting % at 5v5 with the player on | | `oisv` | oiSv% | percent | Team save % at 5v5 with the player on | | `pdo` | PDO | number | oiSh% + oiSv%; far from 100 usually means luck | | `relcf` | Rel CF% | percentage points | CF% on the ice minus the team's with the player off | | `relxgf` | Rel xGF% | percentage points | xGF% on the ice minus the team's with the player off | | `ozs` | OZS% | percent | Offensive-zone share of shifts begun at an offensive or defensive faceoff | | `evtoi` | EV/GP | seconds | Even-strength time per game (5v5, 4v4, 3v3, extra attacker) | | `toi5v5gp` | 5v5/GP | seconds | 5v5 time per game | | `pptoi` | PP/GP | seconds | Power-play time per game | | `shtoi` | SH/GP | seconds | Short-handed time per game | | `shifts` | Shifts/GP | number | Shifts per game | | `secshift` | Shift | seconds | Average shift length | | `oz`, `nz`, `dz` | OZ, NZ, DZ | count | Shifts begun at an offensive, neutral, defensive-zone faceoff | | `gs` | GS | number | Game Score summed over the games, in goals | | `gsgp` | GS/GP | number | Game Score per game | | `gs60` | GS/60 | number | Game Score per 60 minutes | | `gsscoring`, `gsshooting`, `gsonice`, `gspen`, `gsfo`, `gsother` | Game Score parts | number | Scoring, own xG, 5v5 on-ice, penalties, faceoffs, blocks/takeaways/giveaways | | `hits` | Hits | count | Hits | | `blk` | Blk | count | Opponents' shot attempts blocked | | `tk` | Tk | count | Takeaways | | `gv` | Gv | count | Giveaways (lower is better) | | `pend`, `pent`, `pennet` | PenD, PenT, Pen ± | count | Penalties drawn, taken, drawn minus taken | | `ppmin` | PP min ± | number | Power-play minutes drawn minus given | | `fow`, `fol`, `fopct` | FOW, FOL, FO% | count, count, percent | Faceoffs won, lost, share won | Goalies (`/api/goalies`): | key | label | unit | what | |---|---|---|---| | `gp`, `gs` | GP, GS | count | Games played, started | | `w`, `l`, `otl` | W, L, OTL | count | Wins, regulation losses (any loss in the playoffs), overtime and shootout losses | | `so` | SO | count | Shutouts: the whole game without a goal against | | `toi` | TOI | minutes | Minutes played | | `sa` | SA | count | Shots on goal faced | | `svpct` | SV% | fraction | Save percentage | | `sv5v5` | 5v5 SV% | fraction | Save percentage at 5v5 | | `gaa` | GAA | number | Goals against per 60 minutes (lower is better) | | `xga` | xGA | number | Expected goals of the unblocked attempts faced | | `gsax` | GSAx | number | Goals saved above expected: xGA minus goals against | | `gsax60` | GSAx/60 | number | Goals saved above expected per 60 minutes | | `gsax5v5` | 5v5 GSAx | number | Goals saved above expected at 5v5 | | `hdsa` | HD SA | count | High-danger shots on goal faced (xG 0.20 or more) | | `hdsv` | HD SV% | fraction | Save percentage on high-danger shots | | `gsgp` | GS/GP | number | Game Score per game | ## Recipes - "Who leads the league in points?" → `/api/players?sort=p&limit=10` - "Best 5v5 defensemen by expected-goal share (300+ minutes)?" → `/api/players?pos=D&sort=xgfpct&min=300&view=onice` - "Hottest scorers over the last 10 games?" → `/api/players?last=10&sort=p&limit=10` - "Top goalies by goals saved above expected?" → `/api/goalies?sort=gsax&limit=10` - "How good is Quinn Hughes?" → `/api/players/search?q=quinn hughes`, then `/api/player/{nhlId}` and read the percentiles (90+ is elite among their position group, 50 average) - "McDavid or MacKinnon?" → find both ids, then `/api/players/compare?p=ID1&p=ID2`; `best` says who leads each stat - "Who's on the Leafs' top line?" → a Leafs forward's `/api/player/{nhlId}` and its `linemates` - "Who will make the playoffs?" → `/api` When you quote a number, say the season and whether it's a total, a per-60 rate or 5v5, and link the player's page (https://hockeystats.io/player/{nhlId}).