BaseballData API
Data
Coverage
MLB seasons held129MLB 2026 games2,469Postseason line scores40WBC and Premier12 games242Czech box scores1,430
See all coverage
DocsPricingStatus

Documentation/Leagues

GET /v1/leagues | Baseball Data API

Every league we hold, with its seasons and how many of its games carry each part of the record.
GEThttps://api.baseballapi.net/v1/leagues

Try it

Run calls the API with your key.
// The answer appears here.

Returns

FieldWhat it holds
leaguestring: the league's slug, used in every league address (/v1/{league}/...)
namestring: the league's name
full_namestring: a longer description
countrystring: the country's name
country_codestring: ISO 3166 alpha-2, or INT for international tournaments
first_seasoninteger or null: the first season held
last_seasoninteger or null: the latest season held
seasonsinteger: seasons held
gamesinteger or null: games held one by one (null where the league is held as team seasons)
team_seasonsinteger or null: team seasons held, where the league is held that way
with_line_scoreinteger or null: games with runs by inning
with_box_scoreinteger or null: games with batting and pitching lines
with_play_by_playinteger or null: games with every plate appearance
with_pitch_datainteger or null: games with each pitch recorded
with_weatherinteger or null: games with the weather at or near first pitch
restingboolean: true while the league is between seasons
checked_atstring or null: when we last checked for new games, ISO 8601 UTC

Example answer

A real answer, taken 2026-11-03.

{
    "data": [
        {
            "league": "mlb",
            "name": "MLB",
            "full_name": "American and National Leagues, and the majors before them",
            "country": "United States",
            "country_code": "US",
            "first_season": 1897,
            "last_season": 2026,
            "seasons": 130,
            "games": 220475,
            "team_seasons": null,
            "with_line_score": 218046,
            "with_box_score": 217997,
            "with_play_by_play": 206492,
            "with_pitch_data": null,
            "with_weather": 210839,
            "resting": true,
            "checked_at": "2026-11-03T06:36:29Z"
        },
        {
            "league": "minors",
            "name": "Minor leagues",
            "full_name": "Affiliated and independent leagues, team seasons",
            "country": "United States",
            "country_code": "US",
            "first_season": 1877,
            "last_season": 2026,
            "seasons": 150,
            "games": null,
            "team_seasons": 30026,
            "with_line_score": null,
            "with_box_score": null,
            "with_play_by_play": null,
            "with_pitch_data": null,
            "with_weather": null,
            "resting": false,
            "checked_at": null
        }
    ],
    "meta": {
        "counted_at": "2026-11-03T06:37:04Z",
        "count": 11
    }
}

Errors

Every endpoint can answer unauthorized, unknown_parameter, rate_limited, quota_exceeded and server_error. See Errors.