Skip to content

Guides

How do I get NHL standings in Python?

The NHL table for the current season: record, points, goal differential and 5v5 possession for all 32 teams, grouped by division in pandas.

Code verified October 12, 2026. One call to get_standings, 2 credits.

The call

season is the 8-digit id and defaults to the current one. Filter with conference or division. Pass league: "ahl" for the AHL, which has no possession columns.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.puckapi.com/v1/get_standings",
    headers={"x-api-key": API_KEY},
    json={},
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

table = pd.DataFrame(data["standings"])
print("as of", data["snapshot_date"], "-", len(table), "teams")
top = table.sort_values(["points", "goalDiff"], ascending=False).groupby("division").head(3)
cols = ["division", "teamAbbrev", "gamesPlayed", "wins", "losses", "otLosses", "points", "pointPct", "goalDiff"]
print(top.sort_values(["division", "points"], ascending=[True, False])[cols].round(3).to_string(index=False))

Replace YOUR_API_KEY with a key from your dashboard. Python needs requests and pandas (pip install requests pandas). JavaScript runs on Node 18 or newer, or in the browser.

What comes back

The data object of the response, trimmed to the first rows. Every field is real output from the run above.

{
  "standings": [
    {
      "teamAbbrev": "VGK",
      "teamName": "Vegas Golden Knights",
      "conference": "Western",
      "division": "Pacific",
      "rank": 1,
      "points": 10,
      "gamesPlayed": 6,
      "wins": 5,
      "losses": 1,
      "otLosses": 0,
      "pointPct": 0.833333,
      "goalDiff": 9,
      "goalsForPerGame": 3.83,
      "goalsAgainstPerGame": 2.33,
      "corsiPct": 57.19557,
      "fenwickPct": 58.354755,
      "expectedGoalsFor": 13.906807,
      "expectedGoalsAgainst": 8.233882,
      "snapshotDate": "2026-10-11"
    },
    {
      "teamAbbrev": "EDM",
      "teamName": "Edmonton Oilers",
      "conference": "Western",
      "division": "Pacific",
      "rank": 2,
      "points": 9,
      "gamesPlayed": 5,
      "wins": 4,
      "losses": 0,
      "otLosses": 1,
      "pointPct": 0.9,
      "goalDiff": 8,
      "goalsForPerGame": 5,
      "goalsAgainstPerGame": 3.4,
      "corsiPct": 51.898735,
      "fenwickPct": 51.943462,
      "expectedGoalsFor": 9.416747,
      "expectedGoalsAgainst": 7.9384804,
      "snapshotDate": "2026-10-11"
    },
    "...30 more"
  ],
  "snapshot_date": "2026-10-11",
  "count": 32
}

What to do next

  • get_team_stats (5 credits). Goals, shots and special teams for one club.
  • get_games (5 credits). The results behind each record, by team or date.

More guides

Start with 500 free credits every month

No card. REST or MCP.