SofaScore player statistics leaderboard
Player statistics of a tournament season, sorted and filtered like the site's stats table: rating, goals, assists, expected goals, tackles, passes ... per player with team. Page with offset (pass next_offset back; null on the last page).
Every response includes credits_used: the credits this call cost.
Part of the SofaScore API: 28 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
tournament_idrequired | string | SofaScore unique-tournament id or a tournament link (sofascore.com/football/tournament/england/premier-league/17). 17 = Premier League. Example: 17 |
season_id | string | Season id from /sofascore/v1/tournament (default: the current season). |
order | string | Sort stat, - for descending (default -rating): -goals, -assists, -expectedGoals, -accuratePasses, -tackles ... Example: -goals |
group | summary | attack | defence | passing | goalkeeper | Stat group (default summary). |
accumulation | string | total (default), perGame or per90. |
limit | integer | Rows per page, 1-100 (default 20). |
offset | integer | Rows to skip (default 0). |
filters | string | Site filter expression, e.g. position.in.F~M, appearances.GT.5, team.in.42. |
fields | string | Comma-separated stat names to return. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/sofascore/v1/tournament/player-stats?tournament_id=17" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/sofascore/v1/tournament/player-stats",
params={"tournament_id": "17"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/sofascore/v1/tournament/player-stats");
url.searchParams.set("tournament_id", "17");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); 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).
Example response (real call, trimmed: lists cut to 2 items, long text shortened, raw left out)
{"tournament_id": 17,"season_id": 96668,"applied_filters": {"order": "-rating","group": "summary","accumulation": "total","limit": 20,"offset": 0,"filters": null,"fields": null},"count": 20,"total_pages": 23,"page": 1,"next_offset": 20,"results": [{"player": {"id": 934386,"name": "Jérémy Doku","slug": "jeremy-doku"},"team": {"id": 17,"name": "Manchester City"},"statistics": {"goals": 1,"expectedGoals": 0.7,"successfulDribbles": 24,"tackles": 4,"assists": 1,"accuratePassesPercentage": 83.21,"rating": 7.92}},{"player": {"id": 962012,"name": "Jan Paul van Hecke","slug": "jan-paul-van-hecke"},"team": {"id": 33,"name": "Tottenham Hotspur"},"statistics": {"goals": 2,"expectedGoals": 1.64,"successfulDribbles": 0,"tackles": 16,"assists": 0,"accuratePassesPercentage": 91.35,"rating": 7.83}},"… 18 more"],"cached": false,"credits_used": 1}