xG stats of every player in a league season

GET https://api.api.sh/understat/v1/league-players
1 credit / call sports try it in the playground →

Every player of a league season: team, positions, games, minutes, goals, non-penalty goals, assists, shots, key passes, xG, npxG, xA, xGChain, xGBuildup and cards. Filter by team or position, sort by any stat. Pass next_page back as page; null on the last page.

Every response includes credits_used: the credits this call cost.

Parameters

nametypedescription
leaguerequired EPL | La_liga | Bundesliga | Serie_A | Ligue_1 | RFPL League. Example: EPL
season integer Season by its starting year. Default: current. Example: 2024
team string Only players of teams whose name contains this text.
position G | D | M | F | S G goalkeeper, D defender, M midfielder, F forward, S substitute appearances.
sort xg | npxg | xa | goals | assists | shots | key_passes | minutes | games | xg_chain | xg_buildup Sort, highest first. Default: xg
limit integer Players per page (1-1000, default 100).
page integer Page number.

Every endpoint also takes fresh, raw, fields (see lean responses and caching).

Example

curl "https://api.api.sh/understat/v1/league-players?league=EPL" \
  -H "x-api-key: $APISH_KEY"

Response

A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).

The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.