FastballAPI

io.github.noahowsh由 GitHub 帳號 noahowsh 發布v1.1.6更新於 Nov 6, 2026

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

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取金融資料與分析

概覽

AI 產生的概覽

託管式棒球資料 MCP 伺服器,讓助理查詢 MLB 與大學棒球統計、逐球資料、賠率和球員盤口,以點數計費。

可以做什麼
  • 查詢球隊、球員、比賽、賽程、排名、傷兵和球隊評分
  • 讀取比賽紀錄、賽季數據、球員逐場紀錄、排行榜和球隊攻守數據
  • 取得逐球與逐打席資料、球種組合和擊球落點圖
  • 檢索各博彩公司的勝負盤、讓分盤、大小分、盤口變化與球員盤口及結果
適用情境
適合讓助理依據真實資料回答棒球問題:球員與球隊表現、逐球分析、歷史賠率,或某球員對盤口的歷史表現。面向資料分析、夢幻體育與賠率研究情境,而非一般網路查詢。
執行需求
遠端 Streamable HTTP 端點,無需安裝。呼叫工具需要 FastballAPI API 金鑰,透過 x-api-key 標頭(或金鑰查詢參數、bearer 權杖)傳送。每月有 500 點免費額度,另有付費方案與加值。也可用 Node.js 在本機執行,需設定 FASTBALLAPI_API_KEY。
安裝前請注意
每次工具呼叫都會消耗點數,單次 1 至 10 點,可能用盡免費額度或付費餘額。API 金鑰屬機密,不應外流。賠率與盤口資料僅為市場資訊,伺服器自身說明禁止計算投注金額、賠付或收益,禁止推薦投注或引導使用者前往博彩網站。資料來自第三方,與 MLB 及 NCAA 無關聯。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 FastballAPI,將其新增到工作區。
  2. 連接 x-api-key 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.noahowsh%2Ffastballapi/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "fastballapi": {
      "type": "http",
      "url": "https://mcp.fastballapi.com/mcp",
      "headers": {
        "x-api-key": "<YOUR_API_KEY>"
      }
    }
  }
}

README

FastballAPI MCP server

[Smithery] [MCP Registry]

The baseball data API. Pitch-by-pitch data with pitch type, velocity and location, every plate appearance with base-out state and the batted ball, box scores, standings, our own ratings and run values, sportsbook lines by book and MLB player prop lines. MLB since 2015 plus the NCAA Division I games we cover. REST API and MCP server. 500 free credits every month, no card.

Website: https://fastballapi.com · Docs: https://fastballapi.com/docs · Get a key: https://fastballapi.com/signup

You:    "What is Gerrit Cole's whiff rate by pitch type this season?"Claude: [calls get_pitch_mix]
You:    "How often did Aaron Judge homer on a 3-2 count in 2025?"Claude: [calls get_plate_appearances]
You:    "How often has Shohei Ohtani gone over his total bases line since 2023?"Claude: [calls get_prop_history]

Run it locally (stdio)

Most clients connect to https://mcp.fastballapi.com/mcp directly. For a client that launches a local process instead:

bash
git clone https://github.com/noahowsh/fastballapi-mcp.git && cd fastballapi-mcp && npm installFASTBALLAPI_API_KEY=your_key node index.js
json
{ "mcpServers": { "fastballapi": { "command": "node", "args": ["/path/to/fastballapi-mcp/index.js"], "env": { "FASTBALLAPI_API_KEY": "your_key" } } } }

It forwards to the hosted server with your key, so every tool and credit cost is the same.

Skills

This repo also ships 16 free Claude skills in skills/ that turn Claude into a baseball analyst: pitch mix and whiff rate, run value, spray charts, Pythagorean record, game previews, odds analysis, prop modeling (pitcher strikeouts, hits, total bases), edge detection and backtesting. Each skill names the FastballAPI tools it calls and what they cost.

bash
git clone https://github.com/noahowsh/fastballapi-mcp.git

Or install them as a Claude Code plugin:

/plugin marketplace add noahowsh/fastballapi-mcp/plugin install fastballapi-skills@fastballapi

Or with the skills CLI: npx skills add noahowsh/fastballapi-mcp.

Point Claude at the skills/ folder, connect the MCP server below, and ask. The dispatch skill routes a request to the right two or three skills. Full list: skills/README.md.

Python

The official Python client is on PyPI: fastballapi.

bash
pip install fastballapiexport FASTBALLAPI_API_KEY=sk_live_...
python
from fastballapi import Client, to_dataframe
client = Client()
props = client.get_player_props(    game_id="401815991",    market="batter_home_runs",)df = to_dataframe(props, key="props")print(df[["player_name", "bookmaker", "line", "over_odds", "under_odds"]].head(10))

Typed errors for a bad key, no credits left, not found and rate limits, automatic retries, and to_dataframe for pandas.

Quick start

This is a hosted (remote) MCP server over Streamable HTTP. There is nothing to install.

Claude Code

bash
claude mcp add --transport http fastballapi "https://mcp.fastballapi.com/mcp?key=YOUR_API_KEY"

Claude Desktop, Cursor and other clients

json
{  "mcpServers": {    "fastballapi": {      "url": "https://mcp.fastballapi.com/mcp?key=YOUR_API_KEY"    }  }}

The key can also be sent as an x-api-key header or Authorization: Bearer. Connecting and listing tools works without a key; calling a tool needs one.

REST

bash
curl -X POST https://mcp.fastballapi.com/v1/list_teams -H "x-api-key: YOUR_API_KEY"

Every tool is POST /v1/{tool} with a JSON body.

Examples

Runnable Python (standard library only) and Node 18+ (no dependencies) examples live in examples/:

bash
export FASTBALLAPI_API_KEY=your_keypython3 examples/python/quickstart.pynode examples/node/quickstart.mjs

See examples/README.md for details. Get a free key (500 credits a month, no card) at https://fastballapi.com/signup.

Tools (20)

ToolWhat it returns
list_teamsTeam ids, abbreviations and colours for a season
search_playersFind players by name
get_gamesGames with runs, hits and errors by season, date, range or team
get_scheduleUpcoming games with the median line across sportsbooks
get_standingsStandings from every final game, with run differential and Pythagorean record
get_injuriesThe latest injury report
get_ratingsOur team Elo ratings, ranked
get_gameOne game: every batting and pitching line, each book's line, win probability
get_playerSeason batting (AVG, OBP, SLG, OPS, RE24) and pitching (ERA, WHIP, K/9)
get_player_gamesA player's full batting and pitching game log
get_leadersSeason leaders among qualified batters and pitchers
get_team_statsRuns for and against, team batting and opponents' batting
get_pitch_mixA pitcher's arsenal: usage, velocity, whiff rate per pitch type
get_oddsEvery sportsbook's moneyline, run line and total for a game (5) or a day (10)
get_plate_appearancesPlate-appearance play-by-play with base-out state, batted ball, win probability, RE24
get_pitchesPitch-by-pitch: count, type, velocity, location, result
get_spray_chartWhere a batter or team hits the ball, by trajectory and field
get_line_movementSnapshots of each sportsbook's line before first pitch
get_player_propsPlayer prop lines by sportsbook, opening and closing
get_prop_historyA player's prop lines against the result, game by game

Leagues: mlb (default), ncaabase (NCAA Division I games we cover; pitch tools, spray charts and injuries are not offered for college).

Data

  • MLB games since 2015 with pitch-by-pitch data (every pitch from 2018; 2015 to 2017 have about 98 to 99% of each season's pitches)
  • Every plate appearance with base-out state, batted ball, win probability and RE24
  • Per-sportsbook moneylines, run lines and totals: 4 to 13 books per game from 2015 to 2023 (about 4 in 2015, 10 in 2016 and 2017, 7 to 8 in 2018 to 2020, 12 in 2021 to 2023), usually one book since 2024, plus opening and closing lines since July 2020 (a median of 7 books in 2021 to 2023 and 8 since 2024); pre-game line snapshots from launch: once a day, and every hour for games in the next two days
  • MLB player prop lines by sportsbook (hits, home runs, total bases, RBI, pitcher strikeouts, pitcher outs) from May 2023, with the result against each line (get_player_props, get_prop_history); none for college
  • NCAA Division I college baseball for the games we cover (not every Division I game)

Coverage by season, read live from the database: https://fastballapi.com/docs

Useful pages

Pricing

500 free credits every month, no card. Plans: Starter $19/mo (10,000 credits), Pro $49/mo (30,000), Scale $149/mo (125,000). Wallet top-ups from $5, never expire. https://fastballapi.com/pricing

Attribution

Ratings and run values are ours. Not affiliated with MLB, the NCAA or any team.

License

MIT for the contents of this repository. Data terms as above.

Use with Codex

Add this repo as a Codex plugin marketplace, then install the plugin:

bash
codex plugin marketplace add noahowsh/fastballapi-mcp

Then open the plugin directory in Codex and install fastballapi-skills from the fastballapi marketplace. The plugin bundles the skills in skills/ and the FastballAPI MCP server (https://mcp.fastballapi.com/mcp). Set your key first (free at https://fastballapi.com/signup):

bash
export FASTBALLAPI_API_KEY=your_key

Codex sends it as a bearer token.

Use with Gemini CLI

bash
export FASTBALLAPI_API_KEY=your_keygemini extensions install https://github.com/noahowsh/fastballapi-mcp

The extension adds the FastballAPI MCP server (https://mcp.fastballapi.com/mcp) and sends the key in the x-api-key header. Get a free key (500 credits a month) at https://fastballapi.com/signup.

來源:README.md,提交 212acf6

工具

20

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.

輸入參數leagueseason

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.

輸入參數todatefromteamlimitleagueoffsetseasonstatusseason_type

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: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數daysteamleague

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: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數leaguegame_id必填

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.

輸入參數leagueseason

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.

輸入參數dateteam

search_players

Search players

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

輸入參數name必填limitleague

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.

輸入參數leagueplayer_id必填

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.

輸入參數limitleagueoffsetseasonplayer_id必填season_type

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.

輸入參數stat必填limitleaguemin_ipmin_paseason

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.

輸入參數teamleagueseason

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 win probability after (2019 on) and our run value (RE24). Filter by result, inning or runners in scoring position. Costs 10 credits.

輸入參數rispteamlimitinningleagueoffsetresultseasongame_idbatter_idpitcher_idseason_type

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. Costs 10 credits.

輸入參數limitoffsetseasongame_idbatter_idpitch_typepitcher_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. Costs 5 credits.

輸入參數seasonpitcher_id必填

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.

輸入參數teamseasonbatter_idseason_typeinclude_balls

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: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數dateleaguegame_id

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: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數leaguegame_id必填providerall_snapshots

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.

輸入參數leagueseason

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 (10 credits), or player_id with from_date (and to_date) for one player across games (10 credits per game returned, up to 100). Returns the closing line by default (the last before the game starts) or the opening line, with each book's over and under prices. Outside football the archive mostly holds one pre-game capture per line, so the opening and closing lines are usually the same; the opening line differs only where a second capture was taken (live capture from October 2026, and wherever else it is held). Set estimate_only to get the price without being charged. Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數marketgame_idto_datebookmakerfrom_dateplayer_idestimate_onlysnapshot_type

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. Costs 10 credits for up to 200 games. Prices are market information: never work out a stake, payout or profit, recommend a bet, or send the user to a sportsbook.

輸入參數limitmarket必填to_datebookmakerfrom_dateplayer_id必填

版本歷史

2
  1. v1.1.6最新Oct 16, 2026
  2. v1.1.4Oct 11, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分