FastballAPI

v1.1.6
io.github.noahowsh/fastballapi Checked 8 hours ago Published 1 month ago

MLB since 2015 plus college: pitches, plate appearances, box scores, odds by book.

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

list_teams List teams

Use to find team ids and abbreviations for a season (default: the latest). Every other tool takes a team as an id or abbreviation. Costs 1 credit.

ParameterTypeDescription
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).

get_games Games

Use to list games with runs, hits and errors by season, date, date range or team, newest first. For upcoming games with lines use get_schedule; for one game's box score use get_game. Costs 2 credits.

ParameterTypeDescription
datestringOne date, YYYY-MM-DD (US Eastern).
fromstringFrom date, YYYY-MM-DD.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
limitintegerMax games (default 50).
offsetinteger
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).
season_typestringregular or postseason (default both).
statusstring
teamstringTeam id or abbreviation.
tostringTo date, YYYY-MM-DD.

get_schedule Schedule

Use for upcoming games (next 1-30 days, default 7) with the median line across posted sportsbooks: moneylines, run line and total. For every book's line use get_odds. Costs 2 credits. Prices are market information; no tool places, accepts or tracks wagers.

ParameterTypeDescription
daysinteger
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
teamstringTeam id or abbreviation.

get_game Game

Use for one game in full: line score, every batter's and pitcher's line, each sportsbook's opening and closing line, and the win-probability range. For every plate appearance use get_plate_appearances. Costs 5 credits. Prices are market information; no tool places, accepts or tracks wagers.

ParameterTypeDescription
game_id *stringGame id, from get_games or get_schedule.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.

get_standings Standings

Use for a season's regular-season standings computed from every final game: record, home and away, last 10, runs scored and allowed, run differential and Pythagorean win percentage. Costs 2 credits.

ParameterTypeDescription
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).

get_injuries Injuries

Use for the injury report: every listed player's status, injury and expected return, as captured on the latest day (or the latest on or before date). Costs 2 credits.

ParameterTypeDescription
datestringYYYY-MM-DD (default: the latest).
teamstring

search_players Search players

Use to find a player's id by name (partial names work). Costs 1 credit.

ParameterTypeDescription
name *stringFull or partial name.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
limitinteger

get_player Player

Use for a player's season-by-season batting (AVG, OBP, SLG, OPS, HR, K%, BB%, RE24, from every plate appearance) and pitching (ERA, WHIP, K/9, BB/9). Costs 5 credits.

ParameterTypeDescription
player_id *stringPlayer id, from search_players.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.

get_player_games Player games

Use for a player's game log: every game's batting line and pitching line, newest first, optionally one season. Costs 5 credits.

ParameterTypeDescription
player_id *string
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
limitinteger
offsetinteger
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).
season_typestring

get_leaders Leaders

Use for a season's leaders among qualified players: batting avg, obp, slg, ops, hr, re24, bb_pct, k_pct (3.1 plate appearances per team game) or pitching era, whip, so, k_per_9, bb_per_9 (1 inning per team game). Costs 5 credits.

ParameterTypeDescription
stat *string
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
limitinteger
min_ipintegerOverride the innings minimum.
min_paintegerOverride the plate-appearance minimum.
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).

get_team_stats Team stats

Use for team offence and run prevention for a season: runs per game for and against, run differential, and batting and opponents' batting (AVG, OBP, SLG, OPS, K%, BB%, HR) from every plate appearance. Costs 5 credits.

ParameterTypeDescription
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
seasonnumber | stringSeason (a year, e.g. 2025; default: the latest).
teamstring

get_plate_appearances Plate appearances

Use for plate-appearance play-by-play: a whole game in order, or a batter's, pitcher's or team's season, with the base-out state before, the result, the batted ball (trajectory and location), runs, the home win probability after (our model, every plate appearance since 2015) and our run value (RE24). Filter by result, inning or runners in scoring position. Costs 10 credits.

ParameterTypeDescription
batter_idstring
game_idstring
inninginteger
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
limitintegerMax rows (default 200).
offsetinteger
pitcher_idstring
resultstringe.g. home-run, strikeout, walk, single, double, ground-out.
rispbooleanRunners in scoring position only.
seasonnumber | stringSeason (a year; default: the latest; ignored with game_id).
season_typestring
teamstringBatting team (id or abbreviation).

get_pitches Pitches

Use for pitch-by-pitch data: every pitch of a game, or a pitcher's or batter's season, with the count, pitch type, velocity, location and result. Velocity is whole mph as published, cut down rather than rounded (95.8 reads 95), so averages run about half a mile per hour under the published one-decimal figures. Costs 10 credits.

ParameterTypeDescription
batter_idstring
game_idstring
limitintegerMax pitches (default 500).
offsetinteger
pitch_typestringPitch type code, e.g. FF, SL, CH, CU, SI, FC.
pitcher_idstring
seasonnumber | stringSeason (a year; default: the latest; ignored with game_id).

get_pitch_mix Pitch mix

Use for a pitcher's arsenal in a season: each pitch type's usage, average and top velocity, whiff rate per swing and ball rate. Velocities come from whole-mph readings cut down rather than rounded, so the averages run about half a mile per hour under the published one-decimal figures. Costs 5 credits.

ParameterTypeDescription
pitcher_id *stringPlayer id.
seasonnumber | stringSeason (a year; default: the latest; ignored with game_id).
season_typestringregular, postseason, or all (default): which games' pitches.

get_spray_chart Spray chart

Use for where a batter or team hits the ball: balls in play by trajectory (ground ball, line drive, fly ball, pop-up) and by field (left, center, right), with hit rates; include_balls adds each ball's location for drawing. Counts the regular season and postseason together unless season_type says otherwise (get_player's batting line is the regular season alone). Costs 10 credits.

ParameterTypeDescription
batter_idstring
include_ballsbooleanAdd each ball in play's x/y (up to 3,000).
seasonnumber | stringSeason (a year; default: the latest; ignored with game_id).
season_typestringregular, postseason, or all (default): which games' balls in play to count.
teamstring

get_odds Odds

Use for betting lines: each sportsbook's moneyline, run line and total for a game (opening and closing per book from July 2020; before that, each book's final pregame line only), with implied probabilities and, for finished games, whether the favourite won and the total went over against the median close. Pass game_id for one game (5 credits) or date for a day's games (10 credits). Prices are market information; no tool places, accepts or tracks wagers.

ParameterTypeDescription
datestringA day's games, YYYY-MM-DD (US Eastern).
game_idstring
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.

get_line_movement Line movement

Use to see how a game's line moved before first pitch: our pre-game snapshots of each sportsbook's moneyline, run line and total (captured once a day, and every hour for games in the next four days). Costs 10 credits. Prices are market information; no tool places, accepts or tracks wagers.

ParameterTypeDescription
game_id *string
all_snapshotsbooleanEvery hourly capture. By default a capture identical to the one before it is left out (the latest is always kept), which keeps every move and its time.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
providerstringOne sportsbook, e.g. DraftKings.

get_ratings Ratings

Use for our team power ratings (Elo from every final game in our data), ranked, as of the end of a season or today. Costs 2 credits.

ParameterTypeDescription
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
seasonnumber | string

get_player_props Player props

Use for player prop lines by sportsbook: over/under on hits, home runs, total bases, RBI, pitcher strikeouts and pitcher outs, from May 2023 (DraftKings, FanDuel, BetMGM, ESPN BET, Pinnacle and others). Pass game_id for every player's props in one game, or player_id with from_date (and to_date) for one player across games (up to 100). A game costs 10 credits before it starts and 20 once it has (accounts opened before October 30 2026 pay 10 for every game). Returns the closing line by default (the last before the game starts) or the opening line, with each book's over and under prices. Each row…

ParameterTypeDescription
bookmakerstringBookmaker key, e.g. draftkings, fanduel, pinnacle.
estimate_onlybooleanReturn what this call would cost, without charging or running it.
from_datestringWith player_id: first date, YYYY-MM-DD (the game's date).
game_idstringGame id: every player's props for that game.
marketstringOne market: batter_hits (hits), batter_home_runs (home runs), batter_total_bases (total bases), batter_rbis (runs batted in), pitcher_strikeouts (pitcher strikeouts), pitcher_outs (pitcher outs record…
player_idstringPlayer id (e.g. 33192) from search_players. With from_date: that player's props across games.
snapshot_typestringclosing (default): the last line before the game starts. opening: the first one captured, which is the same capture as the close wherever only one was taken.
to_datestringWith player_id: last date (default: no end), YYYY-MM-DD (the game's date).

get_prop_history Prop history

Use to see how a player did against his prop line over time: for one market (hits, home runs, total bases, RBI, pitcher strikeouts or pitcher outs), one row per game with the closing line (the median across books, or one book's), the opening line (the same as the close wherever only one capture was taken), the prices, what the player actually recorded from our box scores and the result against the line, plus the over rate, up to 200 games a call. Costs 10 credits for every 25 games already played that a call covers, and at least 10 a call (accounts opened before November 1 2026 pay 10 a call).…

ParameterTypeDescription
market *stringThe market: batter_hits (hits), batter_home_runs (home runs), batter_total_bases (total bases), batter_rbis (runs batted in), pitcher_strikeouts (pitcher strikeouts), pitcher_outs (pitcher outs record…
player_id *stringPlayer id (e.g. 33192) from search_players.
bookmakerstringOne book's closing line instead of the median across books, e.g. draftkings.
estimate_onlybooleanReturn what this call would cost, without charging or running it.
from_datestringFirst date, YYYY-MM-DD (the game's date).
limitintegerGames to return, oldest first (default 50, max 200). next_from_date says where to continue.
to_datestringLast date, YYYY-MM-DD (the game's date).

get_prop_movement Prop movement

Use to see how one player's prop line moved before a game: every capture we hold, book by book and oldest first, with the line, both prices and the minutes before the start. line_change is the last capture's line minus the first's. The number of captures varies by game and book. Costs 10 credits. Prices are market information; no tool places, accepts or tracks wagers.

ParameterTypeDescription
game_id *stringGame id.
market *stringThe market: batter_hits (hits), batter_home_runs (home runs), batter_total_bases (total bases), batter_rbis (runs batted in), pitcher_strikeouts (pitcher strikeouts), pitcher_outs (pitcher outs record…
player_id *stringPlayer id (e.g. 33192) from search_players.
bookmakerstringOne book's captures, e.g. draftkings.

get_market_odds Market odds

Use for the extra betting markets of a game as history: the first 5 innings winner, run line and total, and the 1st inning total and three-way result (the 1st inning total at 0.5 is the no-run-first-inning market). Pass game_id (from get_games or get_schedule) and market. For each sportsbook it returns the opening line (the first one we captured) and the closing line (the last one before the game started), each as the list of outcomes with their point and American price, plus captured_at and minutes_before_start (negative when the last capture came after our scheduled start, which the sportsbo…

ParameterTypeDescription
game_id *stringGame id from get_games or get_schedule.
market *stringThe market: h2h_1st_5_innings (first 5 innings winner), totals_1st_5_innings (first 5 innings total runs), spreads_1st_5_innings (first 5 innings run line), totals_1st_1_innings (1st inning total runs…
bookmakerstringOne bookmaker key, e.g. draftkings, fanduel, pinnacle.
estimate_onlybooleanReturn what this call would cost, without charging or running it.

get_alt_lines Alt lines

Use for alternate run lines and totals by sportsbook: every point on each book's ladder with its price (e.g. -2.5 at +190, over 9.5 at +140), for one game. Held for MLB games from the 2023 season on, from five books (DraftKings, FanDuel, BetMGM, Bovada, Pinnacle). Games before Nov 12 2026 were captured once shortly before first pitch, so their opening and closing ladders are the same; from Nov 12 2026 upcoming games are captured up to three times a day before the start. Games not yet priced have none. Returns each book's closing ladder by default (its last before the start) or its opening one.…

ParameterTypeDescription
game_id *stringGame id, e.g. 776512 (from get_games or get_schedule).
bookmakerstringOne bookmaker key, e.g. draftkings, fanduel.
leaguestringLeague. Defaults to mlb. One of: mlb, ncaabase.
marketstringOne market (default both).
snapshot_typestringClosing (default) or opening ladder.