Dataset

NHL shot-level data in Parquet, with shifts and goalie time on ice

Short answer: the NHL History package is play-by-play with shot coordinates, shot type, strength and shooters for every game since 2015-16, plus every shift and official goalie time on ice, as Parquet and CSV for $249. It has no expected goals column, so you fit that yourself.

Is there an xG column?

People search for "NHL shot-level xG", so here is the plain answer first. The package gives you the inputs to an expected goals model, not the output. Each shot attempt has an x and y location on the rink, a shot type, a strength state such as 5v5 or 5v4, the shooter, the goalie in net and the result. We do not ship a per-shot xG value for hockey, in the files or in the API. If you want one, a logistic model on distance, angle, shot type and strength is a good start, and the data supports it.

If a ready-made xG column is the thing you need, our soccer data has one on every located shot, and you can read about it on the Premier League match events page. For hockey today, that part is yours to build.

What is in NHL History

The package (id nhl-history, $249 one time) holds these tables, all keyed on the league's 10-digit game_id:

Every table comes as Parquet (zstd) and as CSV. The large ones, such as play_by_play and shifts, are one file per season, for example play_by_play_20252026.parquet. A README, a data dictionary, a row-count file and checksums come with it.

Two bigger tiers add market history. NHL History + Odds ($499) adds moneyline, puck line and total by sportsbook since 2019-20, with opening and closing lines from 2020-21. NHL Complete ($799) adds graded player props from 2022-23 (8.9M rows) and the full intraday line history from 2019-20 (27.5M pre-game rows). These are records of what the market posted. Upgrading later costs the price difference within 90 days.

Coverage and updates

Games run from 2015-16 through the current season. Season ids are eight digits, such as 20242025. Team codes are the ones each team carried that season, so Arizona reads ARI and the same franchise reads UTA from 2024-25. Player and game ids stay the same in every season.

A package includes finished seasons plus the current season as of the latest monthly update on your purchase date. A game's shift chart usually arrives a day after the game, so the newest game can have no shifts yet. The shift audit table flags it. With an API plan of Pro or higher, the current season's files refresh monthly at no charge. Without a plan, an end-of-season update costs a quarter of the package price.

Schema

Real column names from the free sample's play_by_play Parquet file, next to the matching field in the live API.

Package columnAPI field (get_plays)Meaning
game_id, event_id, seasongame_id, event_id, seasonKeys
sort_ordersort_orderEvent order inside the game
period, period_typeperiod, period_typePeriod number, and regulation or overtime
time_in_period, seconds_elapsedtime_in_period, seconds_elapsedGame clock
type_desc_keytypegoal, shot-on-goal, missed-shot, blocked-shot, hit, faceoff and others
strength, away_skaters, home_skatersstrength, away_skaters, home_skatersState such as 5v5, and skater counts
x_coord, y_coordx_coord, y_coordRink location in feet, center ice at 0,0
zone_codezoneOffensive, neutral or defensive zone for the event owner
shot_typeshot_typewrist, snap, slap, backhand, tip-in, deflected, wrap-around
shooting_player_id, goalie_in_net_idshooting_player_id, goalie_in_net_idShooter and the goalie facing the shot
blocking_player_id, scoring_player_idsameBlocker, and scorer on goals
assist1_player_id, assist2_player_idsamePrimary and secondary assists
home_team_defending_sidenot in the shot rowsWhich end the home team defends this period
away_score, home_score, away_sog, home_sogaway_score, home_scoreRunning score and shots on goal

The package also has fields the API's play rows leave out, including time_remaining, situation_code, event_owner_team_id and secondary_reason.

A real sample

Five shot attempts from game 2024030416 (2025 Stanley Cup Final, game 6 in Florida), from the live API on December 6, 2026.

event_idperiodseconds_elapsedtypeteamstrengthx_coordy_coordzoneshot_type
351117blocked-shotEDM5v55412Dnone
68168shot-on-goalEDM5v556-22Owrist
151193blocked-shotEDM5v55226Dnone
761100blocked-shotFLA5v5-5828Dnone
831141shot-on-goalEDM5v52741Owrist

Blocked attempts are in the table next to shots on goal and misses. For a shot-quality model, treat them as their own class or drop them and fit on unblocked attempts.

Load the Parquet files

DuckDB. This counts unblocked 5v5 attempts by shot type and the share that became goals, from every season file at once:

import duckdb

duckdb.sql("""
    SELECT shot_type,
           count(*) AS attempts,
           round(avg((type_desc_key = 'goal')::int), 3) AS goal_rate
    FROM read_parquet('play_by_play_*.parquet')
    WHERE type_desc_key IN ('goal', 'shot-on-goal', 'missed-shot')
      AND strength = '5v5'
      AND shot_type IS NOT NULL
    GROUP BY shot_type
    ORDER BY attempts DESC
""").show()

Polars, building the feature table for a first model of your own:

import math
import polars as pl

shots = (
    pl.scan_parquet("play_by_play_*.parquet")
    .filter(pl.col("type_desc_key").is_in(["goal", "shot-on-goal", "missed-shot"]))
    .with_columns(
        pl.col("x_coord").abs().alias("ax"),
        pl.col("y_coord").abs().alias("ay"),
    )
    .with_columns(
        ((89 - pl.col("ax")) ** 2 + pl.col("ay") ** 2).sqrt().alias("distance_ft"),
        (pl.col("type_desc_key") == "goal").cast(pl.Int8).alias("is_goal"),
    )
    .collect()
)
print(shots.select("distance_ft", "is_goal").describe())

The 89 is the goal line's distance from center ice in feet. Taking the absolute value of x folds both ends of the rink onto one half, which works for attempts because they are taken in the attacking half. Spot-check a few games against home_team_defending_side before you trust it.

Same events through the API

Set SDHQ_API_KEY from your account.

import json
import os
import urllib.request

payload = {"game_id": "2024030416", "shot_attempts_only": True, "limit": 5}
req = urllib.request.Request(
    "https://api.sportsdatahq.com/v1/nhl/get_plays",
    data=json.dumps(payload).encode(),
    headers={"Content-Type": "application/json", "x-api-key": os.environ["SDHQ_API_KEY"]},
)
with urllib.request.urlopen(req, timeout=30) as resp:
    print("HTTP", resp.status)
    body = json.load(resp)["data"]
    for p in body["plays"]:
        print(p["period"], p["seconds_elapsed"], p["type"], p["x_coord"], p["y_coord"], p["shot_type"])
curl -s -X POST https://api.sportsdatahq.com/v1/nhl/get_plays \
  -H "Content-Type: application/json" -H "x-api-key: $SDHQ_API_KEY" \
  -d '{"game_id": "2024030416", "shot_attempts_only": true, "limit": 5}'

A call costs 10 credits. There is also a get_shot_map call that returns only shot attempts with shooter and goalie. The hub plan has 1,000 free credits a month; PuckAPI, the hockey brand, has its own docs and 500.

Get a free key

Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.