ESPN API: Get player stats
Looks up an ESPN player by name and returns season and career statistics. Use a league to tell apart players with the same name, and a season year or label to pick a past season.
Unofficial. Not affiliated with or endorsed by ESPN.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- League optional
league League to distinguish players with the same name, for example NFL.
(default)
- Player, required
player Player name, for example Patrick Mahomes.
Patrick Mahomes
- Season optional
season Season year or season label, for example 2024 or 2024-25. Defaults to the latest available season.
(default)
Input as JSON
{ "player": "Patrick Mahomes"}Output
{ "age": 31, "team": "Kansas City Chiefs", "stats": [ { "stat_name": "Games Played", "career_value": 131, "season_value": 5, "stat_abbreviation": "GP" }, { "stat_name": "Completions", "career_value": 3198, "season_value": 105, "stat_abbreviation": "CMP" }, { "stat_name": "Passing Attempts", "career_value": 4831, "season_value": 158, "stat_abbreviation": "ATT" } ], "height": "6' 2\"", "league": "NFL", "season": "2026", "weight": "225 lbs", "position": "Quarterback", "player_id": "3139477", "player_name": "Patrick Mahomes", "jersey_number": "15", "espn_player_link": "https://www.espn.com/nfl/player/_/id/3139477/patrick-mahomes" , "headshot_image_link": "https://a.espncdn.com/i/headshots/nfl/players/full/3139477.png" }Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"espn.com/get_player_stats","input":{"player":"Patrick Mahomes"}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "espn.com/get_player_stats" , "input": { "player": "Patrick Mahomes" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "espn.com/get_player_stats" , "input": { "player": "Patrick Mahomes" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run espn.com/get_player_stats# with {"player":"Patrick Mahomes"}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "player" ], "properties": { "league": { "type": "string", "default": "", "description": "League to distinguish players with the same name, for example NFL." }, "player": { "type": "string", "description": "Player name, for example Patrick Mahomes." }, "season": { "type": "string", "default": "", "description": "Season year or season label, for example 2024 or 2024-25. Defaults to the latest available season." } }}Output schema
{ "type": "object", "required": [ "player_name", "team", "league", "position", "jersey_number", "age", "height", "weight", "headshot_image_link", "espn_player_link", "season", "stats", "player_id" ], "properties": { "age": { "type": [ "integer", "null" ] }, "team": { "type": [ "string", "null" ] }, "stats": { "type": "array", "items": { "type": "object", "required": [ "stat_name", "season_value", "career_value", "stat_abbreviation" ], "properties": { "stat_name": { "type": "string" }, "career_value": { "type": "number" }, "season_value": { "type": "number" }, "stat_abbreviation": { "type": [ "string", "null" ], "x-fous-developer": true } }, "additionalProperties": false } }, "height": { "type": [ "string", "null" ] }, "league": { "type": "string" }, "season": { "type": "string" }, "weight": { "type": [ "string", "null" ] }, "position": { "type": [ "string", "null" ] }, "player_id": { "type": "string", "x-fous-developer": true }, "player_name": { "type": "string" }, "jersey_number": { "type": [ "string", "null" ] }, "espn_player_link": { "type": "string" }, "headshot_image_link": { "type": [ "string", "null" ] } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
espn.com/get_player_stats- Returns
- player profile, season and career stats
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method espn.com/get_player_stats with the inputs above.
Ask your agent
- Can you pull up Patrick Mahomes' stats from the 2023 NFL season on ESPN?
- I need LeBron James' career averages and this season's numbers, plus his profile info.
- Look up Stephen Curry's 2024-25 NBA stats and tell me his career totals.
- What were Justin Jefferson's receiving stats in 2022 in the NFL? Include career numbers too.
- Find the MLB player Shohei Ohtani on espn.com and show his latest season and career stats.
See more
All ESPN methodsFinds the latest game between two teams, or their game on a given date, in major US leagues, MLS or the EPL. Returns the score, scoring by period, leading players, team stats and player box scores.
espn.com/get_game_summaryReturns a team's past results and upcoming games for a season on ESPN, with opponents, local start times, scores, broadcasts and venues. Soccer fixtures include all competitions shown for the team.
espn.com/get_team_scheduleGets ESPN scores and the schedule for a league on a local day. You can filter by team, and start times are shown in your time zone.
espn.com/get_scoresFinds an ESPN league or team by name and lists the latest headlines ESPN publishes for it, newest first.
espn.com/list_newsLooks up a Yahoo Sports player by name and returns the player's regular-season statistics for a season, alongside career totals. Each stat includes season and career values.
sports.yahoo.com/get_player_statsGets a named NFL player's season and career stats, with profile details. Active players are preferred when names match.
nfl.com/get_player_statsGets an MLB player's profile and regular-season hitting and pitching statistics for one season and for his career. Without a season it uses the current season, or the player's latest MLB season if he has no stats this year.
mlb.com/get_player_statsLooks up an NHL player by name, link or ID and returns the profile with regular-season stats for a season and career totals.
nhl.com/get_player_stats