Compare
The MLB API: free endpoints, Statcast and FastballAPI
The MLB Stats API, Baseball Savant, pybaseball and Retrosheet are free but not equal. Where each fits, what the terms allow, and how FastballAPI differs.
Comparison facts checked October 14, 2026. FastballAPI data last refreshed 2026-10-14 23:05 UTC, newest data through 2026-10-13. Changelog
MLB has no documented public API. statsapi.mlb.com is the JSON behind MLB's own sites and apps, free to call and undocumented by MLB, and its responses point to a notice that permits only individual, non-commercial, non-bulk use. Around it sit Baseball Savant, which serves Statcast's measured pitch and batted-ball data as CSV, pybaseball, a Python package that scrapes Savant, Baseball Reference and FanGraphs, and Retrosheet, free historical play-by-play that anyone may reuse with an attribution line.
FastballAPI is a documented baseball data API and MCP server, with every tool described, a live example for each, and 500 free credits every month. It serves pitch-by-pitch and plate-appearance data, box scores, per-sportsbook lines and RE24 run values from public ESPN data, and it does not carry Statcast's measured fields. For research that needs Statcast, use Savant or pybaseball. For deep history, use Retrosheet. For a product, a backtest against sportsbook lines or an AI agent, a keyed, documented API is the cleaner base.
The options
- MLB Stats API (statsapi.mlb.com)
The JSON behind MLB's sites and apps: schedules, teams, rosters and a live feed per game with every plate appearance, pitch type and speed, and batted-ball launch speed, launch angle and distance.
Live. Free, no key. On 2026-10-14 one game's feed was 818 KB with 75 plate appearances. No MLB documentation, and each response's copyright field points to a notice allowing only individual, non-commercial, non-bulk use.
- toddrob99/MLB-StatsAPI
A Python wrapper for the Stats API, with a wiki that documents its functions and the endpoints behind them.
GPL-3.0. Version 1.9.0 released 2025-04-04; last pushed 2026-06-02. It says it is not affiliated with MLB and points to MLB's use notice.
- Baseball Savant search
MLB's Statcast site. Its search exports pitch-level CSV with measured release speed, spin rate, launch speed and launch angle.
Live. Free, no key. One day of games (2025-09-28) returned 4,460 pitch rows with 119 columns.
- pybaseball
A Python package that scrapes Baseball Savant, Baseball Reference and FanGraphs into data frames, including Statcast pitch data and season leaderboards. Documentation is in the repository.
MIT. Latest release 2.2.6 on 2023-09-08; last pushed 2026-01-04. Its README says releases may lag the repository.
- Retrosheet
Free historical baseball data: play-by-play event files for all AL and NL seasons from 1908 to 2025 plus the 1914 and 1915 Federal League, with box scores and game logs for earlier years.
Free for any use, including commercial, if the credit line from its notice appears prominently. Some early games are deduced from newspapers. Site last updated 2026-08-09.
- BALLDONTLIE
A paid multi-sport API that lists MLB among its sports, with a free tier and an official MCP server.
On 2026-10-14 its site listed Free at $0 a month per sport (5 requests a minute), All-Star at $9.99, GOAT at $39.99, and All-Access for every sport at $299.99.
Side by side
| FastballAPI | the free MLB data sources | |
|---|---|---|
| Price and key | 500 free credits a month, then from $19/mo; a free key | Free, no key |
| Documentation | Every tool documented with parameters, response fields and a live example | None from MLB. The MLB-StatsAPI wiki and the pybaseball docs are community work |
| Terms | Keyed API intended for products and models | Stats API: MLB's notice allows only individual, non-commercial, non-bulk use. Retrosheet: free with an attribution line. pybaseball: MIT code that reads sites with their own terms |
| Pitch data | get_pitches: pitches since 2015 (every pitch from 2018) with type, velocity, location and count | Stats API: pitch type and speed in each game's feed. Savant: 119 columns per pitch, including spin rate |
| Batted balls | Trajectory and field location on every plate appearance; spray charts | Stats API and Savant: launch speed, launch angle and distance |
| Sportsbook lines | 4 to 13 books per game from 2015 to 2023, plus opening and closing lines from 6 to 8 books since July 2020 | Not part of these sources |
| Run values | RE24 on every plate appearance, from each season's own matrix | Computed by you from the events, or read from pybaseball's leaderboards |
| History | 2015 to today | Retrosheet: play-by-play from 1908 |
| AI assistants | MCP server for Claude, ChatGPT and Cursor | None from MLB, Savant or Retrosheet |
| Live in-game data | No: results land each morning | Stats API: yes, as MLB's own apps use it |
Example call
Shohei Ohtani's 2025 pitch mix, regular season and postseason: usage, velocity and whiff rate by pitch type. The same view from MLB's feeds means fetching every game's feed and aggregating pitches yourself. search_players finds the player id.
curl -X POST https://mcp.fastballapi.com/v1/get_pitch_mix \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"pitcher_id": "39832",
"season": 2025
}'{"data": {"pitcher": {"id": "39832", "name": "Shohei Ohtani"}, "season": 2025, "pitches": 1093, "mix": [{"pitch_type": "FF", "name": "Four-seam FB", "pitches": 434, "usage": 0.397, "avg_velocity": 97.9, "max_velocity": 101, "whiff_rate": 0.258, "ball_rate": 0.313, "in_play": 64}, {"pitch_type": "ST", "name": "Sweeper", "pitches": 228, "usage": 0.209, "avg_velocity": 84.6, "max_velocity": 89, "whiff_rate": 0.407, "ball_rate": 0.289, "in_play": 41}, {"pitch_type": "SL", "name": "Slider", "pitches": 128, "usage": 0.117, "avg_velocity": 87.8, "max_velocity": 92, "whiff_rate": 0.403, "ball_rate": 0.305, "in_play": 20}], "count": 8}}The mix array is cut to the first three pitch types here (the full response has 8). Responses are wrapped in a data object. get_pitch_mix costs 5 credits.
Use the free MLB data sources instead if
- You need Statcast's measured fields, such as exit velocity, spin rate and extension. Baseball Savant and pybaseball carry them; FastballAPI does not.
- You need baseball history before 2015. Retrosheet has play-by-play back to 1908 and is free to reuse with its credit line.
- You are building a personal, non-commercial project and want the same fields MLB's own apps show.
- You need live in-game state. FastballAPI updates each morning.
- You work in Python notebooks and do not need a hosted API.
Questions
Is there an official MLB API?
MLB does not publish a documented public API. statsapi.mlb.com is the JSON behind its own sites, and its responses point to a notice that allows only individual, non-commercial, non-bulk use without written authorization.
Is the MLB Stats API free?
It is free to call and needs no key. MLB's notice limits use to individual, non-commercial, non-bulk purposes, so read it and ask MLB before building a product or a bulk download on it.
Where are the MLB Stats API docs?
MLB publishes none. The MLB-StatsAPI wiki on GitHub documents the endpoints and the Python wrapper around them. It is community work, not MLB's.
Where do I get Statcast data?
From Baseball Savant's Statcast search, which exports pitch-level CSV, or from pybaseball's statcast function, which reads it into a data frame. FastballAPI does not carry Statcast's measured exit velocity, launch angle or spin.
Where can I get free historical MLB play-by-play?
Retrosheet publishes play-by-play event files for all AL and NL seasons from 1908 to 2025, free to reuse with its credit line. FastballAPI covers pitch-by-pitch data from 2015 and plate appearances with RE24.
Does the MLB API have betting odds?
Not that we found in the Stats API, Savant or Retrosheet. FastballAPI keeps sportsbook lines: 4 to 13 books per game from 2015 to 2023, plus opening and closing lines from 6 to 8 books since July 2020.
Is pybaseball still maintained?
Its repository was last pushed on 2026-01-04, but its latest release, 2.2.6, is from 2023-09-08, and its README says releases may lag the repository. It reads other sites, so it can break when they change.
Can Claude or ChatGPT use FastballAPI?
Yes. FastballAPI runs an MCP server at mcp.fastballapi.com, so Claude, ChatGPT and Cursor can call the same tools as the REST API.
Sources
- MLB Stats API schedule endpoint
- MLBAM materials use notice
- toddrob99/MLB-StatsAPI
- Baseball Savant Statcast search
- pybaseball on GitHub
- Retrosheet
- Retrosheet use notice
- BALLDONTLIE pricing
Checked October 14, 2026.
See the data
Try it with 500 free credits every month
No card. REST or MCP.