Fix

NHL shootout and overtime goals inflating totals

Short answer: in NHL play-by-play, a shootout goal is a goal row, but the final score adds only one goal for the winner. Overtime goals are in the score. Use endedIn from get_games and period_type on each play to separate regulation, overtime and shootout goals before you total anything.

The symptoms

A goal total goes wrong in a way that looks plausible, so it often ships. People report these:

  • A game with a final score of 4-3 has 11 goal events in the play-by-play.
  • Season goals per game drift up by a few hundredths after you switch from box scores to play-by-play.
  • Per-team goals for and against from events do not match the standings goal differential.
  • A regulation-only model is trained on totals that quietly include one extra goal in every shootout game.
  • Overtime goals show up twice, once in a period table and once in a "final score" column that you added on top.

The underlying cause is that a final score, a regulation goal count and an event count are three different numbers, and each is correct for a different question.

What the data holds

We checked these on December 6, 2026 against the NHL 2025-26 season. Each game in get_games carries endedIn, which is REG, OT or SO. The field is read from the game's own play-by-play, from the highest period type present, and it is null until the night's plays load with the daily run. Across the 500 most recent regular season games, 383 ended in regulation, 74 in overtime and 43 in a shootout. That is 117 games, or 23 percent, that went past 60 minutes. A pipeline that ignores the distinction is wrong on nearly a quarter of its games.

In get_plays, each event has period, period_type and type. Regulation periods are 1 to 3 with period_type REG. Overtime is period 4 in the regular season and its period_type is OT, with strength shown as 3v3 or 4v3 and so on. The shootout is period 5 with period_type SO. Shootout attempts are events too: goals, missed shots and shots on goal, with strength 1v0 and a clock that stays at 00:00. The response also has a summary block with goals, and that count includes shootout goals because they are goal events.

One detail trips up score checks. On a shootout goal row, home_score and away_score do not advance. They carry the tied score from the end of overtime. The final score is changed afterward by one goal for the winner, and the play-by-play does not show that as a goal row.

Step 1: tally goal rows by period type

This script pulls three days of finals, picks games that went past regulation and tallies every goal row by period type and team. Set PUCKAPI_API_KEY first. It costs 5 credits for the games and 10 for each play-by-play pull.

import json, os, urllib.request
from collections import Counter
KEY = os.environ["PUCKAPI_API_KEY"]

def post(tool, body):
    req = urllib.request.Request(f"https://mcp.puckapi.com/v1/{tool}", data=json.dumps(body).encode(),
                                 headers={"Content-Type": "application/json", "x-api-key": KEY})
    with urllib.request.urlopen(req, timeout=30) as resp:
        print("HTTP", resp.status, tool)
        return json.load(resp)["data"]

games = post("get_games", {"date_from": "2026-04-13", "date_to": "2026-04-15", "game_state": "FINAL"})["games"]
print(Counter(g["endedIn"] for g in games))
for g in [g for g in games if g["endedIn"] != "REG"][:4]:
    goals = post("get_plays", {"game_id": g["id"], "type": "goal", "limit": 100})["plays"]
    by = Counter((p["period_type"], p["team"]) for p in goals)
    played = sum(1 for p in goals if p["period_type"] != "SO")
    print(g["id"], g["endedIn"], f'{g["awayTeam"]} {g["awayScore"]} at {g["homeTeam"]} {g["homeScore"]}',
          "| goal rows:", len(goals), "| non-shootout rows:", played,
          "| final total:", g["awayScore"] + g["homeScore"], "|", dict(by))

On the verified run, those three days held 25 finals: 20 regulation, 3 shootouts and 2 overtimes. The first shootout game, Dallas at Buffalo, ended 4-3 and had 11 goal rows. Six were regulation goals (three each) and five were shootout goals, two for Buffalo and three for Dallas. The final total of 7 is the six regulation goals plus one for the shootout winner. A second shootout game, Colorado at Edmonton, ended 2-1 and had 7 goal rows, 2 of them non-shootout. Its final total of 3 is those 2 plus 1. The two overtime games, Los Angeles at Vancouver and Detroit at Tampa Bay, each ended 4-3 with 7 goal rows, and the single overtime goal was already in the final score.

Step 2: pick the count that matches the question

There are four counts, and each has an owner:

  • Final score total. Use it for standings, results and anything that must match what was reported. It includes overtime goals and one goal for a shootout winner.
  • Goals in play. Count goal rows where period_type is not SO. This is regulation plus overtime, and it is the right base for scoring rates, shot quality and goalie save percentage by event.
  • Regulation goals. Count goal rows where period_type is REG. Use it for a regulation-only study, such as comparing teams that were tied after 60 minutes.
  • Shootout results. Count SO goal rows only if you are studying the shootout itself. Never add them to a scoring rate.

The identity to test in your own pipeline is this: the final total equals goals in play, plus 1 if endedIn is SO. If a game breaks it, your data is incomplete for that game, and the daily load may not have finished.

def check(game, goals):
    in_play = sum(1 for p in goals if p["period_type"] != "SO")
    expected = in_play + (1 if game["endedIn"] == "SO" else 0)
    return expected == game["homeScore"] + game["awayScore"]

# all four games from the run above pass

Run that against the four games in Step 1 and it passes for every one, which is a cheap guard to keep in a nightly job.

Step 3: stop filtering on "period 4 and up"

Our own reference text for the period parameter says period 4 and above is overtime. That is true of the overtime period itself and of any extra playoff overtimes, but in the regular season period 5 is the shootout, so a filter of period >= 4 pulls in shootout attempts. Filter on period_type instead, and keep the event type filter separate. The shot map tool is the exception: it never includes shootout attempts, so a total built from shot maps will be lower than one built from get_plays for the same games, by exactly the shootout rows.

Step 4: carry the label forward, not the arithmetic

Add ended_in to your game table the first time you load a game, and store goals in play and regulation goals as separate columns next to the final score. Recompute from events only when endedIn was null at load time. When you aggregate per team, sum the columns, never subtract a derived one from another, so a shootout game cannot leak into a regulation-only series.

When not to use this

  • You need the shootout order and shooters. The goal rows tell you who scored and for which team, and the other attempts are in the same rows. This page is about totals, not shootout analysis.
  • You need a game that has not loaded yet. endedIn is null until the night's plays are in. Treat null as unknown, not as regulation.
  • You are working in a minor or junior league. The endedIn field is read for the NHL only. Other leagues return it as null, so check how a game ended there another way.
  • You want to price a total. This page counts goals. It does not suggest a wager or say how any market treats overtime.

Live from the API

Free to embed on your own site, with no key needed. Get the embed code.

Get a free key

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