Mlb APIbaseballsavant.mlb.com ↗
Access MLB Statcast batting and pitching leaderboards via API. Barrel rate, exit velocity, xwOBA, whiff%, pitch mix, and per-player metrics from Baseball Savant.
What is the Mlb API?
This API exposes 4 endpoints covering MLB Statcast batting and pitching data from Baseball Savant, returning over 30 distinct metric fields per player. get_batting_leaderboard retrieves league-wide batter rankings sortable by any Statcast field — xwOBA, barrel rate, hard-hit percentage, swing speed — while get_player_power_stats and get_pitcher_stats return deep per-player breakdowns including expected stats (xBA, xSLG, xwOBA) and full pitch mix data.
curl -X GET 'https://api.parse.bot/scraper/50ea5f20-7d11-4dc2-8879-d61e60e9c422/get_batting_leaderboard?sort=home_run&year=2025&limit=20&min_pa=100&sort_dir=asc' \ -H 'X-API-Key: $PARSE_API_KEY'
Retrieve the Statcast custom batting leaderboard with power, plate discipline, and expected stats. Returns batters meeting the minimum plate-appearance filter, sorted by the specified stat field. Includes barrel rate, exit velocity, hard-hit percentage, swing speed, whiff%, expected stats (xwOBA, xSLG, xBA, xwOBAcon), and batted ball profile. One page of results; use limit to control count. An empty players array is the site's own 'No Data Found' state for that filter combination; as of this revision the site returns no rows for the Qualified ('q') minimum on any season, while numeric minimums return data.
| Param | Type | Description |
|---|---|---|
| sort | string | Stat field to sort the leaderboard by. |
| year | string | MLB season year (4-digit, e.g. 2025, 2024, 2023). |
| limit | integer | Maximum number of players to return. |
| min_pa | string | Minimum plate appearances filter. 'q' means qualified (league-defined threshold); the site currently returns no rows for 'q', so pass a numeric minimum for populated results. |
| sort_dir | string | Sort direction. |
{
"type": "object",
"fields": {
"sort": "string sort field used",
"year": "string season year",
"total": "integer count of returned players",
"min_pa": "string minimum PA filter used",
"players": "array of batter stat objects with power, discipline, and expected metrics",
"sort_dir": "string sort direction used"
}
}About the Mlb API
Batting Endpoints
get_batting_leaderboard returns an array of batter stat objects filtered by year, min_pa (use 'q' for qualified hitters or a numeric threshold), and sorted by any sort field such as xwoba, barrel_batted_rate, hard_hit_percent, or whiff_percent. The response includes total (count of returned players) alongside per-player fields covering plate discipline (k_percent, bb_percent, swing_percent), batted ball quality (sweet_spot_percent, barrel, hard_hit_percent), swing speed (avg_best_speed, avg_hyper_speed), and expected outcome stats. get_player_power_stats narrows to a single batter by numeric player_id (e.g. 660271 for Shohei Ohtani), returning counting stats (ab, pa, walk, barrel, double) alongside rate stats (xba, xslg, xwoba, woba) for the specified year. The player must have at least 10 batted ball events.
Pitching Endpoints
get_pitching_leaderboard mirrors the batting leaderboard for pitchers, adding pitch mix columns — usage percentage, average velocity, and average spin rate for up to nine pitch types (4-seam, sinker, slider, curveball, changeup, cutter, splitter, sweeper, slurve). Filter with min_ip ('q' for qualified, or a numeric batter-faced count) and sort ascending by default since lower xwoba indicates better performance. get_pitcher_stats fetches a single pitcher by player_id and returns xera, p_era, xba, xslg, xwoba, woba, wobacon, p_walk, and batters-faced pa for the requested season.
Coverage and Parameters
All four endpoints accept a year parameter (4-digit season year, e.g. 2024, 2023). Leaderboard endpoints also accept a limit integer to cap the result set. Player ID values are numeric MLB IDs obtainable from the leaderboard responses — the player_id field in each player object maps directly to the required input for the player-level endpoints. Data reflects official MLB Statcast tracking and is scoped to regular-season performance.
The Mlb API is a managed, monitored endpoint for baseballsavant.mlb.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when baseballsavant.mlb.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official baseballsavant.mlb.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a barrel-rate leaderboard sorted by
barrel_batted_rateto rank power hitters for a fantasy baseball tool. - Compare a batter's
xwobavswobato identify hitters whose outcomes are over- or under-performing their expected stats. - Pull
avg_best_speedandavg_hyper_speedfor all qualified batters to model swing speed trends across seasons. - Retrieve full pitch mix data from
get_pitching_leaderboardto analyze arsenal composition for any qualifying starter. - Track year-over-year
xeraandp_eradivergence for a specific pitcher usingget_pitcher_statsacross multipleyearcalls. - Filter
get_batting_leaderboardbymin_pathreshold to study plate discipline stats (k_percent,bb_percent,whiff_percent) for semi-regular players. - Combine
hard_hit_percentandsweet_spot_percentfrom batting endpoints to build a batted ball quality index for scouting reports.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 200 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
| Team | $300/mo | 20,000 | 300 req/min |
| Company | $1,000/mo | 100,000 | 500 req/min |
Each endpoint has a fixed posted price per successful call — most fall between 1 and 10 credits — shown on this API's page before you run it. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does Baseball Savant have an official developer API?+
What does get_pitcher_stats return beyond ERA and xERA?+
get_pitcher_stats returns xwoba, woba, wobacon (wOBA on contact), xba, xslg, p_walk, and total batters faced (pa) for the specified pitcher and season. It does not include raw pitch-by-pitch data, but the pitch mix summary (usage, velocity, spin by pitch type) is available from get_pitching_leaderboard for qualifying pitchers.What is the minimum data threshold for player-level endpoints?+
get_player_power_stats requires at least 10 batted ball events for a player to appear. For leaderboard endpoints, setting min_pa or min_ip to 'q' applies the standard MLB qualification threshold for the season; numeric values let you lower that floor to include bench players or spot starters.