Major League Baseball League API

Operations pertaining to leagues

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Sports, Betting & Fantasy AE-180.80

Operations 14

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

10 of 14 operations are conformant: apis.io called them with no credentials and the responses matched this contract. Checked 2026-11-12. how this works · status file

GET /api/v1/league Get a league's info by ID · View league info conformant #
Ask an LLM
“How do I look up one baseball league's details by its ID?”
“Can I fetch a single league's info for a specific season?”
Tell an agent
Get league {leagueId}.
Show league {leagueId} for season {season}.
POST /api/v1/league Update the league cache · Update league cache #
Ask an LLM
“How do I refresh the cached league data for a sport?”
“Can I force a league cache update for a season?”
Tell an agent
Update the league cache for sport {sportId}.
Refresh the league cache for sport {sportId} in season {season}.
GET /api/v1/leagues Get league info by ID (plural path) · View league info conformant #
Ask an LLM
“Is there a plural-leagues path for looking up one league by ID?”
“Can I fetch a single league's info through the leagues plural path?”
Tell an agent
Get league {leagueId} from the leagues plural path.
Fetch league {leagueId} via the plural-leagues path for season {season}.
POST /api/v1/leagues Update the league cache (plural path) · Update league cache #
Ask an LLM
“Can I update the league cache through the plural-leagues path?”
“Is there a plural-leagues endpoint for refreshing league data?”
Tell an agent
Update the league cache through the leagues plural path for sport {sportId}.
Refresh the leagues plural path cache for sport {sportId} in season {season}.
GET /api/v1/league/{leagueId}/allStarWriteIns Get All-Star write-ins for a league · All-Star write-ins conformant #
Ask an LLM
“How do I see fan-written-in All-Star players for a league?”
“Can I get All-Star write-ins for a league in a given season?”
Tell an agent
Get All-Star write-ins for league {leagueId}.
Show All-Star write-ins for league {leagueId} in season {season}.
GET /api/v1/leagues/{leagueId}/allStarWriteIns Get All-Star write-ins for a league (plural path) · All-Star write-ins conformant #
Ask an LLM
“Is there a plural-leagues path for All-Star write-ins?”
“Can I fetch write-ins for a league through the plural-leagues path?”
Tell an agent
Get All-Star write-ins for league {leagueId} via the leagues plural path.
Show write-ins for league {leagueId} through the plural-leagues path for season {season}.
GET /api/v1/league/{leagueId}/allStarFinalVote Get the All-Star final vote for a league · All-Star final vote conformant #
Ask an LLM
“How do I see the final All-Star vote results for a league?”
“Can I get the All-Star final vote for a league in a given season?”
Tell an agent
Get the All-Star final vote for league {leagueId}.
Show the final All-Star vote for league {leagueId} in season {season}.
GET /api/v1/leagues/{leagueId}/allStarFinalVote Get the All-Star final vote for a league (plural path) · All-Star final vote conformant #
Ask an LLM
“Is there a plural-leagues path for the All-Star final vote?”
“Can I fetch the final All-Star vote for a league through the plural-leagues path?”
Tell an agent
Get the All-Star final vote for league {leagueId} via the leagues plural path.
Show the final vote for league {leagueId} through the plural-leagues path for season {season}.
GET /api/v1/league/allStarBallot Get the All-Star ballot for a league · All-Star Ballot #
Ask an LLM
“How do I see the All-Star ballot for a league?”
“Can I get the All-Star ballot for a league in a given season?”
Tell an agent
Get the All-Star ballot for league {leagueId}.
Show the All-Star ballot for league {leagueId} in season {season}.
GET /api/v1/league/{leagueId}/allStarBallot Get the All-Star ballot for a league (plural path) · All-Star Ballot conformant #
Ask an LLM
“Is there a plural-leagues path for the All-Star ballot?”
“Can I fetch the All-Star ballot for a league through the plural-leagues path?”
Tell an agent
Get the All-Star ballot for league {leagueId} via the leagues plural path.
Show the All-Star ballot for league {leagueId} through the plural-leagues path for season {season}.
GET /api/v1/leagues/allStarBallot Get All-Star ballot via the query-style leagues endpoint · All-Star Ballot #
Ask an LLM
“Which players are on the All-Star ballot for a league when the league ID is given in the leagues/allStarBallot path?”
“Can I get All-Star ballots for several leagues at once using a list of league IDs?”
Tell an agent
Get the All-Star ballot for leagues {leagueIds} using the leagues/allStarBallot endpoint with league {leagueId}.
Pull the leagues/allStarBallot results for league {leagueId} in season {season}, returning only fields {fields}.
GET /api/v1/leagues/{leagueId}/allStarBallot Get the All-Star ballot for a league · All-Star Ballot conformant #
Ask an LLM
“Who appears on the All-Star ballot for a particular league?”
“Can I limit the All-Star ballot response to specific fields?”
Tell an agent
List the ballot candidates for league {leagueId}, in the per-league ballot endpoint.
List ballot candidates for league {leagueId} in season {season}, returning only fields {fields}.
GET /api/v1/league/{leagueId} Get info about one league · View league info conformant #
Ask an LLM
“What are the details of a specific league?”
“Can I check whether one league is active for a season?”
Tell an agent
Get info for league {leagueId}.
Show league {leagueId} details in season {season}.
GET /api/v1/leagues/{leagueId} View league details and filter by sport or status · View league info conformant #
Ask an LLM
“What are the details of a league filtered by whether it is currently active?”
“Can I view a league's info across several seasons at once?”
Tell an agent
View league {leagueId} filtered to active status {activeStatus}.
View league {leagueId} for seasons {seasons} within sport {sportId}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/major-league-baseball:major-league-baseball-league-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

major-league-baseball-league-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stats API Documentation League API
  description: Official API for Major League Baseball.
  version: 2.0.0
servers:
- url: https://statsapi.mlb.com
  description: Production
- url: https://beta-statsapi.mlb.com
  description: Beta
- url: https://qa-statsapi.mlb.com
  description: QA
- url: http://localhost:8080
  description: Local
tags:


# --- truncated at 32 KB (240 KB total) ---
# Full source: https://artifacts.apis.io/major-league-baseball/openapi/major-league-baseball-league-api-openapi.yml