---
name: mlb-stats-api.fly.dev
description: mlb-stats-api.fly.dev provides current MLB and NFL standings, MLB team metadata, and MLB game schedule data. It covers live standings, scores, and team lookup but does not serve historical data, player statistics, or play-by-play information. The host exposes four discrete endpoints with no authentication requirements on the input side.
host: mlb-stats-api.fly.dev
---

# mlb-stats-api.fly.dev

This host is a lightweight sports data relay focused primarily on MLB operational data — team listings, current standings, and game schedules — with a secondary NFL standings endpoint. It serves agents that need to answer questions about current league standings, resolve team identifiers, or retrieve today's or upcoming game information. It does not aggregate across sports broadly and is not a general-purpose sports statistics platform.

## When to use this host

Use this host when an agent needs current MLB standings, MLB team identity resolution, MLB game schedules or live scores, or current NFL standings. It is the correct choice for questions like 'what place is [team] in their division,' 'what games are on today,' or 'what is [team]'s teamId.' Do not use this host for historical season standings, player-level statistics, play-by-play data, box scores, or sports other than MLB and NFL — those require a dedicated historical stats API or a broader sports data provider. For NBA, NHL, or other leagues, this host has no coverage and a different host must be used.

## Capabilities

### Team Reference Data

Provides the foundational lookup table of MLB teams, mapping names, abbreviations, and numeric IDs to their league and division. This is the prerequisite for any workflow that requires a teamId.

- **`fetch-mlb-teams`** — Returns a list of all MLB teams with their ID, name, abbreviation, city, and league/division assignment for a given sport ID.

### MLB Standings

Returns current MLB standings at the division and wildcard level, including win/loss records, winning percentage, games back, streaks, and home/away splits for all teams.

- **`fetch-mlb-standings`** — Returns current MLB standings for all teams across divisions and leagues, including win/loss record, winning percentage, games back, home/away splits, last-10 record, streak, and division/wildcard rank.

### MLB Schedule and Scores

Retrieves MLB game listings, live scores, and upcoming matchups filtered by date or team, including venue metadata and game status.

- **`fetch-mlb-schedule`** — Returns MLB game schedule data for a given date and/or team, including game status, scores, team details, and venue metadata.

### NFL Standings

Returns current NFL standings for all 32 teams, including win-loss records, winning percentages, and wildcard rankings.

- **`fetch-nfl-standings`** — Returns current NFL standings data including each team's win-loss record, winning percentage, and wildcard rank for all 32 teams.

## Workflows

### Team Name to Schedule Lookup

*Use when an agent needs to find a team's upcoming or current-day games but only has a team name or abbreviation rather than a numeric teamId.*

1. **`fetch-mlb-teams`** — Resolve the team name or abbreviation to its numeric teamId by enumerating all MLB teams.
2. **`fetch-mlb-schedule`** — Pass the resolved teamId (and optionally a date) to retrieve that team's game schedule, scores, and matchup details.

### Team Standings and Schedule Cross-Check

*Use when an agent needs to contextualize a team's current record alongside its upcoming games, such as evaluating playoff implications given remaining schedule.*

1. **`fetch-mlb-teams`** — Resolve the team name to its numeric teamId and confirm its league assignment for the standings query.
2. **`fetch-mlb-standings`** — Fetch current standings for the team's league to obtain its win/loss record, games back, and wildcard position.
3. **`fetch-mlb-schedule`** — Retrieve the team's upcoming games to provide schedule context alongside the standings data.

## Skill reference

### `fetch-nfl-standings`

**NFL Standings Fetcher** — Returns current NFL standings data including each team's win-loss record, winning percentage, and wildcard rank for all 32 teams.

*Use when:* Use when an agent needs current NFL team standings, win-loss records, winning percentages, or wildcard rankings across the league.

*Not for:* Do not use for MLB, NBA, or other sports standings; use the corresponding sport-specific endpoint instead. Not suitable for historical season standings — this returns current data only.

**Returns:** Returns a JSON object with request metadata and a data array of 32 NFL team entries, each containing team identity, win-loss-tie record with winning percentage, and wildcard rank.

**Example:** `GET https://mlb-stats-api.fly.dev/nfl/standings`

---

### `fetch-mlb-standings`

**MLB Standings** — Returns current MLB standings for all teams across divisions and leagues, including win/loss record, winning percentage, games back, home/away splits, last-10 record, streak, and division/wildcard rank.

*Use when:* Use when an agent needs current MLB standings data for one or both leagues, such as displaying division rankings, checking a team's record, or evaluating playoff positioning via wildcard rank.

*Not for:* Do not use for historical standings from past seasons, individual game scores, or player statistics — use a dedicated historical or game-log endpoint instead.

**Inputs:**

- `leagueId` (integer) — Numeric MLB league ID to filter standings to a single league (e.g., American League or National League). Omit to return standings for all leagues.

**Returns:** Returns a JSON object with request metadata and a data array of all MLB team standings entries, each containing team info, win/loss record, home/away splits, last-10 record, current streak, and division/wildcard rank.

**Example:** `GET https://mlb-stats-api.fly.dev/mlb/standings?leagueId=103`

---

### `fetch-mlb-teams`

**MLB Teams** — Returns a list of all MLB teams with their ID, name, abbreviation, city, and league/division assignment for a given sport ID.

*Use when:* Use when an agent needs to enumerate MLB teams, resolve a team name or abbreviation to its numeric ID, or look up which division or league a team belongs to.

*Not for:* Do not use for team standings, win/loss records, or player rosters — those require separate endpoints.

**Inputs:**

- `sportId` (integer) — Numeric sport identifier; defaults to 1 (MLB). Change only if querying a different sport context supported by the API.

**Returns:** Returns metadata (request_id, sport, league, retrieved_at) plus a data array of 30 MLB team objects each with id, name, full_name, abbreviation, city, league_division, record, and standing.

**Example:** `GET https://mlb-stats-api.fly.dev/mlb/teams?sportId=1`

---

### `fetch-mlb-schedule`

**MLB Schedule** — Returns MLB game schedule data for a given date and/or team, including game status, scores, team details, and venue metadata.

*Use when:* Use when an agent needs to retrieve MLB game listings, live scores, or upcoming matchups for a specific date or team, such as answering questions about today's games or a team's schedule.

*Not for:* Do not use for historical season standings, player statistics, or play-by-play data; use a dedicated stats or standings endpoint instead.

**Inputs:**

- `date` (string) — Calendar date for which to retrieve the schedule, in YYYY-MM-DD format. Defaults to the current date if omitted.
- `teamId` (integer) — Numeric MLB team identifier to filter results to a single team's games.

**Returns:** Returns a JSON object with request_id, sport, league, retrieved_at, and a data array of game objects each containing game status, home/away team info with division, current score, and venue name.

**Example:** `GET https://mlb-stats-api.fly.dev/mlb/schedule?date=2026-05-19&teamId=147`

---
