sports-data-hq

DunkAPI MCP server

Community sports-data-hq
Updated

DunkAPI: NBA, WNBA and college basketball data for AI agents. Remote MCP server, REST API and 11 Claude skills, plus 13 analytics skills.

DunkAPI MCP server

MCP Registry

The basketball data API. NBA play-by-play with the location of every shot, box scores, win probability, standings, injuries, our own team Elo ratings, sportsbook lines and player prop lines, plus the WNBA and men's and women's Division I college basketball. REST API and MCP server. 500 free credits every month, no card.

Website: https://dunkapi.com?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp · Docs: https://dunkapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp · Get a key: https://dunkapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp

You:    "What was each sportsbook's closing spread for every Celtics home game in 2023-24?"
Claude: [calls get_odds]

You:    "Which players took the most shots at the rim in the 2025 playoffs?"
Claude: [calls get_shot_chart]

You:    "How often has Jalen Brunson gone over his points line this season?"
Claude: [calls get_prop_history]

Run it locally (stdio)

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

git clone https://github.com/sports-data-hq/dunkapi-mcp.git && cd dunkapi-mcp && npm install
DUNKAPI_API_KEY=your_key node index.js
{ "mcpServers": { "dunkapi": { "command": "node", "args": ["/path/to/dunkapi-mcp/index.js"], "env": { "DUNKAPI_API_KEY": "your_key" } } } }

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

Try it now, no key

  • A free season of basketball data: the last completed season as CSV (games, standings, player season totals and our ratings). Download the zip or browse what's in it.
  • Open it in Colab: Open in Colab loads the pack and answers three questions in a minute.
  • Ask Claude without a key: install the skills below; season-pack-offline answers from the pack until you connect.

With a free key it does far more: every earlier season, today's games, play-by-play, lineups, odds and player props with their history and movement, and every skill below running on live data. Get a free key: 500 credits a month, no card.

Skills

11 Claude skills for basketball ship in this repo, plus 13 analytics skills for models, backtests, calibration and comparing a model with the market. Every number in an answer comes from a live DunkAPI tool call, and odds are information only: no stakes, no picks.

Claude Code:

/plugin marketplace add sports-data-hq/dunkapi-mcp
/plugin install nba-data@dunkapi
/plugin install sports-analytics-core@dunkapi

Codex: codex plugin marketplace add sports-data-hq/dunkapi-mcp. Any agent that reads skills: npx skills add sports-data-hq/dunkapi-mcp.

Skill What it does
nba-dfs-lineup Build a lineup under the cap from your salary file, with fantasy points from the market's per-player lines
nba-fantasy-streaming Who to stream this week: games per team, back-to-backs and recent minutes
nba-game-preview One-page preview: records, ratings, pace and efficiency, four factors, injuries and the line
nba-line-movement How a basketball spread, total or moneyline moved by book, opening to closing, with the alternate-line ladders
nba-minutes-usage-redistribution Who benefits when a player sits: minutes, shots and usage per teammate with and without him
nba-pace-efficiency-matchup Two teams side by side on pace, offensive and defensive rating per 100 and the four factors
nba-player-props-research Prop lines by sportsbook, the player's record against his line, minutes context and movement
nba-shot-quality Shot quality by zone: attempts, makes and expected points per shot against actual results
ncaam-bracket-research Team profiles for tournament and bracket questions: Elo rank, net rating, pace, four factors and the season path, with no picks
ncaam-game-preview One-page preview of a men's or women's college basketball game: Elo, pace and efficiency, four factors, venue and the market line
ncaam-player-props-research Men's college basketball prop lines by book, the player's record against his line with minutes, and movement

The analytics skills: backtesting, data-pipeline, elo-engineering, feature-engineering, market-vs-model, model-building, odds-market-analysis, prediction-tracker, probability-calibration, season-pack-offline, sports-data-preflight, visualization, walk-forward-validation.

Real answers on live data, with the credits each used: example answers.

All nine sports' skills live in sports-data-hq/sportsdatahq-skills. The copies here are synced from there, so please open issues and pull requests there.

Python

The official Python client is on PyPI: dunkapi.

pip install dunkapi
export DUNKAPI_API_KEY=sk_live_...
from dunkapi import Client, to_dataframe

client = Client()

props = client.get_player_props(
    game_id="401810726",
    market="player_points",
    bookmaker="draftkings",
)
df = to_dataframe(props, key="props")
print(df[["player_name", "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

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

Claude Desktop, Cursor and other clients

{
  "mcpServers": {
    "dunkapi": {
      "url": "https://mcp.dunkapi.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

curl -X POST https://mcp.dunkapi.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/:

  • examples/python/quickstart.py and examples/node/quickstart.mjs: schedule plus a headline call.
  • examples/python/nba_player_props.py: Player prop lines against results.
export DUNKAPI_API_KEY=your_key
python3 examples/python/quickstart.py
node examples/node/quickstart.mjs

See examples/README.md for details. Get a free key (500 credits a month, no card) at https://dunkapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp.

Starter projects

  • nba-props-backtest: grade NBA player props against the closing line, per player or league-wide, in one Python script.

Use it in

Tools (24)

Tool What it returns
list_teams Team ids, abbreviations and colours for a season
search_players Find players by name
list_games Games with scores by season, date, range or team
get_schedule Upcoming games with the median line across sportsbooks
get_standings Standings from every final game: overall, conference, home, away, last 10
get_injuries The latest injury report: status, injury and expected return (NBA, WNBA)
get_ratings Our team Elo ratings, ranked
get_game One game: both box scores, every player's line, each book's line, win probability
get_player Profile, per-season averages and shooting splits, last 10 games
get_player_games A player's full game log
get_leaders Season leaders per game, by percentage or in total
get_team_stats Pace, offensive, defensive and net rating, and the four factors
get_odds Every sportsbook's moneyline, spread and total for a game (5) or a day (10), with results against the line
get_plays Play-by-play with shot locations, zones, expected points and win probability
get_shot_chart Shot profile by zone for a player, team or defence, with every shot's x/y
get_line_movement Snapshots of each sportsbook's line before tip-off
get_player_props Player prop lines by sportsbook: the closing line (one pre-game capture per line before October 2026)
get_prop_history A player's prop lines against the result, game by game
get_prop_movement How one player's prop line moved before a game, every capture by sportsbook
get_market_odds Opening and closing lines by sportsbook for the half and quarter markets (history from May 2023)
get_alt_lines Alternate spreads and totals by sportsbook: every point on each book's ladder, opening and closing, NBA, WNBA and men's college from 2023-24
get_game_probabilities What the market thinks of a game: average implied and fair probability for the moneyline, spreads and totals
get_prop_probabilities What the market thinks of a game's player props: average implied and fair probability for each player and line
get_prop_backtest How often a kind of player prop hit against what the market implied, by your filters, since May 2023

Leagues: nba (default), wnba, ncaam, ncaaw (pass league to any tool).

Data

  • NBA games since 2003-04 with play-by-play and shot locations (x/y, zone, expected points, win probability)
  • The WNBA and men's and women's Division I college basketball through the same tools
  • Team Elo ratings, standings from every final game, injury report (NBA, WNBA)
  • Per-sportsbook moneylines, spreads and totals: 4 to 12 books per regular-season NBA game from 2013-14 to 2023-24 (10 to 12 from 2020-21), plus opening and closing lines since July 2020 (a median of 7 books per NBA game in 2020-21 to 2022-23, 8 since); pre-game line snapshots from launch: once a day, and every hour for games in the next two days
  • Player prop lines by sportsbook (points, rebounds, assists, threes, points + rebounds + assists, blocks, steals) from May 2023 for the NBA and WNBA and from the 2023-24 season for men's college basketball, with the result against each line (get_player_props, get_prop_history)
  • Women's college basketball: opening and closing lines from November 2024 (a median of 4 books); no player props

Coverage by season, read live from the database: https://dunkapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp

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), Business $299/mo (300,000). Wallet top-ups from $5, never expire. https://dunkapi.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp

Attribution

Ratings are ours. Not affiliated with the NBA, WNBA, NCAA or any team.

License

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

Use with Codex

The SportsDataHQ skills marketplace also works in Codex (it reads .agents/plugins/marketplace.json):

codex plugin marketplace add sports-data-hq/sportsdatahq-skills

Install nba-data, which bundles the basketball skills and the DunkAPI MCP server.

Use with Gemini CLI

export DUNKAPI_API_KEY=your_key
gemini extensions install https://github.com/sports-data-hq/dunkapi-mcp

The extension adds the DunkAPI MCP server (https://mcp.dunkapi.com/mcp) and sends the key in the x-api-key header. Get a free key (500 credits a month) at https://dunkapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=dunkapi-mcp.

MCP Server · Populars

MCP Server · New