Skip to content
datasportsAPI

LeaguesPlayer statistics explorer

Documentation

/

Type to filter the docs by title or path.

LeaguesEndpoint 79 of 116

Player statistics explorer

GET

/v2/leagues/{id}/player-statistics

Plan
Pro + Business
Auth
Bearer dsa_live_…
Parameters
2 required · 6 optional
Returns
PlayerStatisticsRow[]

A sortable player-statistics table for a football season: every player in the league, 20 per page, ordered by any statistic and returned with one column set — summary, attack, defense, passing, goalkeeping or other — with optional position and team filters.

Only football leagues are covered, because our data source offers no equivalent for other sports (checked against the NBA, NHL and EuroLeague on 2026-10-28); those leagues return 404 not_supported, and /v2/leagues/{id}/top-players serves their season leaders instead.

Plan access

Requires a Pro or Business plan; every other plan receives 403 endpoint_not_in_plan.

Worth knowing

Statistic keys follow the season-statistics naming of /v2/players/{id}/statistics. Every row always includes appearances and minutesPlayed, plus the sort key when the chosen group does not contain it. Page through until hasNextPage turns false; there are never more than 50 pages (1,000 players). For just the leaders in one statistic, /top-players is cheaper.

01Parameters

  • idpathRequired

    league id issued by DataSportsAPI, a positive integer

  • seasonqueryRequired

    season id, as listed by /v2/leagues/{id}/seasons

  • groupqueryOptional

    summary (default) \| attack \| defense \| passing \| goalkeeping \| other — selects the set of statistics returned on each row

  • orderqueryOptional

    season-statistic key used for sorting; defaults to averageRating, and an invalid key returns a 400 listing the accepted ones

  • directionqueryOptional

    desc (default) \| asc

  • pagequeryOptional

    zero-based page number, an integer from 0 to 49 (0 if omitted)

  • positionqueryOptional

    one or more of goalkeeper, defender, midfielder, forward, separated by commas

  • teamqueryOptional

    team id; restricts the rows to that team’s players

02Request

The same call from the command line and each SDK. The SDK lines assume a client created with your key; left out, it is read from DATASPORTSAPI_API_KEY. Installing a client: SDKs & CLI.

curl -H "Authorization: Bearer dsa_live_…" \
    "https://api.datasportsapi.com/v2/leagues/{id}/player-statistics?season=…"

03Response

The top-level keys of the JSON body. Each object links to its full shape in the data reference.

data
PlayerStatisticsRow[]
meta
season, group, order, direction, page, position (null, or the requested positions sorted), team, count, pageCount, hasNextPage
Example response
{ "data": [ { "player": { "id": 1, "name": "Jack Hinshelwood", "slug": "jack-hinshelwood", "shortName": null, "image": "…" },
    "team": { "id": 2, "name": "Brighton & Hove Albion", "slug": "brighton-and-hove-albion", "shortName": "Brighton", "code": "BHA", "image": "…" },
    "statistics": { "goals": 3, "expectedGoals": 2.33, "successfulDribbles": 1, "tackles": 2, "assists": 0,
                    "accuratePassesPercentage": 85, "averageRating": 8.05, "appearances": 9, "minutesPlayed": 750 } }, … ],
  "meta": { "season": 200386, "group": "summary", "order": "averageRating", "direction": "desc", "page": 0, "position": null, "team": null,
            "count": 20, "pageCount": 23, "hasNextPage": true } }

04Errors

  • 400bad_request

    season is absent; group, order, direction or position is unrecognised; page is not 0–49; or team is not an id. The message lists every offending parameter with its accepted values, e.g. “invalid order (one of …)”, so all of them can be fixed in one go

  • 403history_not_in_plan

    your plan’s history window begins after this season ended

  • 404not_supported

    only football leagues are supported

  • 404no_data

    our data source holds no player statistics for this league and season (or for the requested team)

  • 404not_found

    the season id does not belong to this league; the error message names the offending parameter, and /v2/leagues/{id}/seasons lists the valid ones

Any key can also meet401unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code