Leagues
Top teams
GET/v2/leagues/{id}/top-teamsAll plans
Season team leaderboards: the top teams per statistic (average rating, goals scored, clean sheets, possession, …), paged like top-players.
Paged like /top-players (limit teams per leaderboard, default 10). Categories vary by sport and are named with the statistic keys (same as the team statistics); statistic is the key in each entry’s statistics the board ranks. matches is null where the source reports 0 beside non-zero counts. A league, season or type without leaderboards returns an empty array.
Parameters
id
our numeric id (positive integer)
season
a season id from /v2/leagues/{id}/seasons
type
overall | home | away | regularSeason | playoffs. Default: the season’s own — overall where it has one (football), else regularSeason (NBA, NHL, …); meta.type says which was used
category
one leaderboard only (a category of this season, e.g. goals); unknown → 400 listing the season’s categories
limit
entries per leaderboard, 1–50 (default 10)
page
page of limit entries, 0–49 (default 0 = the leaders)
Response
- data
TopTeamsCategory[]- meta
- season, type (the one used), category (null = all), limit, page, count (categories), hasNextPage
- errors
- 400 bad_request — missing or invalid season, type not one of overall, home, away, regularSeason, playoffs, limit outside 1–50, page outside 0–49, or an unknown category404 not_found — season is not one of this league’s seasons (the message names the parameter; list them with /v2/leagues/{id}/seasons)
Every /v2 call can also answer the common errors.
$ curl -H "Authorization: Bearer sk_live_…" \ "https://api.sportsapi.app/v2/leagues/{id}/top-teams?season=…"
Example
{ "data": [ { "category": "averageRating", "statistic": "averageRating", "teams": [ { "team": { "id": 4438, "name": "Manchester City", "code": "MCI", "image": "…", … }, "value": 7.02, "matches": 7, "statistics": { "averageRating": 7.02, "matches": 7 } }, … ] }, { "category": "goalsScored", "statistic": "goalsScored", "teams": [ … ] }, … ], "meta": { "season": 200386, "type": "overall", "category": null, "limit": 10, "page": 0, "count": 12, "hasNextPage": true } }