# Fanfare MLB Player Season Stats

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

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

## Facts

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

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 fanfare-api-fly-dev-293f8fe9
```

Example prompt: Pull up Shohei Ohtani's full season stats — hitting, pitching, and fielding — his MLB player ID is 660271.

## When to prefer this

Use this endpoint when you need comprehensive season-level statistics (hitting, pitching, and fielding) for a specific MLB player and you have their MLB player ID. Ideal for fantasy baseball analysis, player comparisons, sports trivia, and reporting.

## Known failure modes

- Invalid or non-existent player ID returns an error or empty response
- Player ID belongs to a minor league or historical player not in the active dataset
- Endpoint unavailable or returns 402 if payment is not provided
- Partial stats returned if the player has not played both as hitter and pitcher

## How this service works

Full season hitting, pitching, and fielding stats for an MLB player by ID. Example: 660271 = Shohei Ohtani.

## Output

Full season statistics for the specified MLB player, including hitting stats (e.g. batting average, home runs, RBIs, OPS), pitching stats (e.g. ERA, strikeouts, WHIP, wins), and fielding stats for the current or most recent 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/fanfare-api-fly-dev-293f8fe9/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from fanfare-api.fly.dev](https://www.zero.xyz/host/fanfare-api.fly.dev/llms.txt)
