# MLB Teams List

> MLB Teams List 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-15).

Returns all MLB teams with id, name, abbreviation, city, and division.

## Facts

- Endpoint: GET https://mlb-stats-api.fly.dev/mlb/teams
- Price: $0.001000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mlb-stats-api-fly-dev-4a8d7989
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mzHYvwcYxodIdlyeT0dGu

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-4a8d7989
```

Example prompt: Can you show me all the MLB teams along with their IDs, abbreviations, cities, and which division they're in?

## When to prefer this

Use this endpoint when you need a complete, structured directory of all MLB teams with their IDs, abbreviations, cities, and division assignments — especially when building team lookups, populating dropdowns, or resolving team names to IDs for follow-up queries.

## Known failure modes

- Service unavailable (5xx) if the fly.dev host is down or cold-starting
- Payment required (402) if the x402 payment header is missing or invalid
- Unexpected empty or partial dataset if upstream MLB data source is unavailable

## How this service works

All 30 MLB teams with ID, city, abbreviation, and division. Use team IDs to query schedules, standings, and players.

## Output

A list of all MLB teams, each with a numeric team id, full team name, abbreviation (e.g. NYY), city, and division (e.g. AL East, NL West).

## Example request

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

## 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": {}
    }
   },
   "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": [
     "id",
     "city",
     "name",
     "record",
     "standing",
     "full_name",
     "abbreviation",
     "league_division"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "city": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "record": {
      "type": "null"
     },
     "standing": {
      "type": "null"
     },
     "full_name": {
      "type": "string"
     },
     "abbreviation": {
      "type": "string"
     },
     "league_division": {
      "type": "string"
     }
    }
   }
  },
  "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/mlb-stats-api-fly-dev-4a8d7989/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)
