# MLB Player Season Stats

> MLB Player Season Stats is a paid API for AI agents from mlb-stats-api.fly.dev, paid per call via x402, $0.001000/call, status unknown (last checked 2026-09-14).

Returns season hitting, pitching, and fielding statistics for an MLB player by their player ID.

## Facts

- Endpoint: GET https://mlb-stats-api.fly.dev/mlb/player/:player_id
- Price: $0.001000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mlb-stats-api-fly-dev-2b812f54
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LsB_2qHn2pLuDpS46AN2-

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability mlb-stats-api-fly-dev-2b812f54
```

Example prompt: Can you pull up Shohei Ohtani's season stats — his hitting, pitching, and fielding numbers? His MLB player ID is 660271.

## When to prefer this

Use this endpoint when you need comprehensive season statistics (hitting, pitching, and fielding) for a specific MLB player by their numeric player ID. Ideal for fantasy baseball lookups, player comparisons, or sports reporting tasks where you know the player's MLB ID.

## Known failure modes

- Invalid or unknown player_id returns an error or empty response
- Player exists but has no stats for the current season (e.g. injured, traded, or inactive)
- Network or server error from the fly.dev host
- Payment failure via x402 protocol prevents the request from completing

## How this service works

Season hitting, pitching, and fielding stats for a player. Example: 660271 = Shohei Ohtani.

## Output

Returns the player's season statistics including hitting (e.g. batting average, home runs, RBIs), pitching (e.g. ERA, strikeouts, wins), and fielding stats for the current MLB season.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "pathParams": {
   "player_id": "543037"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "player_id"
     ],
     "properties": {
      "player_id": {
       "type": "string",
       "description": "MLB player ID"
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "data",
  "sport",
  "errors",
  "league",
  "warnings",
  "request_id",
  "retrieved_at"
 ],
 "properties": {
  "data": {
   "type": "object",
   "required": [
    "id",
    "bats",
    "stats",
    "status",
    "throws",
    "team_id",
    "position",
    "full_name",
    "last_name",
    "first_name",
    "jersey_number"
   ],
   "properties": {
    "id": {
     "type": "string"
    },
    "bats": {
     "type": "string"
    },
    "stats": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "type",
       "group",
       "splits",
       "exemptions"
      ],
      "properties": {
       "type": {
        "type": "object",
        "required": [
         "displayName"
        ],
        "properties": {
         "displayName": {
          "type": "string"
         }
        }
       },
       "group": {
        "type": "object",
        "required": [
         "displayName"
        ],
        "properties": {
         "displayName": {
          "type": "string"
         }
        }
       },
       "splits": {
        "type": "array",
        "items": {
         "type": "object",
         "required": [
          "stat",
          "team",
          "sport",
          "league",
          "player",
          "season",
          "gameType",
          "position"
         ],
         "properties": {
          "stat": {
           "type": "object",
           "required": [
            "age",
            "games",
            "errors",
            "assists",
            "chances",
            "innings",
            "putOuts",
            "fielding",
            "position",
            "doublePlays",
            "gamesPlayed",
            "triplePlays",
            "gamesStarted",
            "throwingErrors",
            "rangeFactorPer9Inn",
            "rangeFactorPerGame"
           ],
           "properties": {
            "age": {
             "type": "number"
            },
            "games": {
             "type": "number"
            },
            "errors": {
             "type": "number"
            },
            "assists": {
             "type": "number"
            },
            "chances": {
             "type": "number"
            },
            "innings": {
             "type": "string"
            },
            "putOuts": {
             "type": "number"
            },
            "fielding": {
             "type": "string"
            },
            "position": {
    
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mlb-stats-api-fly-dev-2b812f54/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from mlb-stats-api.fly.dev](https://www.zero.xyz/host/mlb-stats-api.fly.dev/llms.txt)
