MLB API endpoint
Returns one MLB team's statistics. `team_id` and `group` (`hitting`, `pitching`, `fielding`, `catching`, `running`, `game`, `team` or `streak`) are required. `season` defaults to the current year and `stat_type` to `season`. Other `stat_type` values cover splits and logs. Use `start_date` with `end_date` for date ranges.
/mlb/team-statsteam_id and group are required. Group values: hitting, pitching, fielding, catching, running, game, team, streak. season defaults to the current year. stat_type defaults to season and accepts every value below. game_type is optional and accepts: S, R, F, D, L, W, C, P, A, I, E.
Stat type values:
start_date and end_date are paired filters for byDateRange and byDateRangeAdvanced. opponent_team_id is required for vsTeam variants; opponent_player_id is required for vsPlayer variants. Both use positive MLB ids.
stat_type: projected, projectedRos, yearByYear, yearByYearAdvanced, yearByYearPlayoffs, season, standard, advanced, career, careerRegularSeason, careerAdvanced, seasonAdvanced, careerStatSplits, careerPlayoffs, gameLog, playLog, pitchLog, pitchArsenal, outsAboveAverage, expectedStatistics, sabermetrics, sprayChart, tracking, vsPlayer, vsPlayerTotal, vsPlayer5Y, vsTeam, vsTeam5Y, vsTeamTotal, lastXGames, byDateRange, byDateRangeAdvanced, byMonth, byMonthPlayoffs, byDayOfWeek, byDayOfWeekPlayoffs, homeAndAway, homeAndAwayPlayoffs, winLoss, winLossPlayoffs, rankings, rankingsByYear, statsSingleSeason, statsSingleSeasonAdvanced, hotColdZones, availableStats, opponentsFaced, gameTypeStats, firstYearStats, lastYearStats, statSplits, statSplitsAdvanced, atGameStart, vsOpponents, sabermetricsMultiTeam, projected_Zips, projected_ZipsRos, projected_Zips2YR, projected_Zips3YR
| Field | Filled in, of 1 checked | Values in the sample |
|---|---|---|
| season | 1 | 2,026 |
| team | 1 | |
| stats | 1 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| team_id | string | Yes | Numeric MLB team id | 147 | |
| season | integer | No | Four-digit season | ||
| group | string | Yes | Statistics group Allowed values: hitting, pitching, fielding, catching, running, game, team, streak. | hitting | |
| stat_type | string | No | season | Stats API stat type; defaults to season Allowed values: projected, projectedRos, yearByYear, yearByYearAdvanced, yearByYearPlayoffs, season, standard, advanced, career, careerRegularSeason, careerAdvanced, seasonAdvanced, careerStatSplits, careerPlayoffs, gameLog, playLog, pitchLog, pitchArsenal, outsAboveAverage, expectedStatistics, sabermetrics, sprayChart, tracking, vsPlayer, vsPlayerTotal, vsPlayer5Y, vsTeam, vsTeam5Y, vsTeamTotal, lastXGames, byDateRange, byDateRangeAdvanced, byMonth, byMonthPlayoffs, byDayOfWeek, byDayOfWeekPlayoffs, homeAndAway, homeAndAwayPlayoffs, winLoss, winLossPlayoffs, rankings, rankingsByYear, statsSingleSeason, statsSingleSeasonAdvanced, hotColdZones, availableStats, opponentsFaced, gameTypeStats, firstYearStats, lastYearStats, statSplits, statSplitsAdvanced, atGameStart, vsOpponents, sabermetricsMultiTeam, projected_Zips, projected_ZipsRos, projected_Zips2YR, projected_Zips3YR. | |
| game_type | string | No | MLB game type Allowed values: S, R, F, D, L, W, C, P, A, I, E. | ||
| start_date | string | No | Start date for byDateRange stat types; requires end_date | ||
| end_date | string | No | End date for byDateRange stat types; requires start_date | ||
| opponent_team_id | string | No | Required by vsTeam stat types | ||
| opponent_player_id | string | No | Required by vsPlayer stat types | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/team-stats?team_id=147&group=hitting&stat_type=projected&game_type=S" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"season": 2026,
"group": "hitting",
"type": "season",
"total": 10,
"splits": [
{
"rank": 1,
"player": {
"id": 592450,
"name": "Aaron Judge"
},
"stats": {
"homeRuns": 58
}
}
]
}
}Request schema
No body schema
Response schema
#/definitions/mlb.statsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | mlb.StatsResponse | No | ||||
| data.fetched_at | string | No | Time the data was fetched, in UTC (RFC 3339). | |||
| data.group | string | No | Stat group that was returned, for example `hitting` or `pitching`. | |||
| data.limit | integer | No | Maximum number of rows requested. Omitted when no limit applies. | |||
| data.offset | integer | No | Number of rows skipped before this page. Omitted when zero. | |||
| data.player_id | integer | No | MLB player id the stats are for. Omitted for team and league-wide tables. | |||
| data.season | integer | No | Season the stats cover, as a year. | |||
| data.source_url | string | No | URL the data was read from. | |||
| data.splits | array | No | Rows of statistics, one item per player, team or period. StatSplit record, 14 fields: league, player, position, rank, season, stats, team. Described under Get ranked MLB league statistics API. | |||
| data.team_id | integer | No | MLB team id the stats are limited to. Omitted when not limited to a team. | |||
| data.total | integer | No | Total number of rows available. | |||
| data.type | string | No | Stats type label. Always `season`. | |||
| 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/team-stats?team_id=147&group=hitting&stat_type=projected&game_type=S" \
-H "x-api-key: $CRAWLORA_API_KEY"