MLB API endpoint
Returns ranked MLB leader entries for one or more validated categories. Use mlb-discovery for all accepted categories, groups, and game type codes.
/mlb/league-leaderscategories is a required comma-separated list. Every accepted category is listed below and is also available from /mlb/discovery. Optional season defaults to the current year; group filters by stat group; game_type filters by MLB game type; league_id filters to the American or National League; limit defaults to 10 and accepts 1 through 100. Group values: hitting, pitching, fielding, catching, running, game, team, streak. Game type values: S, R, F, D, L, W, C, P, A, I, E. League ids: 103, 104.
Leader category values:
Categories: assists, shutouts, homeRuns, sacrificeBunts, sacrificeFlies, runs, groundoutToFlyoutRatio, stolenBases, battingAverage, groundOuts, numberOfPitches, onBasePercentage, caughtStealing, groundIntoDoublePlays, totalBases, earnedRunAverage, fieldingPercentage, walksAndHitsPerInningPitched, flyouts, hitByPitches, gamesPlayed, walks, sluggingPercentage, onBasePlusSlugging, runsBattedIn, triples, extraBaseHits, hits, atBats, strikeouts, doubles, totalPlateAppearances, intentionalWalks, wins, losses, saves, wildPitch, airOuts, balk, blownSaves, catcherEarnedRunAverage, catchersInterference, chances, completeGames, doublePlays, earnedRun, errors, gamesFinished, gamesStarted, hitBatsman, hitsPer9Inn, holds, innings, inningsPitched, outfieldAssists, passedBalls, pickoffs, pitchesPerInning, putOuts, rangeFactorPerGame, rangeFactorPer9Inn, saveOpportunities, stolenBasePercentage, strikeoutsPer9Inn, strikeoutWalkRatio, throwingErrors, totalBattersFaced, triplePlays, walksPer9Inn, winPercentage
| Field | Filled in, of 1 checked | Values in the sample |
|---|---|---|
| category | 1 | “homeRuns” |
| group | 1 | “hitting” |
| season | 1 | 2,026 |
| game_type | 1 | “R” |
| total | 1 | 286 |
| leaders | 1 | median 40 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| categories | string | Yes | Comma-separated MLB leader category names; values are listed in mlb-discovery | homeRuns | |
| season | integer | No | current year | Four-digit season; defaults to current year | 2026 |
| group | string | No | Stat group Allowed values: hitting, pitching, fielding, catching, running, game, team, streak. | ||
| game_type | string | No | MLB game type Allowed values: S, R, F, D, L, W, C, P, A, I, E. | ||
| league_id | string | No | MLB league id Allowed values: 103, 104. | ||
| limit | integer | No | Leaders per category (1-100) Minimum: 1. Maximum: 100. | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/league-leaders?categories=homeRuns&group=hitting&game_type=S&league_id=103&limit=10" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"season": 2026,
"categories": [
"homeRuns"
],
"count": 1,
"results": [
{
"category": "homeRuns",
"group": "hitting",
"total": 538,
"leaders": [
{
"rank": 1,
"value": "58",
"player": {
"id": 592450,
"name": "Aaron Judge"
}
}
]
}
]
}
}Request schema
No body schema
Response schema
#/definitions/mlb.leagueLeadersResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | mlb.LeagueLeadersResponse | No | ||||
| data.categories | array | No | ||||
| data.count | integer | No | ||||
| data.fetched_at | string | No | ||||
| data.results | array | No | ||||
| data.results[].category | string | No | ||||
| data.results[].game_type | string | No | ||||
| data.results[].group | string | No | ||||
| data.results[].leaders | array | No | ||||
| data.results[].leaders[].league | mlb.NamedRef | No | ||||
| data.results[].leaders[].league.id | integer | No | MLB id of the player or league. | |||
| data.results[].leaders[].league.name | string | No | Name of the player or league. | |||
| data.results[].leaders[].player | mlb.NamedRef | No | ||||
| data.results[].leaders[].player.id | integer | No | MLB id of the player or league. | |||
| data.results[].leaders[].player.name | string | No | Name of the player or league. | |||
| data.results[].leaders[].rank | integer | No | ||||
| data.results[].leaders[].season | string | No | ||||
| data.results[].leaders[].stats | object | No | ||||
| data.results[].leaders[].team | mlb.TeamRef | No | ||||
| data.results[].leaders[].team.abbreviation | string | No | Short team abbreviation, for example `NYY`. Omitted when not available. | |||
| data.results[].leaders[].team.id | integer | No | MLB team id. | |||
| data.results[].leaders[].team.name | string | No | Full team name. | |||
| data.results[].leaders[].value | string | No | ||||
| data.results[].season | string | No | ||||
| data.results[].total | integer | No | ||||
| data.season | integer | No | ||||
| data.source_url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/mlb/league-leaders?categories=homeRuns&group=hitting&game_type=S&league_id=103&limit=10" \
-H "x-api-key: $CRAWLORA_API_KEY"