Guides
Baseball data, one question at a time
Working Python, JavaScript and cURL for common baseball data questions, each run against the live API with the real response shown.
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.
get_pitches · 10 credits
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.
get_pitch_mix · 5 credits
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.
get_spray_chart · 10 credits
How do I find MLB teams that over- or underperformed their run differential?
Standings from every final game, with run differential and the Pythagorean win percentage, so you can see who won more or fewer games than their runs say.
get_standings · 2 credits
How do I measure a hitter's run value with runners in scoring position?
Every plate appearance with a runner on second or third, with the base-out state before it, the result, and the run value it added or cost.
get_plate_appearances · 10 credits
How do I backtest MLB closing moneylines and run totals in Python?
A day of games with each sportsbook's opening and closing moneyline, run line and total, next to the result. It counts favourite wins and overs.
get_odds · 5 credits
How do I get MLB pitcher strikeout prop lines and results?
One row per start with the strikeout line at open and close, the over and under prices and the strikeouts he recorded. Tarik Skubal went over in 12 of 25.
get_prop_history · 10 credits
How do I get MLB scores and the schedule in Python?
MLB results for a date range with runs by team and the winner. Eight postseason games were final from October 6 to 10.
get_games · 2 credits
How do I get MLB home run leaders and stat leaders in Python?
MLB home run leaders for 2026 among qualified hitters, with batting line and strikeout rate. Kyle Schwarber and Pete Crow-Armstrong tied at 45.
get_leaders · 5 credits
How do I get the MLB injury report in Python?
The MLB injury report as of November 18: 148 listed players with status, injury and expected return, 145 of them Out.
get_injuries · 2 credits
How often does an MLB hitter go over his total bases line?
One row per game with a hitter's total bases line, the price, what he recorded and the result. Aaron Judge went over 1.5 in 27 of 63 graded games in 2026.
get_prop_history · 10 credits
How often does an MLB slugger hit a home run when it is priced?
Every game's home run price for a hitter against whether he went deep. Shohei Ohtani homered in 28 of 138 graded games in 2026, usually priced +150 to +300.
get_prop_history · 10 credits
How often does an MLB hitter go over his hits line?
One row per game with a hitter's hits line, the price and his hits. Bobby Witt Jr. went over in 48 of 135 graded games in 2026, with the line set at 0.5 or 1.5.
get_prop_history · 10 credits
How do I get first five innings MLB odds history in Python?
Each sportsbook's opening and closing total for the first 5 innings of a game, from May 2023, for the larger books.
get_market_odds · 10 credits
How do I get NRFI odds history in Python?
Each sportsbook's opening and closing 1st inning total for a game. Under the 0.5 line is no run in the first inning (NRFI), over is a run.
get_market_odds · 10 credits