# Fanfare MLB Standings API

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

Returns current MLB standings including wins, losses, win percentage, games back, home/away splits, and streak, optionally filtered by league

## Facts

- Endpoint: GET https://fanfare-api.fly.dev/mlb/standings
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/fanfare-api-fly-dev-75be3778
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UIHY7yePBwry0pgK9qZFb

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-75be3778
```

Example prompt: What are the current MLB standings for the American League — wins, losses, win percentage, games back, and streaks for all teams?

## When to prefer this

Use this endpoint when you need current, real-time MLB team standings data including win/loss records, games back, and streaks. Prefer this over general sports data APIs when you specifically need structured MLB standings with home/away splits and can filter by American or National League.

## Known failure modes

- Invalid leagueId returns an error or empty result — must be 103 (AL) or 104 (NL)
- Service unavailable during MLB offseason may return empty or stale data
- Network timeout from fly.dev hosting if service is cold-started
- Missing leagueId returns standings for all leagues combined or may error

## How this service works

Current MLB standings — wins, losses, win percentage, games back, home/away splits, and streak. Filter by leagueId: 103 for American League, 104 for National League.

## Output

A list of MLB teams with their current standings data including wins, losses, win percentage, games back from first place, home record, away record, and current streak — filterable by American League (leagueId 103) or National League (leagueId 104).

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "leagueId": 103
  }
 }
}
```

## 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"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "leagueId": {
       "type": "integer",
       "description": "103 for AL, 104 for NL"
      }
     }
    }
   },
   "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": "array",
   "items": {
    "type": "object",
    "required": [
     "team",
     "record",
     "division_rank",
     "wildcard_rank"
    ],
    "properties": {
     "team": {
      "type": "object",
      "required": [
       "id",
       "city",
       "name",
       "full_name",
       "abbreviation",
       "league_division"
      ],
      "properties": {
       "id": {
        "type": "string"
       },
       "city": {
        "type": "string"
       },
       "name": {
        "type": "string"
       },
       "full_name": {
        "type": "string"
       },
       "abbreviation": {
        "type": "string"
       },
       "league_division": {
        "type": "string"
       }
      }
     },
     "record": {
      "type": "object",
      "required": [
       "pct",
       "wins",
       "losses",
       "streak",
       "last_10",
       "games_back",
       "away_record",
       "home_record"
      ],
      "properties": {
       "pct": {
        "type": "number"
       },
       "wins": {
        "type": "number"
       },
       "losses": {
        "type": "number"
       },
       "streak": {
        "type": "string"
       },
       "last_10": {
        "type": "string"
       },
       "games_back": {
        "type": "null"
       },
       "away_record": {
        "type": "string"
       },
       "home_record": {
        "type": "string"
       }
      }
     },
     "division_rank": {
      "type": "number"
     },
     "wildcard_rank": {
      "type": "null"
     }
    }
   }
  },
  "sport": {
   "type": "string"
  },
  "errors": {
   "type": "array",
   "items": {
    "type": "unknown"
   }
  },
  "league": {
   "type": "string"
  },
  "warnings": {
   "type": "array",
   "items": {
    "type": "unknown"
   }
  },
  "request_id": {
   "type": "string"
  },
  "retrieved_at": {
   "type": "string"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/fanfare-api-fly-dev-75be3778/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)
