MLB

Get ranked MLB league statistics

Returns ranked MLB stat splits across both leagues. group is required (hitting, pitching, fielding, catching, running, game, team or streak). season defaults to the current year and stat_type to season. Narrow with league_id, team_id, position, player_pool, and page with limit (1 to 100) and offset (0 to 10000).

get/mlb/league-stats

Request

  • Base URL: https://api.crawlora.net/api/v1
  • URL: https://api.crawlora.net/api/v1/mlb/league-stats
  • Auth: API key in header x-api-key

Query parameters

seasoninteger

Four-digit season; defaults to current year

group'hitting' | 'pitching' | 'fielding' | 'catching' | 'running' | 'game' | 'team' | 'streak' required

Stat group

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'

Stats API stat type; defaults to season

game_type'S' | 'R' | 'F' | 'D' | 'L' | 'W' | 'C' | 'P' | 'A' | 'I' | 'E'

MLB game type

start_datestring

Start date for byDateRange stat types; requires end_date

end_datestring

End date for byDateRange stat types; requires start_date

opponent_team_idstring

Required by vsTeam stat types

opponent_player_idstring

Required by vsPlayer stat types

league_id'103' | '104'

MLB league id

team_idstring

Optional MLB team id; discover current team ids with mlb_teams

position'C' | '1B' | '2B' | '3B' | 'SS' | 'LF' | 'CF' | 'RF' | 'DH' | 'OF' | 'IF'

Hitter position; use only with group=hitting

player_pool'QUALIFIED' | 'ALL'

Qualified-player pool

limitinteger

Results to return (1-100)

offsetinteger

Zero-based result offset (0-10000)

Headers

x-api-keystring required

API key required

Response

OK

codeinteger
msgstring

Example response

{
  "code": 200,
  "msg": "OK"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.