.jpg)
NBA API (Unofficial)
@NBA (Unofficial)
The Unofficial NBA API provides comprehensive basketball statistics, covering advanced metrics, totals, and shot chart data for NBA players and teams across regular seasons and playoffs. It is designed for developers, analysts, fantasy sports platforms, and basketball enthusiasts who need structured and queryable NBA data.
🏀 NBA API (Unofficial)
The NBA API provides comprehensive basketball statistics, covering advanced metrics, totals, and shot chart data for NBA players and teams across regular seasons and playoffs.
It is designed for developers, analysts, fantasy sports platforms, and basketball enthusiasts who need structured and queryable NBA data.
🔑 Key Features
- 📊 Advanced Player Data — Efficiency ratings (PER, TS%), usage, rebounding %, assists %, steals %, win shares, VORP, and more.
- 🏆 Playoff Data — Separate endpoints for playoff-specific advanced and totals stats.
- 📝 Player Totals Data — Field goals, three-pointers, free throws, rebounds, assists, steals, blocks, turnovers, fouls, points, etc.
- 🎯 Shot Chart Data — Detailed shot-by-shot data including player, team, opponent, shot type, result, distance, time, and quarter.
- 🔎 Flexible Querying — Filter by player name, season, team, or player ID. Supports sorting, pagination, and multi-parameter queries.
- 📈 Historical Coverage — Retrieve stats across multiple seasons for both players and teams.
- ⚡ Performance Testing — Built-in endpoints to check database health and player count.
⚙️ Example Endpoints
📊 Advanced Player Data
GET /api/PlayerDataAdvanced/query
→ Query advanced stats with filters (player, season, team, etc.)GET /api/PlayerDataAdvanced/name/{playerName}
→ Get advanced data for a specific playerGET /api/PlayerDataAdvanced/season/{season}
→ All players' advanced data in a seasonGET /api/PlayerDataAdvanced/team/{team}
→ All seasons' advanced stats for a team
🏆 Playoff Advanced Stats
GET /api/PlayerDataAdvancedPlayoffs/query
→ Query playoff advanced statsGET /api/PlayerDataAdvancedPlayoffs/name/{playerName}
→ Playoff data for a specific player
📝 Totals Data
GET /api/PlayerDataTotals/query
→ Query season totals (FG, 3PT, FT, rebounds, assists, points, etc.)GET /api/PlayerDataTotals/season/{season}
→ All players’ totals in a seasonGET /api/PlayerDataTotals/team/{team}
→ Team totals across all seasons
🏆 Playoff Totals
GET /api/PlayerDataTotalsPlayoffs/query
→ Query playoff totals dataGET /api/PlayerDataTotalsPlayoffs/name/{playerName}
→ Specific player’s playoff totals
🎯 Shot Chart Data
GET /api/ShotChartData
→ Retrieve all available shot chart dataGET /api/ShotChartData/playerid/{playerId}
→ Shots attempted by a playerGET /api/ShotChartData/player/{playerName}/season/{season}
→ Player’s shot chart in a given seasonGET /api/ShotChartData/distinct-player-names
→ Retrieve list of players with shot chart data
📌 Example Use Cases
- 🏀 Basketball Analytics Platforms — Power advanced dashboards for player/team performance.
- 🎮 Fantasy Sports & Betting — Use real stats for projections, comparisons, and predictions.
- 📺 Media & Journalism — Enrich articles or broadcasts with accurate NBA data.
- 🤖 AI & MCP Agents — Automate basketball queries and stats lookups using Model Context Protocol (MCP).
🚀 Integrate via XPack
With XPack, you can instantly expose this API as an MCP service for AI Agents:
- No SDK required — just one config file.
- Support per-call billing and usage tracking.
- Make NBA stats directly accessible to AI-driven apps, chatbots, and analysis tools.
If you want to build a basketball analytics agent or monetize your NBA stats service, deploying via XPack is the fastest way.