bAIseball

Ask a plain-English question about MLB history. Get your answer in a data table in seconds.

About this app

bAIseball turns a plain-English baseball stats question into a data table. Type a question, and Claude (Anthropic's LLM) translates it into a SQL query against a Postgres database, runs it, and shows you the result — along with the generated SQL, so you can see exactly how it got its answer.

Here are some example questions to get you started:

The database is seeded from three sources:

  • Retrosheet Game Logs — one row per game, 1871–2025, including per-inning scoring.
  • Retrosheet player-per-game stats — one row per player per game (batting/pitching/fielding), 1898–2025.
  • The Lahman Baseball Database — player-season and team-season aggregates, 1871–2025.

Pitch-by-pitch/Statcast data is intentionally out of scope, so questions that need pitch-level detail (spin rate, exit velocity, etc.) won't be answerable here (for now!).

Data Coverage

What's available depends on the grain of data you're asking about:

Team-season
Wins, losses, runs scored/allowed, hits, home runs, ERA, attendance, park factors, and division/league/World Series results — one row per team per year, 1871–2025.
Player-season
Batting, pitching, and fielding totals for a full season (one row per player/team/stint) — e.g. season home runs, ERA, putouts. Also covers postseason season-totals, All-Star selections, awards, Hall of Fame voting, and player bio info (birth/death, bats/throws, height/weight, debut date), 1871–2025.
Game
One row per game, 1871–2025: final score and inning-by-inning line score, team totals (hits, errors, walks, left on base), starting/winning/losing/save pitchers, park, attendance, day/night. Covers regular season, All-Star, and postseason (division series, LCS, wild card, World Series) games.
Player-per-game
One row per player per game, 1898–2025: a batting line (AB, H, 2B, 3B, HR, RBI, BB, SO, SB, CS, …), pitching line (IP, H, R, ER, BB, SO, decision), or fielding line (PO, A, E, DP) for that game. This is the finest grain available — so you can ask whether a player hit a home run in a given game, but not which inning it happened in, the count, or any other play-by-play/pitch-level detail.

Leagues: the modern NL (since 1876) and AL (since 1901), plus defunct 19th/20th-century major leagues (American Association, Union Association, Players' League, Federal League). The Lahman database also includes Negro Leagues player-season stats (1920–1948, recognized as major leagues by MLB in 2020), but Retrosheet's game-by-game data does not cover the Negro Leagues.

FAQ

bAIseball? Really?
Look, I'm not good at naming things. I'm like Nomar Garciaparra's parents.
baiseball.org? Are you a nonprofit?
Nope, I just noticed baiseball.com was already taken and didn't really think through the fact that baiser has a meaning in French that's, shall we say, meaningfully unrelated to sports.
Why did you create this?

On Thursday, August 6, 2026, the Red Sox came from behind in the bottom of the 9th inning to tie the White Sox 7-7. They then proceeded to score again in the 10th, 11th, and 12th innings, before finally walking off in the bottom of the 13th for a 12-11 win.

When I read the MLB.com recap immediately following this insane game, two incredible stats jumped out at me:

  • "The Red Sox are just the fourth team to go 26-3 or better in a 29-game span within a season in the past 70 years, and the first since Cleveland in 2017."
  • "The Sox became the first team in MLB's modern era to score in five separate innings in the ninth or later in the same game."

How did they find those stats so quickly, I wondered? I promptly signed up for a promotional subscription to Stathead. After some trial and error and with an assist from a very friendly Baseball Reference brand ambassador, I managed to use Stathead to pull that first anecdote from the MLB.com piece, but couldn't figure out any reasonable way of verifying the second one.

I'd known for a long time about the Sean Lahman database, Retrosheet, and related baseball statistical resources. But the prospect of spending hours navigating table structures, identifying foreign keys, and mapping player identities across multiple source datasets, only to spend even more time trying to figure out how to construct the right SQL query, seemed like a very high bar to clear just so I could spot-check a single sentence in a baseball recap article.

This got me thinking: what if I just put all the data in one place and asked AI to figure out the SQL? And voilĂ : Welcome to bAIseball.

Wait, but I just tried asking both of your questions from MLB.com and neither answer included the 2026 Red Sox.
This is because my primary data sources (the Sean Lahman database and Retrosheet) update at the end of the season, so my data goes through 2025 at the moment. That said, I'm working on getting up-to-date data from the current season into the app soon. Stay tuned!
Isn't this just a thin AI wrapper on top of decades of painstaking baseball aficionados' work?
How dare y -- OK, yes. In all seriousness, there would be no bAIseball without Sean Lahman, the fine folks at Retrosheet, and a host of others -- like Bill James (the George Washington of sabermetrics), or Sean Forman and his merry band of experts at baseball-reference.com -- who put in countless hours finding, compiling, and making freely available a truly astonishing array of baseball statistics. This site stands on the shoulders of giants.
Ha! I found an error, you numbskull.
It's probably my fault somehow. But this is why I provide the raw SQL queries here too: it makes it easy to check whether the AI wrote bad SQL or if something is up with the underlying data itself (less likely). Let me know if you see anything off!