Historical Baseball

v0.2.1
io.github.pipeworx-io/historical-baseball Checked 1 hour ago Published 29 days ago

historical-baseball -- MLB history from Retrosheet game logs and the SABR Lahman Baseball Database…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

baseball_player_history

Year-by-year MLB batting and/or pitching statistics for one player's whole career, from the SABR Lahman Baseball Database (1871-2025). Pass a player NAME ("Babe Ruth", "Walter Johnson") or an exact Lahman player_id (e.g. "ruthba01") -- a name is resolved by exact then fuzzy match; if more than one player matches, a list of candidates (with player_id, birth year, debut) is returned instead of a guess, so the caller can re-ask with the exact player_id. Returns every season the player appears in Batting.csv and/or Pitching.csv (most players have only one; a few, like Babe Ruth, have both). Each s…

ParameterTypeDescription
player *stringPlayer name ("Hank Aaron") or exact Lahman player_id ("aaronha01").

baseball_team_season

One MLB team's full-season record and stats for one year, from the SABR Lahman Baseball Database (1871-2025): wins/losses, division/league/World Series result, runs scored and allowed, team batting and pitching totals, home park and attendance. Pass team as a 3-letter-ish code ("NYA", "BOS") or a common name ("Yankees", "Red Sox", "Dodgers") -- codes changed for some relocated/renamed franchises over the years (e.g. the Athletics' code changed for 2025), so an unrecognized code for that year is refused with a clear error rather than an empty success; try the franchise's name instead, or call w…

ParameterTypeDescription
team *stringTeam code ("LAN") or common name ("Dodgers").
year *numberSeason year, e.g. 1927.

baseball_game_log

Box-score-level summary of MLB game(s) played by one team on one date, from Retrosheet game logs (1871-2025): final score, game length, day/night, park, attendance, winning/losing/saving pitcher, managers, and each side's at-bats/hits/doubles/triples/homers/RBI/walks/strikeouts/errors. Covers regular season plus All-Star, Division Series, League Championship Series, Wild Card and World Series games (see game_type in the response: R/A/D/L/C/W). Pass date as "YYYY-MM-DD" or "YYYYMMDD" and team as a code ("NYA") or common name ("Yankees"). Returns an array because doubleheaders are two games on o…

ParameterTypeDescription
date *stringGame date, "YYYY-MM-DD" or "YYYYMMDD".
team *stringTeam code ("BOS") or common name ("Red Sox").

baseball_season_leaders

Top players in one MLB season for one statistic, from the SABR Lahman Baseball Database. Batting stats: HR, AVG, RBI, R, H, SB, BB, SO, 2B, 3B (AVG = hits/at-bats, qualified at a simple AB>=100 floor -- NOT MLB's official plate-appearance qualifying rule, so this can include players who would not qualify for an official batting title). Pitching stats: W, ERA, SO_P, SV, L, WHIP (SO_P = pitcher strikeouts, to avoid colliding with batting SO; ERA and WHIP are qualified at a simple IPouts>=100 i.e. ~33 innings floor, also not the official rule). Pass stat exactly as listed (case-sensitive). Option…

ParameterTypeDescription
stat *stringOne of: HR, AVG, RBI, R, H, SB, BB, SO, 2B, 3B, W, ERA, SO_P, SV, L, WHIP.
year *numberSeason year, e.g. 1998.
leaguestringOptional: scope to one league code ("AL", "NL", or an historical league code).
limitnumberMax rows to return, 1-50. Default 10.

baseball_coverage

What this pack actually has loaded right now: the Retrosheet game-log date range, how many games, the latest Lahman season year, and when it was last loaded. Call this if a query for a date or year you expect to exist comes back not-found, to rule out a coverage gap before assuming a typo.