Skip to content

Guides

How do I get a Premier League player's match stats in Python?

A player's Premier League match log with minutes, goals, shots and xG. Erling Haaland had 5 goals from 3.87 xG in five matches.

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

The call

player_id is the ESPN id and comes from search_players. season is the year it starts. Matches come back newest first. Pass league for a competition other than the Premier League.

import requests
import pandas as pd

API_KEY = "YOUR_API_KEY"

resp = requests.post(
    "https://mcp.strikerapi.com/v1/get_player_games",
    headers={"x-api-key": API_KEY},
    json={
        "player_id": "253989",
        "season": 2026,
        "limit": 10,
    },
    timeout=60,
)
resp.raise_for_status()
data = resp.json()["data"]

log = pd.DataFrame(data["games"]).sort_values("game_date")
cols = ["game_date", "opponent", "minutes", "goals", "assists", "shots", "shots_on_target", "xg"]
print(log[cols].to_string(index=False))
total = log[["minutes", "goals", "assists", "shots", "xg"]].sum()
print(total.to_dict())
print("goals per 90:", round(total["goals"] / total["minutes"] * 90, 2), "xG per 90:", round(total["xg"] / total["minutes"] * 90, 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.

{
  "player_id": "253989",
  "games": [
    {
      "game_id": "401879272",
      "game_date": "2026-09-20",
      "season": 2026,
      "stage": "Regular Season",
      "team_id": "382",
      "team": "MNC",
      "opponent": "SUN",
      "home": true,
      "goals_for": 5,
      "goals_against": 3,
      "starter": true,
      "position": "Forward",
      "minute_on": 0,
      "minute_off": null,
      "minutes": 90,
      "goals": 1,
      "assists": 0,
      "shots": 4,
      "shots_on_target": 1,
      "xg": 1.04,
      "fouls_committed": 3,
      "fouls_suffered": 1,
      "offsides": 0,
      "yellow_cards": 0,
      "red_cards": 0,
      "own_goals": 0,
      "saves": null,
      "goals_conceded": 3,
      "shots_faced": 0
    },
    {
      "game_id": "401879278",
      "game_date": "2026-09-13",
      "season": 2026,
      "stage": "Regular Season",
      "team_id": "382",
      "team": "MNC",
      "opponent": "MAN",
      "home": false,
      "goals_for": 1,
      "goals_against": 0,
      "starter": true,
      "position": "Forward",
      "minute_on": 0,
      "minute_off": null,
      "minutes": 90,
      "goals": 1,
      "assists": 0,
      "shots": 2,
      "shots_on_target": 1,
      "xg": 0.58,
      "fouls_committed": 0,
      "fouls_suffered": 2,
      "offsides": 0,
      "yellow_cards": 0,
      "red_cards": 0,
      "own_goals": 0,
      "saves": null,
      "goals_conceded": 0,
      "shots_faced": 0
    },
    "...3 more"
  ],
  "count": 5,
  "next_offset": null
}

What to do next

  • get_leaders (5 credits). Rank every player on goals, assists or xG, per 90 or in total.
  • search_players (1 credit). Find a player_id by name.

More guides

Start with 500 free credits every month

No card. REST or MCP.