Skip to content

Season Stats & Analytics

Team season leaderboard

Baseball (mlb, kbo, npb) and NBA. Returns every club's season line for one role, ranked by one measure, in the same shape as the TypeScript analytics SDK's teamSeasonLeaderboard (camelCase keys; rows[] of rank / teamId / abbreviation / name / sampleSize / values).

role=batter (default) reads the all scope of team_batting_stats and appends the team fielding fold: stolen_bases, caught_stealing, errors (line-score errors, null unless every final game has them), putouts / assists / fielding_pct (from per-game team fielding, null unless every final game carries all three), fielding_games, and for MLB Savant's oaa and fielding_runs_prevented_sum (null elsewhere). role=pitcher reads team_pitching_stats; NPB publishes no pitching aggregate and answers an empty board with note. NBA uses role=team over team_season_stats.

metrics lists every measure key the board can carry for the role; a key a league's producer does not publish is null on every row (KBO publishes walks_plus_hbp, not walks). Nulls sort last.

Requires the stats entitlement (a paid plan). See Responses & Errors for the success envelope and availability rules.

GEThttps://api.sportquanta.com/v1/{league}/teams/season-leaderboard
GETRank every team's season line (baseball batting/pitching, NBA)
GET/v1/{league}/teams/season-leaderboard

Rank every team's season line (baseball batting/pitching, NBA)

Baseball (mlb, kbo, npb) and NBA. Returns every club's season line for one role, ranked by one measure, in the same shape as the TypeScript analytics SDK's teamSeasonLeaderboard (camelCase keys; rows[] of rank / teamId / abbreviation / name / sampleSize / values).

role=batter (default) reads the all scope of team_batting_stats and appends the team fielding fold: stolen_bases, caught_stealing, errors (line-score errors, null unless every final game has them), putouts / assists / fielding_pct (from per-game team fielding, null unless every final game carries all three), fielding_games, and for MLB Savant's oaa and fielding_runs_prevented_sum (null elsewhere). role=pitcher reads team_pitching_stats; NPB publishes no pitching aggregate and answers an empty board with note. NBA uses role=team over team_season_stats.

metrics lists every measure key the board can carry for the role; a key a league's producer does not publish is null on every row (KBO publishes walks_plus_hbp, not walks). Nulls sort last.

Requires the stats entitlement (a paid plan). See Responses & Errors for the success envelope and availability rules.

Authorization
Path
Query
Rank every team's season line (baseball batting/pitching, NBA)cURL
200Example

Reference context: NBA.

Overview · Response conventions

Authorizations

Authorizationstringheaderrequired

Send a workspace API token in the Authorization: Bearer <token> header.

Path Parameters

leagueenum<string>default:nbarequired

League for this reference section: nba.

Available options: nba

Query Parameters

seasonintegerrequired

Season year (baseball) or season start year (NBA).

Required range: 1876 <= x, x <= 2100

roleenum<string>

Defaults to batter for baseball; NBA accepts only team.

Available options: batter, pitcher, team

order_bystring

One of the role's metrics keys. Defaults to ops (batter), era (pitcher), net_rating (team).

directionenum<string>

Defaults to the measure's conventional direction (asc for ERA, otherwise desc).

Available options: asc, desc

limitintegerdefault:30

Required range: 1 <= x, x <= 50

provenancebooleandefault:false

Opt in to per-field provenance on supported single game, match, team, player, and venue reads. Lists and composites accept the flag but generally omit provenance. It is returned under _meta.provenance only when source metadata exists.

Response

application/json

Ranked team season board.

dataobjectrequired

Ranked team season board in the TypeScript analytics SDK's teamSeasonLeaderboard shape.

data.leaguestringrequired
data.roleenum<string>required

Available options: batter, pitcher, team

data.seasonintegerrequired
data.metricsstring[]required

Every measure key the board carries for this role, in board order.

data.orderByobjectrequired
data.orderBy.measurestringrequired
data.orderBy.directionenum<string>required

Available options: asc, desc

data.rowsobject[]required
data.rows.rankintegerrequired
data.rows.teamIdstringrequired
data.rows.abbreviationstring | nullrequired
data.rows.namestring | nullrequired
data.rows.sampleSizenumber | nullrequired

At-bats (batter), innings (pitcher) or games (team) behind the line.

data.rows.valuesobjectrequired

Season values keyed by the response's metrics entries for the selected role. Keys and units depend on the sport and batter, pitcher or team role; for example ops is a batting ratio. A null value means the producer does not publish that metric, rather than zero.

data.rows.values.{key}number | null
data.notestring

Explains an empty or partial board (for example a league with no pitching aggregate).

_metaobject

Response request/cache metadata. Optional evidence fields are specific to this handler; cache TTL does not measure source-data freshness.

_meta.request_idstring
_meta.served_fromenum<string>

Available options: live, cache

_meta.cache_ttl_secondsinteger

Response cache TTL; independent of source freshness. Omitted when zero.