---
title: "Get MLB player season statistics"
method: GET
path: "/mlb/player-stats"
tags: ["MLB"]
---

# Get MLB player season statistics

`GET /mlb/player-stats`

## Request

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

Returns one MLB player's statistics. `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 career, game logs and splits. Use `start_date` with `end_date` for date ranges.

## Query parameters

- `id` string, required
- `season` integer
- `group` 'hitting' | 'pitching' | 'fielding' | 'catching' | 'running' | 'game' | 'team' | 'streak', required
- `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'
- `game_type` 'S' | 'R' | 'F' | 'D' | 'L' | 'W' | 'C' | 'P' | 'A' | 'I' | 'E'
- `start_date` string
- `end_date` string
- `opponent_team_id` string
- `opponent_player_id` string

## Headers

- `x-api-key` string, required

## Response `200`

OK

- MlbStatsResponseDoc
  - `code` integer
  - `data` MlbStatsResponse
    - `fetched_at` string: Time the data was fetched, in UTC (RFC 3339).
    - `group` string: Stat group that was returned, for example `hitting` or `pitching`.
    - `limit` integer: Maximum number of rows requested. Omitted when no limit applies.
    - `offset` integer: Number of rows skipped before this page. Omitted when zero.
    - `player_id` integer: MLB player id the stats are for. Omitted for team and league-wide tables.
    - `season` integer: Season the stats cover, as a year.
    - `source_url` string: URL the data was read from.
    - `splits` MlbStatSplit[]: Rows of statistics, one item per player, team or period.
      - `league` MlbNamedRef
        - `id` integer: MLB id of the player or league.
        - `name` string: Name of the player or league.
      - `player` MlbNamedRef
        - `id` integer: MLB id of the player or league.
        - `name` string: Name of the player or league.
      - `position` string: Position name as MLB lists it. Omitted when MLB gives none.
      - `rank` integer: Position of the row in the ranking. Omitted when the table is not ranked.
      - `season` string: Season the row covers, as a year. Omitted for rows that are not tied to one season.
      - `stats` object: Statistics for the row, as named values such as `homeRuns`. The set of stats depends on `group` and `type`.
      - `team` MlbTeamRef
        - `abbreviation` string: Short team abbreviation, for example `NYY`. Omitted when not available.
        - `id` integer: MLB team id.
        - `name` string: Full team name.
    - `team_id` integer: MLB team id the stats are limited to. Omitted when not limited to a team.
    - `total` integer: Total number of rows available.
    - `type` string: Stats type label. Always `season`.
  - `msg` string

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `429`: Too Many Requests
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crawlora/apis/crawlora-api.md) · [All operations](https://skmtc.dev/crawlora/apis/crawlora-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crawlora/apis/crawlora-api/revisions/afac9b012a27?raw)
