MLB API endpoint
Lists the 30 MLB clubs for a `season` (four-digit year, default the current year). Each team has its id, name, club name, location, abbreviation, league, division, venue, first year of play and active flag.
/mlb/teamsseason is an optional four-digit year and defaults to the current year. The response is MLB-only and includes club abbreviation, league, division, and venue metadata.
| Field | Filled in, of 30 checked | Values in the sample |
|---|---|---|
| id | 30 | |
| name | 30 | “Athletics” and 29 other values |
| abbreviation | 30 | “ATH” and 29 other values |
| active | 30 | true in 30 of 30 |
| season | 30 | 2,026 |
| club_name | 30 | “Athletics” and 29 other values |
| location_name | 30 | “Sacramento” and 28 other values |
| first_year_of_play | 30 | 1,871 to 1,996, median 1,901 |
| league | 30 | |
| division | 30 | |
| venue | 30 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| season | integer | No | current year | Four-digit season; defaults to current year | 2026 |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/mlb/teams" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"season": 2026,
"count": 30,
"teams": [
{
"id": 147,
"name": "New York Yankees",
"abbreviation": "NYY",
"league": {
"id": 103,
"name": "American League"
}
}
]
}
}Request schema
No body schema
Response schema
#/definitions/mlb.teamsResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | mlb.TeamsResponse | No | ||||
| data.count | integer | No | ||||
| data.fetched_at | string | No | ||||
| data.season | integer | No | ||||
| data.source_url | string | No | ||||
| data.teams | array | No | ||||
| data.teams[].abbreviation | string | No | Short team abbreviation, for example `NYY`. Omitted when not available. | |||
| data.teams[].active | boolean | No | ||||
| data.teams[].club_name | string | No | ||||
| data.teams[].division | mlb.NamedRef | No | ||||
| data.teams[].division.id | integer | No | MLB id of the player or league. | |||
| data.teams[].division.name | string | No | Name of the player or league. | |||
| data.teams[].first_year_of_play | string | No | ||||
| data.teams[].id | integer | No | MLB team id. | |||
| data.teams[].league | mlb.NamedRef | No | ||||
| data.teams[].league.id | integer | No | MLB id of the player or league. | |||
| data.teams[].league.name | string | No | Name of the player or league. | |||
| data.teams[].location_name | string | No | ||||
| data.teams[].name | string | No | Full team name. | |||
| data.teams[].season | integer | No | ||||
| data.teams[].venue | mlb.VenueRef | No | ||||
| data.teams[].venue.id | integer | No | ||||
| data.teams[].venue.name | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/mlb/teams" \
-H "x-api-key: $CRAWLORA_API_KEY"