canonical: https://jentic.com/apis/mlb.com/mlb

# MLB Stats API

The MLB Stats API serves official Major League Baseball data: team rosters, player and team statistics, game schedules, live standings, venues, transactions, and seasons. It exposes stat search and leader queries, grouped and metric stats, and analytics such as spray charts, outs above average, and stolen-base probability, plus venue weather and uniform details. Agents can assemble schedules, box-score context, and historical records from a single read-oriented data surface.

## For AI agents

Retrieve official MLB schedules, standings, team rosters, player and team stats, leaders, venues, and analytics such as spray charts and outs above average.

## Scope

Does not handle ticketing, streaming video, or fantasy league management. Use for official MLB schedules, standings, and statistics only.

## Capabilities

- Retrieve game schedules by date, season, or schedule type
- Read live and historical standings for a league
- List a team's roster, coaches, and stat leaders
- Query player and team statistics, including grouped and metric stats
- Run stat search and leader queries across seasons
- Pull analytics such as spray charts, outs above average, and stolen-base probability

## Use cases

### AI agent baseball data access via Jentic

An AI agent connected through Jentic answers baseball questions without browsing the MLB Stats API reference. It searches by intent such as getting a schedule or standings, Jentic returns the matching operation with its input schema, and the agent reads schedules, rosters, and leaders to build a response. The developer's own Jentic One instance supplies any configured credential at call time.

Example prompt: Call GET `/api/v1/schedule` for today's games, then GET `/api/v1/standings/{standingsType}` to add the current standings

### Live scoreboard and schedule feeds

Sports apps and bots show today's games and results. The schedule operations return games by date, season, or schedule type, including postseason and tied-game schedules, so an agent can render a scoreboard and link each game to its venue and status.

Example prompt: Call GET `/api/v1/schedule/postseason` to list postseason games and GET `/api/v1/venues/{venueId}` for venue detail

### Roster and player research

Fantasy and analytics tools need current rosters and player stats. The API lists a team's roster, coaches, and personnel, returns players for a sport level, and serves player and team statistics, letting an agent compile a player profile with season and historical numbers.

Example prompt: Call GET `/api/v1/teams/{teamId}/roster` for a team, then GET `/api/v1/teams/{teamId}/leaders` to add its stat leaders

### Advanced stats and analytics

Analysts want tracking-derived metrics, not just box scores. The analytics operations return spray charts, outs above average, and stolen-base probability, and the stats search surface supports grouped and metric queries, so an agent can pull Statcast-style context for a batter or situation.

Example prompt: Call GET `/api/v1/stats/analytics/sprayChart` for the current batter and GET `/api/v1/stats/leaders` for a chosen statistic

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/v1/schedule` | View schedule by schedule type |
| GET | `/api/v1/standings/{standingsType}` | View standings for a league |
| GET | `/api/v1/teams/{teamId}/roster` | View a team's roster |
| GET | `/api/v1/teams/{teamId}/leaders` | View team stat leaders |
| GET | `/api/v1/stats/leaders` | Get leaders for a statistic |
| GET | `/api/v1/stats/analytics/sprayChart` | Get the spray chart for the current batter |
| GET | `/api/v1/venues/{venueId}` | View venue info |
| GET | `/api/v1/sports/{sportId}/players` | Get all players for a sport level |

## Key resources

- **Schedule** — Game schedules by date, season, schedule type, and postseason
- **Teams** — Team info, rosters, coaches, leaders, affiliates, and history
- **Stats** — Player and team statistics, leaders, grouped, metric, and search queries
- **Standings** — Live and historical standings by league and standings type
- **Venues** — Venue info and venue weather forecasts

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 42 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 44 / 100
  - Developer Experience & Jentic Compatibility: 56 / 100
  - AI-Readiness & Agent Experience: 33 / 100
  - Agent Usability: 41 / 100
  - Security: 43 / 100
  - AI Discoverability: 45 / 100
- **View full report:** https://jentic.com/apis/mlb.com/mlb/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the MLB Stats API by hand means working across nearly two hundred read operations, picking the right schedule, stats, and standings paths, and handling the two declared HTTP schemes. Through Jentic you install once, import the MLB Stats API from the API Directory, and your agent calls the operations it needs.
- **Permission scoping:** The MLB Stats API is a read-oriented data surface, and you choose which operations the agent may call. A rule can keep it to the schedule, standings, roster, and stats reads, so the few state-changing operations such as updating alumni or clearing status types are not reachable unless you add them.
- **Credential handling:** Any MLB Stats API credential you configure is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get the MLB schedule' or 'read league standings', and Jentic returns the matching MLB Stats operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **NBA Stats API** — The NBA Stats API serves the same kind of league data for basketball that the MLB Stats API serves for baseball.
- **TheSportsDB API** — TheSportsDB covers many sports and leagues broadly, where the MLB Stats API is the official, deep baseball source.
- **API-FOOTBALL** — API-FOOTBALL adds soccer fixtures and stats for apps that cover multiple sports alongside MLB baseball.
- **All Sports Football API** — All Sports provides additional multi-sport feeds that sit beside the MLB Stats API in a broader sports product.

## FAQ

### What authentication does the MLB Stats API use?

The MLB Stats API declares two HTTP schemes in its OpenAPI spec, basic and bearer, as alternatives on its operations. When a request does carry a credential, Jentic stores it encrypted in your own Jentic One instance and injects it at execution time, so it never enters the agent's prompt or logs.

### Can I get game schedules with the MLB Stats API?

Yes. The schedule operations return games by date, season, and schedule type, including postseason, tied-game, and tracking-event schedules. An agent can read the schedule and then link each game to its venue, status, and standings context.

### What are the rate limits for the MLB Stats API?

The OpenAPI spec does not specify numeric rate limits. Check the MLB Stats API documentation at https://docs.statsapi.mlb.com for current usage guidance before running high-frequency schedule or stats polling.

### How do I get standings through Jentic?

Search Jentic by intent such as getting league standings, and it returns the MLB Stats standings operation with its input schema. Pass the standings type, read the response, and combine it with a schedule call for a full scoreboard. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the MLB Stats API?

Yes. The surface is read-oriented, and you choose which operations the agent may call, so a rule can allow only the schedule, standings, and stats reads it needs and exclude the few state-changing operations such as updating alumni or clearing status types. Every call it makes is logged by your self-hosted instance.

### Is there an MLB Stats API MCP server?

You do not need an MCP server to give your agent the MLB Stats API. Jentic connects it directly from the API Directory: import it, and your agent calls the schedule, standings, and stats operations on demand without loading another server's tool definitions into its context.
