The statistical leaders of a league for a season: for every category (passing yards, rushing yards, sacks, points, rebounds, assists, home runs, goals ...) the ranked players with value, player details and team. Pick the season, the season type and how many leaders per category; category returns one category.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
leaguerequired
string
League slug: nfl, college-football, nba, wnba, mens-college-basketball, womens-college-basketball, mlb, nhl, soccer competitions (eng.1 Premier League, esp.1 LaLiga, uefa.champions ...), f1, pga, atp, ufc. Other ESPN leagues work with sport. Example: nfl
Only needed for a league not listed under league (it is inferred for those).
season
string
Season year (2023 = the 2023 NFL season; NBA, NHL and other leagues that start in autumn use the year the season ends). Default: the current season. Example: 2023
seasontype
1 | 2 | 3 | 4
1 preseason, 2 regular season, 3 postseason, 4 off season. Default: the current part of the season. Example: 2
limit
integer
Leaders per category, 1-25 (default 10). Example: 10
category
string
One category name from the categories list of the response, for example passingYards, points, rebounds. Example: passingYards
import os, requests
res = requests.get(
"https://api.api.sh/espn/v1/leaders",
params={"league": "nfl"},
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/espn/v1/leaders");
url.searchParams.set("league", "nfl");
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).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.