# MLB API: Get player stats

> Gets an MLB player's profile and regular-season hitting and pitching statistics for one season and for his career. Without a season it uses the current season, or the player's latest MLB season if he has no stats this year.

Unofficial. Not affiliated with or endorsed by MLB.

- Page: https://fous.com/methods/mlb.com/get-player-stats
- Method: `mlb.com/get_player_stats`, version 1
- Website: mlb.com
- Returns: name, team, position, bats, throws, age, season and career hitting/pitching stats
- Effect: read (it gets data and changes nothing)
- Sign-in: none needed
- Cost: 1 credit per completed run (1¢ with pay as you go); failed runs are free
- Verified: Nov 2, 2026

## Inputs

| Field | Type | Required | In the run below | Description |
|---|---|---|---|---|
| `player` | string | yes | `"Shohei Ohtani"` | Baseball player name, for example Shohei Ohtani. |
| `season` | integer | no | `2025` | MLB season year, for example 2025. Defaults to the current season if the player has stats, otherwise the latest season. |

## Output

From a run on Oct 27, 2026. Its input:

```json
{
  "player": "Shohei Ohtani",
  "season": 2025
}
```

Its output:

```json
{
  "age": 32,
  "bats": "Left",
  "name": "Shohei Ohtani",
  "team": "Los Angeles Dodgers",
  "season": 2025,
  "throws": "Right",
  "position": "Two-Way Player",
  "player_id": 660271,
  "player_link": "https://www.mlb.com/player/shohei-ohtani-660271",
  "career_hitting": {
    "hits": 1194,
    "games": 1172,
    "at_bats": 4253,
    "home_runs": 310,
    "stolen_bases": 176,
    "runs_batted_in": 750,
    "batting_average": 0.281,
    "on_base_percentage": 0.375,
    "slugging_percentage": 0.574,
    "on_base_plus_slugging": 0.949
  },
  "season_hitting": {
    "hits": 172,
    "games": 158,
    "at_bats": 611,
    "home_runs": 55,
    "stolen_bases": 20,
    "runs_batted_in": 102,
    "batting_average": 0.282,
    "on_base_percentage": 0.392,
    "slugging_percentage": 0.622,
    "on_base_plus_slugging": 1.014
  },
  "career_pitching": {
    "wins": 47,
    "saves": 0,
    "walks": 208,
    "losses": 22,
    "strikeouts": 765,
    "innings_pitched": "614.1",
    "earned_run_average": 2.83,
    "walks_plus_hits_per_inning_pitched": 1.06
  },
  "season_pitching": {
    "wins": 1,
    "saves": 0,
    "walks": 9,
    "losses": 1,
    "strikeouts": 62,
    "innings_pitched": "47.0",
    "earned_run_average": 2.87,
    "walks_plus_hits_per_inning_pitched": 1.04
  },
  "headshot_image_link": "https://img.mlbstatic.com/mlb-photos/image/upload/v1/people/660271/headshot/67/current"
}
```

## Run it

From code, with a Fous API key in `FOUS_API_KEY`; the answer's `data` holds the output:

```bash
curl https://api.fous.com/v1/runs \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"method":"mlb.com/get_player_stats","input":{"player":"Shohei Ohtani","season":2025}}'
```

From an AI agent connected to the Fous MCP server: its `run` with the same method and input. To connect one, give it `set up https://fous.com/SKILL.md`.

## Ask your agent

- What are Aaron Judge's batting numbers for the 2024 season?
- Show me Clayton Kershaw's career pitching stats and his ERA by year.
- Get Mookie Betts' position, bats, throws, and age along with his hitting stats this season.
- I want to compare Freddie Freeman's 2023 home runs and OPS against his career totals on mlb.com.
- Pull up Gerrit Cole's strikeouts and win-loss record for the 2019 season.

## Input schema

```json
{
  "type": "object",
  "required": [
    "player"
  ],
  "properties": {
    "player": {
      "type": "string",
      "minLength": 1,
      "description": "Baseball player name, for example Shohei Ohtani."
    },
    "season": {
      "type": "integer",
      "maximum": 2100,
      "minimum": 1871,
      "description": "MLB season year, for example 2025. Defaults to the current season if the player has stats, otherwise the latest season."
    }
  }
}
```

## Output schema

```json
{
  "type": "object",
  "required": [
    "name",
    "season",
    "player_id",
    "player_link",
    "headshot_image_link"
  ],
  "properties": {
    "age": {
      "type": [
        "integer",
        "null"
      ]
    },
    "bats": {
      "type": [
        "string",
        "null"
      ]
    },
    "name": {
      "type": "string"
    },
    "team": {
      "type": [
        "string",
        "null"
      ]
    },
    "season": {
      "type": "integer"
    },
    "throws": {
      "type": [
        "string",
        "null"
      ]
    },
    "position": {
      "type": [
        "string",
        "null"
      ]
    },
    "player_id": {
      "type": "integer"
    },
    "player_link": {
      "type": "string"
    },
    "career_hitting": {
      "type": [
        "object",
        "null"
      ]
    },
    "season_hitting": {
      "type": [
        "object",
        "null"
      ]
    },
    "career_pitching": {
      "type": [
        "object",
        "null"
      ]
    },
    "season_pitching": {
      "type": [
        "object",
        "null"
      ]
    },
    "headshot_image_link": {
      "type": "string"
    }
  }
}
```

## See more

- [MLB API: Get standings](https://fous.com/methods/mlb.com/get-standings.md): Returns MLB regular-season division standings for a season: records, win percentage, games back, streak, last 10 games and wild-card games back. Defaults to the current year.
- [MLB API: Get scores and schedule](https://fous.com/methods/mlb.com/get-scores.md): Lists MLB games and scores for a date or up to seven days, optionally for one team. Start times are shown in the requested time zone.
- [Yahoo API: Get player stats](https://fous.com/methods/sports.yahoo.com/get-player-stats.md): Looks up a Yahoo Sports player by name and returns the player's regular-season statistics for a season, alongside career totals. Each stat includes season and career values.
- [NHL API: Get player stats](https://fous.com/methods/nhl.com/get-player-stats.md): Looks up an NHL player by name, link or ID and returns the profile with regular-season stats for a season and career totals.
- [NFL API: Get player stats](https://fous.com/methods/nfl.com/get-player-stats.md): Gets a named NFL player's season and career stats, with profile details. Active players are preferred when names match.
- [ESPN API: Get player stats](https://fous.com/methods/espn.com/get-player-stats.md): Looks up an ESPN player by name and returns season and career statistics. Use a league to tell apart players with the same name, and a season year or label to pick a past season.
- [Premier League API: Get player stats](https://fous.com/methods/premierleague.com/get-player-stats.md): Looks up a Premier League player by name and returns the profile and either career totals or the stats for a chosen season. If names clash, a current Premier League player is preferred.
- [NBA API: Get player by name](https://fous.com/methods/nba.com/get-player.md): Looks up an NBA player by name, including retired players, and returns the bio and regular-season per-game averages for the reported season and career.
- [All MLB methods](https://fous.com/methods/mlb.com.md)
