Skip to content

Guides

How do I see how an NHL line moved from open to close?

Each sportsbook's snapshots of a game's moneyline, puck line and total in time order, so you can measure how far the price moved and which books moved first.

Code verified October 12, 2026. One call to get_line_movement, 25 credits.

The call

game_id comes from get_games or get_schedule. Pass bookmaker to keep one book. Snapshots are early opening, opening and closing, and some books have only two of them.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

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

def implied(odds):
    return 100 / (odds + 100) if odds > 0 else -odds / (-odds + 100)

rows = []
for book, snaps in data["movement"].items():
    snaps = sorted(snaps, key=lambda s: s["capturedAt"])
    first, last = snaps[0], snaps[-1]
    rows.append({
        "book": book,
        "snapshots": len(snaps),
        "first": first["snapshotType"],
        "ml_first": first["mlHome"],
        "ml_last": last["mlHome"],
        "prob_move": implied(last["mlHome"]) - implied(first["mlHome"]),
        "total_first": first["total"],
        "total_last": last["total"],
    })
moves = pd.DataFrame(rows)
print(data["away_team"], "at", data["home_team"])
print(moves.round(3).to_string(index=False))
print("average move in home win probability:", round(moves["prob_move"].mean(), 3))

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.

{
  "game_id": "2025020002",
  "home_team": "NYR",
  "away_team": "PIT",
  "movement": {
    "betmgm": [
      {
        "bookmaker": "betmgm",
        "snapshotType": "early_opening",
        "source": "the_odds_api",
        "mlHome": -225,
        "mlAway": 185,
        "spreadHome": -1.5,
        "total": null,
        "capturedAt": "2025-10-06T23:54:46.000Z"
      },
      {
        "bookmaker": "betmgm",
        "snapshotType": "opening",
        "source": "the_odds_api",
        "mlHome": -225,
        "mlAway": 185,
        "spreadHome": -1.5,
        "total": null,
        "capturedAt": "2025-10-07T11:53:38.000Z"
      },
      {
        "bookmaker": "betmgm",
        "snapshotType": "closing",
        "source": "the_odds_api",
        "mlHome": -235,
        "mlAway": 190,
        "spreadHome": -1.5,
        "total": null,
        "capturedAt": "2025-10-07T22:55:02.000Z"
      }
    ],
    "draftkings": [
      {
        "bookmaker": "draftkings",
        "snapshotType": "early_opening",
        "source": "the_odds_api",
        "mlHome": -225,
        "mlAway": 185,
        "spreadHome": -1.5,
        "total": 5.5,
        "capturedAt": "2025-10-06T23:54:46.000Z"
      },
      {
        "bookmaker": "draftkings",
        "snapshotType": "opening",
        "source": "the_odds_api",
        "mlHome": -225,
        "mlAway": 185,
        "spreadHome": -1.5,
        "total": 5.5,
        "capturedAt": "2025-10-07T11:54:56.000Z"
      },
      {
        "bookmaker": "draftkings",
        "snapshotType": "closing",
        "source": "the_odds_api",
        "mlHome": -238,
        "mlAway": 195,
        "spreadHome": -1.5,
        "total": 6.5,
        "capturedAt": "2025-10-07T22:55:06.000Z"
      }
    ],
    "...": "6 more bookmakers"
  }
}

What to do next

  • get_odds (10 credits). Opening and closing lines by bookmaker as a flat list, for one game or a whole season.
  • get_game_detail (10 credits). The result and goalie starts, to grade the move.

More guides

Start with 500 free credits every month

No card. REST or MCP.