MLB APIMLB pitch by pitch since 2015.
Pitch-by-pitch data with pitch type, velocity and location, counted against every box score, and every plate appearance with the base-out state and the batted ball; 2015 to 2017 are included too, with about 98 to 99% of each season's pitches. Box scores, standings and our own ratings and run values. Sportsbook lines from 4 to 13 books per game from 2015 to 2023, with opening and closing lines from 6 to 8 books per game since July 2020. Player prop lines, and odds refreshed every hour. Call it over REST or point Claude at it over MCP. You get 500 free credits every month and we do not ask for a card.
500 free credits every month, no card. Works in Claude, ChatGPT and Cursor: connect over MCP
- pitches
- 8.2M+
- games
- 28,000+
- players
- 4,300+
- seasons
- 12
Box scores, standings and our own ratings and run values. Sportsbook lines from 4 to 13 books per game from 2015 to 2023, with opening and closing lines from 6 to 8 books per game since July 2020. Player prop lines, and odds refreshed every hour. Call it over REST or point Claude at it over MCP. You get 500 free credits every month and we do not ask for a card.
Try it
One request, JSON back.
Copy the call, put your key in, run it. get_pitches costs 10 credits, and every account starts with 500 free credits every month, no card.
Request
curl -X POST https://mcp.fastballapi.com/v1/get_pitches \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"game_id": "401569531",
"limit": 3
}'Response
{
"pitches": [
{
"game_id": "401569531",
"at_bat_id": "4015695310001",
"pitch_number": 1,
"inning": 1,
"half": "top",
"pitcher_id": "41196",
"batter_id": "33712",
"balls": 0,
"strikes": 0,
"pitch_type": "FF",
"pitch_type_name": "Four-seam FB",
"velocity": 96,
"px": 152,
"py": 178,
"result": "strike-looking",
"in_play": false
},
{
"game_id": "401569531",
...First 22 lines. Full response and every field
Also in FastballAPI
The college baseball API
NCAA Division I baseball, every season since 2010: play-by-play, standings, sportsbook lines and season lines. Same key and credits as the MLB.
NCAA API: see the data- games
- 29,489
- plate appearances
- 498,239
- seasons
- 17
This week
What get_schedule returns right now.
Sample rows; the live page renders from the database. Lines are the favourite at the median price across sportsbooks.
| First pitch | Away | Home | Line | Total | Game id |
|---|---|---|---|---|---|
| Tue 7:05 PM ET | BOS | NYY | NYY -140 | 8.5 | 401570001 |
| Tue 10:10 PM ET | SD | LAD | LAD -165 | 8 | 401570002 |
get_schedule · 2 credits · then get_game for the box score and every book's line
Prop history
Every line a player has had, and how they did against it.
- Freddie FreemanLAD
- Matt OlsonATL
- Kyle SchwarberPHI
- Pete AlonsoBAL
- Manny MachadoSD
- William ContrerasMIL
- Gunnar HendersonBAL
- Nico HoernerCHC
- Shohei OhtaniLAD
- Corbin CarrollARI
- Vladimir Guerrero Jr.TOR
- Yandy DiazTB
- Salvador PerezKC
- Randy ArozarenaSEA
- Brice TurangMIL
- Ian HappCHC
- Teoscar HernandezLAD
- Bobby Witt Jr.KC
- Jose RamirezCLE
- Julio RodriguezSEA
- Steven KwanCLE
- Bryan ReynoldsPIT
- Bryson StottPHI
- Brandon NimmoTEX
Coverage
Coverage you can inspect before you build.
Every pitch of every final game since 2018, with type, velocity, location and count; pitch counts match the box score to within 0.05% a season. 2015 to 2017 are included too, with about 98 to 99% of each season's pitches.
A run value on every plate appearance, from each season's own run expectancy table.
Each sportsbook's moneyline, run line and total, 4 to 13 books per game from 2015 to 2023 (about 4 in 2015, 10 in 2016 and 2017, 7 to 8 in 2018 to 2020 and 12 in 2021 to 2023), and opening and closing lines from 6 to 8 books per game since July 2020.
| Dataset | Seasons | Volume | Status | Tools |
|---|---|---|---|---|
Games and box scores Line scores and every batter's and pitcher's line. | See the season table | Every game, every player | Full | |
Pitch-by-pitch Count, pitch type, velocity, location and result for every pitch. | See the season table | About 295 pitches per game | Full Pitch type and velocity are on 96% or more of each season's pitches, and 99.8% or more from 2020. Automatic balls and strikes are not pitches. | |
Plate appearances Base-out state, result, batted-ball trajectory and location, runs, RE24. | See the season table | About 76 per game | Full | |
Win probability Our model's home win probability after each plate appearance: inning, outs, runners and score, our team ratings and the two starters. | 2015 to current | After every plate appearance | Full | |
Odds Moneyline, run line and total by sportsbook; opening and closing lines from July 2020 (sportsbook odds archive), the final pregame line only in the earlier seasons. | 2015 to current | 4 to 13 books per game to 2023; 7 to 8 with opening and closing lines since 2021 | Partial The daily feed is mostly one book per game since 2024; the other books come from the sportsbook odds archive. Player props are separate (get_player_props, from May 2023). | |
Ratings Our Elo, before and after every game. | Every season loaded | Every team, every game | Full | |
College baseball NCAA Division I games with league=ncaabase: the tournament by round since 2010, scores since 2015, box scores and plate appearances (from the scorer's text) for part of each season since 2020, ratings, opening and closing lines from May 2023 (a median of 5 or 6 books a game). | 2010 to current | The Division I games we carry | Partial Not every Division I game, and box scores and play-by-play for part of each season only (the college page shows each season). No pitch rows or batted-ball locations. | |
Injury report Each listed player's status, injury and expected return, captured daily. | From launch | Daily | Partial Daily captures from launch; no history before that. |
Full detail in the data atlas. Sportsbooks: the books reported with each game: 4 to 13 books per game from 2015 to 2023, plus opening and closing lines from the sportsbook odds archive since July 2020 (a median of 7 books in 2021 to 2023, 8 since 2024). The daily feed is mostly one book since 2024; the sportsbook odds archive rows carry a median of 8.
Last written 2026-11-22 10:00 UTC. Every dataset's own refresh time is in the changelog.
Why trust it
Every pitch, reconciled with the box score.
Pitch-level baseball data is usually scraped and trusted. Here every season's pitches and plate appearances are counted against the box scores: from 2018 pitch counts match to within 0.05% a season, 2015 to 2017 hold 98 to 99% of their pitches, and the run values are computed from the same rows.
Every pitch: type, velocity, location and count
Each pitch with its type, velocity, location and the count it came in, and each ball in play with its trajectory and where it landed. A pitcher's arsenal is one call.
A run value on every plate appearance
Run expectancy for all 24 base-out states, rebuilt from each season's own plate appearances, and the run value of every plate appearance against it. Leaderboards that see context, not just outcomes.
Lines by sportsbook
Moneylines, run lines and totals from 4 to 13 books per game from 2015 to 2023, plus opening and closing lines from 6 to 8 books per game since July 2020, each book stored separately, with results against the median close.
Tools
Every tool, and what a call costs.
Every tool is one REST endpoint and one MCP tool with the same name, the same parameters, and a fixed credit cost. Empty results are not charged.
- get_gamesGames with runs, hits and errors by season, date, range or team
- get_scheduleUpcoming games with the median line across sportsbooks
- get_standingsStandings from every final game, with run differential and Pythagorean record
- get_injuriesThe latest injury report
- get_ratingsOur team Elo ratings, ranked
- get_gameOne game: every batting and pitching line, each book's line, win probability
- get_playerSeason batting (AVG, OBP, SLG, OPS, RE24) and pitching (ERA, WHIP, K/9)
- get_player_gamesA player's full batting and pitching game log
- get_leadersSeason leaders among qualified batters and pitchers
- get_team_statsRuns for and against, team batting and opponents' batting
- get_pitch_mixA pitcher's arsenal: usage, velocity, whiff rate per pitch type
- get_oddsEvery sportsbook's moneyline, run line and total for a game (5) or a day (10)
- get_plate_appearancesPlate-appearance play-by-play with base-out state, batted ball, win probability, RE24
- get_pitchesPitch-by-pitch: count, type, velocity, location, result
- get_spray_chartWhere a batter or team hits the ball, by trajectory and field
- get_player_propsPlayer prop lines by sportsbook: the closing line (one pre-game capture per line before October 2026)
- get_prop_historyA player's prop lines against the result, game by game
- get_alt_linesAlternate run lines and totals by sportsbook: every point on each book's ladder, opening and closing, from 2023
- get_line_movementSnapshots of each sportsbook's line before first pitch
- get_prop_movementHow one player's prop line moved before a game, every capture by sportsbook
- get_market_oddsOpening and closing lines by sportsbook for the first-5-innings and first-inning markets (from May 2023, each game added the morning after it is played)
Built for
Four jobs, and the endpoints that do them.
Every pitch and plate appearance, with context
Pitch type, velocity, location and count for every pitch; base-out state, batted ball and RE24 for every plate appearance.
Read more →Sportsbook lines next to every game
Moneyline, run line and total from 4 to 13 books per game from 2015 to 2023, with opening and closing lines from 6 to 8 books since July 2020, joined to the result, our ratings and the box score.
Read more →Baseball answers your assistant can call
23 endpoints over REST and MCP: schedules, box scores, standings, players, every pitch, every plate appearance, odds and ratings.
Read more →Guides
Working code for the questions people ask.
- get_pitches
Where do I get MLB pitch-by-pitch data for a model?
Every pitch a pitcher threw, with count, type, velocity, location and result, loaded into pandas with a swinging-strike label ready for a classifier.
Python, JavaScript, cURL → - get_pitch_mix
How do I get a pitcher's pitch mix and whiff rate in Python?
A pitcher's arsenal for a season: how often each pitch is thrown, how hard, and how often it draws a swing and a miss.
Python, JavaScript, cURL → - get_spray_chart
How do I build an MLB spray chart in Python?
Where a hitter puts the ball in play, by trajectory and field, plus the x and y of every ball in play if you want to draw it.
Python, JavaScript, cURL →
Integrations
In your AI assistant, your editor or your spreadsheet.
All integrationsAccess
REST or MCP. Same data either way.
Call it from any language over REST. Let Claude or Cursor query it in plain English over MCP.
- GET https://mcp.fastballapi.com/v1/tools public catalogue with JSON Schema
- GET https://mcp.fastballapi.com/openapi.json OpenAPI 3.1 spec
- POST https://mcp.fastballapi.com/v1/{tool}
- MCP https://mcp.fastballapi.com/mcp
curl -X POST https://mcp.fastballapi.com/v1/list_teams \
-H "x-api-key: YOUR_API_KEY"
# every tool: POST /v1/{tool} with a JSON body
# responses carry X-Credits-Used and X-Credits-RemainingPricing
Free to start, then you pay per call.
500 credits every month, no card. Subscriptions add a monthly allowance; wallet top-ups do not expire while your account is open.
- +All 23 endpoints
- +REST API + MCP access
- +No credit card required
- +10,000 credits/month
- +All 23 endpoints
- +Email support
- +Overage at wallet rates
- +30,000 credits/month
- +All 23 endpoints
- +Priority support
- +Overage at wallet rates
- +125,000 credits/month
- +All 23 endpoints
- +Dedicated support
- +Volume rates available
Full breakdown, credit costs per tool, and FAQ on the pricing page.
Questions
The things people ask before signing up.
Is FastballAPI free?
Every account gets 500 credits every month and no card. Calls cost 1 to 10 credits depending on the endpoint, so 500 is a few hundred real requests. Paid plans start at $19/mo for 10,000 credits a month, and wallet top-ups do not expire while your account is open.
How far back does the data go?
Every MLB game since 2018 has every pitch, every plate appearance and both box scores; 2015 to 2017 are included too, with about 98 to 99% of each season's pitches. Win probability starts in 2019. Sportsbook lines carry 4 to 13 books per game from 2015 to 2023 (about 4 in 2015, 10 in 2016 and 2017, 7 to 8 in 2018 to 2020 and 12 in 2021 to 2023), then usually one in the daily feed; since July 2020 the sportsbook odds archive adds opening and closing lines from 6 to 8 books per game. The coverage page shows exactly which seasons are loaded.
What is MCP, and do I need it?
MCP is the protocol Claude, Cursor and similar assistants use to call tools. Point one at https://mcp.fastballapi.com/mcp with your key and it picks the endpoint and reads the response itself, no client code. If you are writing an application instead, ignore MCP and use the REST endpoints; they are the same 23 tools.
Can I use this commercially?
Yes, inside your own product or model, within the terms. Reselling the data itself as a feed is not permitted. FastballAPI is independent and not affiliated with MLB or any club.
How current is it?
Odds refresh every hour for games in the next four days. Everything else updates once a day, early morning US Eastern (10:00 UTC): scores, box scores and every pitch of the previous day's games, the next week's schedule, the day's lines, the injury report, run values and ratings. There is no live pitch-by-pitch feed.
Where do the stats come from?
Games, box scores, every pitch and plate appearance, win probability and injuries from public data; sportsbook lines are captured from the books that post them. Batting rates, run expectancy and RE24, standings with Pythagorean records and team Elo are computed here from those rows. Nothing is licensed from another analytics provider.
What are the rate limits?
60 requests a minute, dropping to 10 if your credit balance falls below 100. The limit is the same on every plan: credits, not requests, are the spend boundary.
Before you write another scraper
Start with 500 free credits every month, no card.
FastballAPI · The baseball data API.