How do I track NFL spread and total movement in Python?
Time-stamped snapshots of every sportsbook's spread, total and moneyline for a game. This keeps the last week before kickoff and prints how each book moved.
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. Spreads are the home team's, so a negative number means the home side is favoured.
import requests
import pandas as pd
API_KEY = "YOUR_API_KEY"
resp = requests.post(
"https://mcp.endzoneapi.com/v1/get_line_movement",
headers={"x-api-key": API_KEY},
json={
"game_id": "2025_10_PHI_GB",
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]
kickoff = pd.Timestamp(data["kickoff"])
rows = []
for book, snaps in data["movement"].items():
df = pd.DataFrame(snaps)
df["captured_at"] = pd.to_datetime(df["captured_at"])
week = df[df["captured_at"] >= kickoff - pd.Timedelta(days=7)].sort_values("captured_at")
first, last = week.iloc[0], week.iloc[-1]
rows.append({
"book": book,
"snapshots": len(week),
"spread_first": first["spread_home"],
"spread_last": last["spread_home"],
"spread_move": last["spread_home"] - first["spread_home"],
"total_first": first["total"],
"total_last": last["total"],
})
moves = pd.DataFrame(rows)
print(data["away_team"], "at", data["home_team"], "kickoff", data["kickoff"])
print(moves.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.
{
"game_id": "2025_10_PHI_GB",
"home_team": "GB",
"away_team": "PHI",
"kickoff": "2025-11-11T01:15:00.000Z",
"movement": {
"betmgm": [
{
"bookmaker": "betmgm",
"snapshot_type": "snapshot",
"source": "the_odds_api",
"ml_home": -140,
"ml_away": 118,
"ml_home_prob": 0.5833333,
"ml_away_prob": 0.4587156,
"spread_home": -2.5,
"spread_home_odds": -110,
"spread_away": 2.5,
"spread_away_odds": -110,
"total": 45,
"total_over_odds": -105,
"total_under_odds": -115,
"captured_at": "2025-11-03T16:00:00.000Z"
},
{
"bookmaker": "betmgm",
"snapshot_type": "snapshot",
"source": "the_odds_api",
"ml_home": -130,
"ml_away": 110,
"ml_home_prob": 0.5652174,
"ml_away_prob": 0.47619048,
"spread_home": -2.5,
"spread_home_odds": -110,
"spread_away": 2.5,
"spread_away_odds": -110,
"total": 44.5,
"total_over_odds": -110,
"total_under_odds": -110,
"captured_at": "2025-11-06T16:00:00.000Z"
},
"...4 more"
],
"pinnacle": [
{
"bookmaker": "pinnacle",
"snapshot_type": "snapshot",
"source": "the_odds_api",
"ml_home": -112,
"ml_away": -101,
"ml_home_prob": 0.5283019,
"ml_away_prob": 0.50248754,
"spread_home": -1,
"spread_home_odds": -105,
"spread_away": 1,
"spread_away_odds": -107,
"total": 45.5,
"total_over_odds": -111,
"total_under_odds": -103,
"captured_at": "2025-11-10T11:55:17.000Z"
},
{
"bookmaker": "pinnacle",
"snapshot_type": "snapshot",
"source": "the_odds_api",
"ml_home": -106,
"ml_away": -104,
"ml_home_prob": 0.5145631,
"ml_away_prob": 0.50980395,
"spread_home": -1,
"spread_home_odds": 100,
"spread_away": 1,
"spread_away_odds": -110,
"total": 45.5,
"total_over_odds": -109,
"total_under_odds": -103,
"captured_at": "2025-11-10T15:55:11.000Z"
},
"...1 more"
],
"...": "6 more bookmakers"
},
"snapshots": 44
}What to do next
- get_odds (10 credits). Each book's opening, closing and latest line for the game, without the time series.
- get_game_detail (10 credits). The final score and box score, to grade the move against the result.
More guides
Start with 500 free credits every month
No card. REST or MCP.