Skip to content

Guides

How do I get an NFL player's weekly stats in Python?

A quarterback's season as one row per game, with passing, rushing and fantasy columns, plus the season totals, from a single call.

Code verified October 10, 2026. One call to get_player_stats, 5 credits.

The call

player_id is the GSIS id from search_players.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.endzoneapi.com/v1/get_player_stats",
    headers={"x-api-key": API_KEY},
    json={
        "player_id": "00-0034857",
        "season": 2025,
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

weeks = pd.DataFrame(data["weeks"])
cols = ["week", "opponentTeam", "completions", "attempts", "passingYards", "passingTds", "rushingYards", "fantasyPointsPpr"]
print(weeks[cols])
print(weeks["passingYards"].describe().round(1))

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.

{
  "player": {
    "gsisId": "00-0034857",
    "displayName": "Josh Allen",
    "position": "QB",
    "latestTeam": "BUF"
  },
  "season": 2025,
  "season_type": "REG",
  "season_totals": {
    "games": 16,
    "completions": 319,
    "attempts": 460,
    "passing_yards": 3668,
    "passing_tds": 25,
    "passing_interceptions": 10,
    "rushing_yards": 579,
    "rushing_tds": 14,
    "fantasy_points_ppr": 364.62
  },
  "weeks": [
    {
      "week": 1,
      "gameId": "2025_01_BAL_BUF",
      "team": "BUF",
      "opponentTeam": "BAL",
      "completions": 33,
      "attempts": 46,
      "passingYards": 394,
      "passingTds": 2,
      "rushingYards": 30,
      "fantasyPointsPpr": 38.76
    },
    {
      "week": 2,
      "gameId": "2025_02_BUF_NYJ",
      "team": "BUF",
      "opponentTeam": "NYJ",
      "completions": 14,
      "attempts": 25,
      "passingYards": 148,
      "passingTds": 0,
      "rushingYards": 59,
      "fantasyPointsPpr": 11.82
    },
    "...14 more"
  ],
  "count": 16
}

What to do next

  • get_player_leaders (5 credits). Rank every player on one stat for the season, by position or team.
  • get_snap_counts (5 credits). Snap counts and shares by game, to explain the weeks the numbers dropped.

More guides

Start with 500 free credits

No card. REST or MCP.