MLB teams API
teams
mlb.teamsThe 30 MLB franchises, organized into the American and National Leagues with three divisions in each.
GET/api/v1/mlb/teamsList teams for MLB
Parameters
activequerybooleanoptionalFilter by active status (defaults to true to show only currently-active rows; pass active=false to include inactive).
limitqueryintegeroptionaldefault 50Page size. Defaults to 50; max 5000.
from_idquerybigintoptionalReturn rows with id strictly greater than this value; page using the previous response's `next_from_id`. Omit on the first page.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
-H 'Authorization: Bearer YOUR_API_KEY' \
'https://api.stat-api.com/api/v1/mlb/teams?limit=3'Responses
200teams rows matching the declared filter set, wrapped in { teams, limit, next_from_id }. next_from_id is the last row's id on a full page — pass it back via ?from_id= to walk the full result; null marks the terminal page.application/jsonshow example ▸
400No declared filter set was satisfied — response body matches MissingRequiredFiltersError; pick one combo from the accepted-sets hint and resend.
application/jsonResponse Schema(11 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
league_team_id | integernullable | — | Official MLB team ID (issued by the league) e.g. 108 |
venue_id | bigintnullable | — e.g. 2 | |
abbreviation | string | — | — e.g. LAA |
active | boolean | — | — e.g. true |
city | string | — | — e.g. Los Angeles |
division | string | — | — Values:WestEastCentral |
full_name | string | — | — e.g. Los Angeles Angels |
league | string | — | — Values:American LeagueNational League |
logo_url | stringnullable | — | URL to team logo image e.g. — (all-null in sample) |
name | string | — | — e.g. Angels |
GET/api/v1/mlb/teams/{id}Get a single team by id
Parameters
idpathbigintrequiredPrimary key (id) of the team row.
Restores the documented defaults (trial keys only accept the unchanged defaults).
Request
curl -sS --compressed \
-H 'Authorization: Bearer YOUR_API_KEY' \
'https://api.stat-api.com/api/v1/mlb/teams/{pk_value}'Responses
200Single team row.application/jsonshow example ▸
404Row not found.
Response Schema(11 fields)show schema ▸
| Field | Type | References | Description |
|---|---|---|---|
idkey | bigint | — | Primary Key |
league_team_id | integernullable | — | Official MLB team ID (issued by the league) e.g. 108 |
venue_id | bigintnullable | — e.g. 2 | |
abbreviation | string | — | — e.g. LAA |
active | boolean | — | — e.g. true |
city | string | — | — e.g. Los Angeles |
division | string | — | — Values:WestEastCentral |
full_name | string | — | — e.g. Los Angeles Angels |
league | string | — | — Values:American LeagueNational League |
logo_url | stringnullable | — | URL to team logo image e.g. — (all-null in sample) |
name | string | — | — e.g. Angels |