# MLB Stats & Schedule Data API

> MLB Stats & Schedule Data API is a paid API for AI agents from api.scrapeforagents.tech, paid per call via x402, $0.08/call, status unknown (last checked 2026-10-02).

Retrieves structured MLB data including teams, players, schedules, standings, player stats, game details, and leaderboards for any season

## Facts

- Endpoint: POST https://api.scrapeforagents.tech/v1/mlb?utm_source=zero.xyz
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mlb-stats-schedule-data-api-9b419235
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_faF_4WBq8BOXs4nRXErEb

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-schedule-data-api-9b419235 -d '<json body>'
```

Example prompt: Pull up the current AL and NL hitting leaders for the 2024 regular season, showing stats like batting average and home runs — top 50 results.

## When to prefer this

Use this endpoint when you need structured, queryable MLB data — including historical seasons, player stats, schedules, standings, or leaderboards — without scraping raw HTML. It's ideal for fantasy sports agents, sports analytics workflows, or any application needing clean JSON MLB data on a pay-per-call basis. Prefer this over general web search when you need machine-readable stats fields rather than narrative summaries.

## Known failure modes

- Invalid date format (must be YYYY-MM-DD) causing empty result
- Unknown teamId or playerId returning empty items array
- gamePk not found for specified game type or season
- Season year out of range returning no data
- maxItems too low truncating results unexpectedly
- Network timeout or upstream MLB Stats API unavailability

## How this service works

Pay-per-call structured web data. Failed or empty runs are not charged.

## Output

Returns a JSON object with a count and an items array containing structured MLB data rows. Fields vary by mode — e.g. teams mode returns team names and abbreviations; playerStats mode returns hitting/pitching/fielding numbers like batting average, home runs, ERA, strikeouts; schedule mode returns game dates, opponents, and game IDs; standings mode returns win/loss records and division ranks. Failed or empty result sets are not charged.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "date": {
   "type": "string",
   "description": "One schedule or game-details date in YYYY-MM-DD format."
  },
  "mode": {
   "enum": [
    "teams",
    "players",
    "schedule",
    "standings",
    "playerStats",
    "gameDetails",
    "leaders"
   ],
   "type": "string",
   "default": "teams",
   "description": "Choose teams, roster players, games, standings, player season statistics, team game totals, or ranked leaders."
  },
  "gamePk": {
   "type": "integer",
   "description": "One game ID for game details, merged with Game IDs."
  },
  "season": {
   "type": "integer",
   "description": "Optional single season year; merged with Seasons when both are set."
  },
  "teamId": {
   "type": "integer",
   "description": "One club ID, merged with Team IDs when both are set."
  },
  "toDate": {
   "type": "string",
   "description": "Last schedule or game-details date in YYYY-MM-DD format."
  },
  "gamePks": {
   "type": "array",
   "description": "Game details for these game IDs; leave empty to discover games from dates or seasons."
  },
  "seasons": {
   "type": "array",
   "description": "Season years to collect. Leave empty for the current year."
  },
  "teamIds": {
   "type": "array",
   "description": "Optional club IDs to filter teams, rosters, games, standings, stats, or leaders."
  },
  "fromDate": {
   "type": "string",
   "description": "First schedule or game-details date in YYYY-MM-DD format."
  },
  "gameType": {
   "enum": [
    "R",
    "S",
    "P",
    "W",
    "L",
    "A"
   ],
   "type": "string",
   "default": "R",
   "description": "Game classification for schedule, game details, and leaderboards."
  },
  "leagueId": {
   "enum": [
    "both",
    "AL",
    "NL"
   ],
   "type": "string",
   "default": "both",
   "description": "League filter for standings."
  },
  "maxItems": {
   "type": "integer",
   "default": 1000,
   "minimum": 1,
   "description": "Maximum dataset rows to return across all seasons and categories."
  },
  "playerId": {
   "type": "integer",
   "description": "One player ID for player statistics, merged with Player IDs."
  },
  "playerIds": {
   "type": "array",
   "description": "Player statistics for these player IDs; leave empty to use selected club rosters."
  },
  "statGroup": {
   "enum": [
    "hitting",
    "pitching",
    "fielding"
   ],
   "type": "string",
   "default": "hitting",
   "description": "Player stats or leaders for hitting, pitching, or fielding."
 
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "items": [
   {
    "age": null,
    "avg": null,
    "active": null,
    "atBats": null,
    "airOuts": null,
    "assists": null,
    "abbreviation": null,
    "atBatsPerHomeRun": null
   }
  ],
  "product": "mlb"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mlb-stats-schedule-data-api-9b419235/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.scrapeforagents.tech](https://www.zero.xyz/host/api.scrapeforagents.tech/llms.txt)
