Major League Baseball Analytics API

Operations pertaining to field tracking and analytics.

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 9

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

GET /api/v1/game/{gamePk}/{guid}/contextMetricsAverages Get Statcast context metrics averages for a play · Get the field tracking data for a specific play #
Ask an LLM
“Can I get the average context metrics for a Statcast play?”
“What does the contextMetricsAverages endpoint return for a play?”
Tell an agent
Get the context metrics averages for play {guid} in game {gamePk}.
Show average context metrics for play {guid} of game {gamePk} with fields {fields}.
POST /api/v1/game/{gamePk}/{guid}/contextMetricsAverages Post to context metrics averages for a play · Get the field tracking data for a specific play #
Ask an LLM
“Can I POST to the context metrics averages endpoint for a play?”
“Is there a POST version of the context metrics averages call?”
Tell an agent
POST to context metrics averages for play {guid} in game {gamePk}.
Send a context metrics averages request for play {guid} of game {gamePk} with fields {fields}.
GET /api/v1/game/{gamePk}/{guid}/homeRunBallparks Get ballparks where a home run was hit · Get the field tracking data for a specific play #
Ask an LLM
“Which ballparks have a home run from a given play?”
“Can I get home run park data for a play?”
Tell an agent
Get home run ballparks for play {guid} in game {gamePk}.
Show home run parks for play {guid} of game {gamePk} with fields {fields}.
GET /api/v1/game/{gamePk}/{guid}/contextMetrics Get raw field tracking data for a play · Get the field tracking data for a specific play #
Ask an LLM
“Where can I find the raw coordinate tracking data for a single play?”
“Can I get the full field tracking file for one play, not the averaged version?”
Tell an agent
Download the raw field tracking data for play {guid} in game {gamePk}.
Fetch the raw coordinates and calculated tracking metrics for play {guid} of game {gamePk}, returning only {fields}.
GET /api/v1/game/{gamePk}/{guid}/analytics Get parsed tracking data for a play · Tracking data by play/guid #
Ask an LLM
“Can I get the parsed JSON tracking data for a Statcast play?”
“What does the analytics endpoint return for a play?”
Tell an agent
Get parsed analytics for play {guid} in game {gamePk}.
Show parsed tracking data for play {guid} of game {gamePk} with fields {fields}.
GET /api/v1/game/{gamePk}/guids List play GUIDs for a game · Get play GUIDs by game #
Ask an LLM
“What Statcast GUIDs exist for every play in a game?”
“Can I filter a game's play GUIDs by pitch, hit or pickoff?”
Tell an agent
List play GUIDs for game {gamePk}.
List GUIDs for game {gamePk} that are pitches.
GET /api/v1/game/lastPitch Get the last pitch of several games · Get the last pitch for a list of games #
Ask an LLM
“What was the final pitch of a list of games?”
“Can I get the last pitch for multiple games at once?”
Tell an agent
Get the last pitch for games {gamePks}.
Show the final pitch of each game in {gamePks}.
GET /api/v1/analytics/guids List tracking GUIDs for a date range · Tracking data by date/time #
Ask an LLM
“Can I get Statcast GUIDs for a date range?”
“Which tracking GUIDs were created in a given season?”
Tell an agent
List tracking GUIDs for {sportId} games in {season}.
List tracking GUIDs for {sportId} games on {gameDate}.
GET /api/v1/analytics/game Get tracking metadata for games · Get tracking metadata for games #
Ask an LLM
“Can I get tracking metadata for a list of games?”
“What metadata is available for games by date range?”
Tell an agent
Get tracking metadata for games in {sportId} on {gameDate}.
Get tracking metadata for {sportId} games of type {gameType} in {season}.

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-analytics-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-analytics-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stats API Documentation Analytics 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 (266 KB total) ---
# Full source: https://artifacts.apis.io/major-league-baseball/openapi/major-league-baseball-analytics-api-openapi.yml