# MLB league leaders by stat category API

Fetch MLB league leaders by stat category, season, league and game type via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as category, limit, output, and retrieve structured data including statistical category key, recorded statistical value, ranked player identity object, and player team identity object to build multi-stat leader cards, compare al and nl races, and monitor minor-league standouts.

Documentation: https://openany.si/mlb-stats/mlb-stats-mlb-league-leaders-by-stat-category-api/644c1b44-f2c7-4edb-92c5-30830f0ccbdc/
API ID: 644c1b44-f2c7-4edb-92c5-30830f0ccbdc
Provider: apish
Contract revision: 3
Method: GET
Endpoint: https://api.openany.si/v1/agent-apis/apish/mlb/v1/leaders
Page update time: 2026-12-03T02:44:10.031Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: none
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.002 / billing credit
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract.
Contract update time: 2026-12-03T02:44:08.395Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "0",
    "max_cost_micro_usd": "2000",
    "quantities": [
      {
        "id": "upstream_credits",
        "label": "Actual API.SH credits consumed",
        "max_quantity": "1",
        "measure": "value",
        "pointer": "/credits_used",
        "price_micro_usd": "2000",
        "quantity_scale": 0,
        "source": "response",
        "unit": "credit",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": []
  }
}
```

## Usage and limits
## MLB League Leaders API

Filter league leaders with optional category (default homeRuns; comma-separated such as homeRuns,battingAverage,earnedRunAverage), season, group (hitting, pitching, fielding, catching or running), league (al or nl), game\_type (R, P, S), limit (default 10, max 100) and sport\_id (1 for MLB or minor-league IDs).

## What You Can Build

- **Build multi-stat leader cards**: Request homeRuns,battingAverage,earnedRunAverage in one call to populate homepage stat leader modules.
- **Compare AL and NL races**: Set league=al or league=nl alongside game\_type=P to track league-specific or postseason leaders.
- **Monitor minor-league standouts**: Set sport\_id to 11 (Triple-A) through 16 (Rookie) to surface top prospect performers.

## Returned Data

| Field | Meaning |
| --- | --- |
| `count` | Number of leader categories returned |
| `categories[].category` | Statistical category key |
| `categories[].group` | Stat group such as hitting or pitching |
| `categories[].season` | Season year for the leaderboard |
| `categories[].game_type` | Game type code such as R or P |
| `categories[].total` | Total ranked entries in the category |
| `categories[].leaders[].rank` | Player rank in the category |
| `categories[].leaders[].value` | Recorded statistical value |
| `categories[].leaders[].player` | Ranked player identity object |
| `categories[].leaders[].team` | Player team identity object |

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "MLB league leaders by stat category API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "description": "Leader category (default homeRuns); comma-separated for several, e.g. homeRuns,battingAverage,earnedRunAverage."
        },
        "season": {
          "type": "string",
          "description": "Season year; default this year."
        },
        "group": {
          "type": "string",
          "description": "hitting, pitching, fielding, catching or running."
        },
        "league": {
          "type": "string",
          "description": "al or nl.",
          "enum": [
            "al",
            "nl"
          ]
        },
        "game_type": {
          "type": "string",
          "description": "R (default), P postseason, S spring ..."
        },
        "limit": {
          "type": "integer",
          "description": "Leaders per category (default 10, max 100)."
        },
        "sport_id": {
          "type": "string",
          "description": "Level: 1 MLB (default), 11 Triple-A, 12 Double-A, 13 High-A, 14 Single-A, 16 Rookie, 17 winter leagues, 51 international.",
          "enum": [
            "1",
            "11",
            "12",
            "13",
            "14",
            "16",
            "17",
            "21",
            "22",
            "23",
            "51",
            "586"
          ]
        },
        "raw": {
          "type": "string",
          "description": "0 leaves out the bulky `raw` source blocks (often 10-30x smaller).",
          "enum": [
            "0",
            "1"
          ]
        },
        "fields": {
          "type": "string",
          "description": "Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included."
        },
        "fresh": {
          "type": "string",
          "description": "1 skips the 24-hour cache and fetches live.",
          "enum": [
            "1"
          ]
        },
        "output": {
          "type": "string",
          "description": "JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.",
          "enum": [
            "json"
          ]
        },
        "records": {
          "type": "string",
          "description": "With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {}
    }
  },
  "required": [
    "path",
    "query",
    "headers"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "applied_filters": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string"
        },
        "game_type": {
          "type": "string"
        },
        "group": {
          "type": "null"
        },
        "league": {
          "type": "null"
        },
        "season": {
          "type": "integer"
        },
        "sport_id": {
          "type": "integer"
        }
      }
    },
    "cached": {
      "type": "boolean"
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "game_type": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "leaders": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "league": {
                  "type": "string"
                },
                "player": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                },
                "rank": {
                  "type": "integer"
                },
                "team": {
                  "type": "object",
                  "properties": {
                    "abbreviation": {
                      "type": "string"
                    },
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                },
                "value": {
                  "type": "string"
                }
              }
            }
          },
          "season": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        }
      }
    },
    "count": {
      "type": "integer"
    },
    "credits_used": {
      "type": "integer"
    },
    "fetched_at": {
      "type": "string"
    }
  }
}
```

## Request example
Scenario: Official example · Live API.SH response · Minimal request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/apish/mlb/v1/leaders?category=homeRuns&limit=1&output=json&raw=0&season=2026' \
  -X GET \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Documented HTTP 200
```json
{
  "applied_filters": {
    "category": "homeRuns",
    "game_type": "R",
    "group": null,
    "league": null,
    "season": 2026,
    "sport_id": 1
  },
  "cached": false,
  "categories": [
    {
      "category": "homeRuns",
      "game_type": "R",
      "group": "hitting",
      "leaders": [
        {
          "league": "NL",
          "player": {
            "id": 691718,
            "name": "Pete Crow-Armstrong"
          },
          "rank": 1,
          "team": {
            "abbreviation": "CHC",
            "id": 112,
            "name": "Chicago Cubs"
          },
          "value": "45"
        },
        {
          "league": "NL",
          "player": {
            "id": 656941,
            "name": "Kyle Schwarber"
          },
          "rank": 1,
          "team": {
            "abbreviation": "PHI",
            "id": 143,
            "name": "Philadelphia Phillies"
          },
          "value": "45"
        }
      ],
      "season": "2026",
      "total": 538
    },
    {
      "category": "homeRuns",
      "game_type": "R",
      "group": "catching",
      "leaders": [
        {
          "league": "NL",
          "player": {
            "id": 592663,
            "name": "J.T. Realmuto"
          },
          "rank": 1,
          "team": {
            "abbreviation": "PHI",
            "id": 143,
            "name": "Philadelphia Phillies"
          },
          "value": "140"
        }
      ],
      "season": "2026",
      "total": 110
    },
    {
      "category": "homeRuns",
      "game_type": "R",
      "group": "pitching",
      "leaders": [
        {
          "league": "NL",
          "player": {
            "id": 605400,
            "name": "Aaron Nola"
          },
          "rank": 1,
          "team": {
            "abbreviation": "PHI",
            "id": 143,
            "name": "Philadelphia Phillies"
          },
          "value": "37"
        }
      ],
      "season": "2026",
      "total": 766
    }
  ],
  "count": 3,
  "credits_used": 1,
  "fetched_at": "2026-11-19T12:22:02.479Z"
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

## Common questions
### Can I request multiple stat categories in a single call?
Yes. Pass comma-separated category names such as homeRuns,battingAverage,earnedRunAverage.

### What is the default category and limit if I omit them?
category defaults to homeRuns and limit defaults to 10 leaders per category (up to max 100).

### How do I filter leaders to the American League or National League?
Pass league=al or league=nl in the query string.

### Are minor-league and postseason leaderboards supported?
Yes. Use sport_id (e.g. 11 Triple-A, 12 Double-A) for minor leagues and game_type=P for postseason.

### When should I use MLB Stat Leaderboard API instead?
Use MLB Stat Leaderboard API when you need full sortable multi-column tables with position, pool and offset pagination.

### How do I get fresh leaderboards without cached values?
Pass fresh=1 to skip the 24-hour cache and raw=0 to omit bulky raw blocks.

## Available implementations
- apish: https://openany.si/mlb-stats/mlb-stats-mlb-league-leaders-by-stat-category-api/644c1b44-f2c7-4edb-92c5-30830f0ccbdc/

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
