Skip to content

Guides

How do I get today's NHL schedule and scores in Python?

Every NHL game on a date with teams, score, venue and game state, loaded into pandas. October 10 had 14 games and 5.36 goals per game.

Code verified October 12, 2026. One call to get_games, 5 credits.

The call

Dates are YYYY-MM-DD. Add team for one club, or game_state FINAL or FUT to keep finished or unplayed games. get_schedule lists only upcoming games. Pass league: "ahl" for the AHL.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

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

games = pd.DataFrame(data["games"])
done = games[games["gameState"].isin(["FINAL", "OFF"])].copy()
done["winner"] = done.apply(lambda g: g["homeTeam"] if g["homeScore"] > g["awayScore"] else g["awayTeam"], axis=1)
print(len(games), "games on", games["gameDate"].iloc[0], "-", len(done), "finished")
print(done[["awayTeam", "awayScore", "homeTeam", "homeScore", "winner"]].to_string(index=False))
print("goals per game:", round((done["homeScore"] + done["awayScore"]).mean(), 2))

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.

{
  "games": [
    {
      "id": "2026020082",
      "season": "20262027",
      "gameDate": "2026-10-10",
      "startTime": "2026-10-11T02:00:00.000Z",
      "homeTeam": "CGY",
      "awayTeam": "ANA",
      "homeTeamName": "Calgary Flames",
      "awayTeamName": "Anaheim Ducks",
      "homeScore": 2,
      "awayScore": 4,
      "gameState": "OFF",
      "gameType": "regular",
      "venue": "Scotiabank Saddledome"
    },
    {
      "id": "2026020078",
      "season": "20262027",
      "gameDate": "2026-10-10",
      "startTime": "2026-10-10T23:00:00.000Z",
      "homeTeam": "CHI",
      "awayTeam": "CAR",
      "homeTeamName": "Chicago Blackhawks",
      "awayTeamName": "Carolina Hurricanes",
      "homeScore": 2,
      "awayScore": 5,
      "gameState": "OFF",
      "gameType": "regular",
      "venue": "United Center"
    },
    "...12 more"
  ],
  "count": 14
}

What to do next

  • get_schedule (2 credits). Only the games still to be played over the next few days.
  • get_game_detail (10 credits). The box score, odds and goalie starts for one game from this list.

More guides

Start with 500 free credits every month

No card. REST or MCP.