Skip to content

NBA Data

If you want to build a game that combines fantasy basketball and management aspects using real NBA player data, there are several free APIs available. These APIs provide data on current and former NBA players, though most have some limitations compared to paid offerings. Below is a rundown of good options to get started:

APIFreeAPI KeyData CoverageGood For
BalldontlieYesOnly Game statisticsGame analysis
NBA REST APINoUnavailable-
NBA GraphQLDependsUnavailable-
API-BasketballYesLeagues, Teams and Player namesLeague structure
pbpstats.comNoExtensiveDetailed stats & live data

Before diving in, be aware of constraints common to all public and free NBA data sources:

  • Limited depth and detail: advanced or granular data is typically unavailable.
  • Season-scoped constraints: many endpoints are restricted by season and lack multi-year rollups.
  • Live/real-time data is minimal or gated behind paid tiers.
  • Historical completeness varies; coverage gaps and inconsistent advanced metrics are common.
  • Strict rate limits often require heavy caching and careful batching.

For truly comprehensive, production-grade coverage (rich events, advanced metrics, timely feeds), Sportradar is widely regarded as the only sufficiently powerful option among commonly known providers. However, reliable public pricing is not available; information encountered suggests costs starting around $1,000+ per month, which makes it a non-candidate for this project or most indie prototypes.

❌ 1. BALDONTLIE API (Free, well documented) - No Statistics

Section titled “❌ 1. BALDONTLIE API (Free, well documented) - No Statistics”

A widely-used free API with NBA player & team data going back decades.

Features

  • Player profiles (names, basic info)
  • Team info
  • Game stats and seasonal data
  • Historical data back to the early NBA era

Notes

  • You need a free API key.
  • Some endpoints (like detailed live box scores / advanced stats) may require paid tiers. nba.balldontlie.io+1
  • Doesn’t provide player statistics, beyond a specific game.

👉 Great starting point for basic player data and historical stats.

❌ 2. NBA REST API (Unofficial / public) - Unavailable

Section titled “❌ 2. NBA REST API (Unofficial / public) - Unavailable”

A community-hosted REST API that serves NBA player, team, and game data via JSON.

Features

  • Players list and individual info
  • Season and game stats
  • Team standings
  • Advanced stats and shot chart endpoints

Notes

  • No authentication required.
  • Data coverage depends on the specific REST API source (public clones of nba.com data). openpublicapis.com
  • Status: As of late 2025, this API appears to be unavailable or deprecated.

👉 Good if you want a no-auth, easy JSON source quickly.

A GraphQL-style API that lets you request NBA data via flexible queries.

Features

  • Players, teams, seasons, stats all in one schema
  • Request only the fields you need
  • Flexible for building UI or game backend logic

Notes

  • Official authentication requirements may vary (check endpoint docs). openpublicapis.com
  • Status: As of late 2025, this API appears to be unavailable or deprecated.

👉 Great if you like GraphQL flexibility.

❌ 4. API-Basketball Free Tier - No Statistics

Section titled “❌ 4. API-Basketball Free Tier - No Statistics”

A more general sports API provider that includes basketball/NBA support.

Features

  • NBA data endpoints
  • Free tier available (with registration)
  • Designed for building apps and dashboards
  • Doesn’t provide player statistics.

Notes

👉 Useful if you want multi-sport support and simple endpoints.

✅ 5. pbpstats.com API (Free, well documented)

Section titled “✅ 5. pbpstats.com API (Free, well documented)”

pbpstats.com provides a powerful and free API for NBA, WNBA, and G-League data. It is well-documented with a Swagger UI.

Features

  • General Data: Get all players, teams, and games for a league.
  • Detailed Stats: Access career stats, game logs, and on/off court data (WOWY).
  • Possession & Shot Data: Granular access to possession and shot data with filtering.
  • Live Data: Provides live game data.
  • Visualization Endpoints: Data for assist networks, four-factor charts, and more.
  • Win Probability: Calculate win probability based on game situations.

Notes

  • The API is free and does not require an API key.
  • It provides a rich set of data suitable for in-depth analysis and simulation.

👉 An excellent and comprehensive free resource for detailed basketball statistics.

Depending on which one you choose, you can usually access:

✅ Player profiles (name, team, height/weight, position)
✅ Career stats (season averages, totals)
✅ Game results and box scores
✅ Team data and schedules
✅ Historical player data (some go back to the 1940s) nba.balldontlie.io

Note: Many free APIs do not include detailed advanced stats or live game feeds without upgrades.

Tips for Building Your Fantasy/Management Game

Section titled “Tips for Building Your Fantasy/Management Game”

You can start with Balldontlie or the NBA REST API for foundational data (players, teams, seasons), then layer advanced stats from another API or data store.

Free APIs often have strict rate limits. Cache player data and stats server-side to reduce calls.

If your game becomes commercial, check the API’s terms of service — especially for real-time/live data.

For historical depth, consider supplementing API calls with downloaded datasets (e.g., Kaggle NBA datasets) or open data repos.

While APIs are the preferred method for data retrieval, scraping websites is another option.

WebsiteContentNotesAccessRestriction
pbpstats.com9Provides a wide range of statistics from play-by-play data.10Fully permissive; no robots.txt or terms of service were found.
nbastuffer.com7Offers team and player stats, including power rankings, box score-like statistics, and some advanced metrics.8.5robots.txt is permissive. Terms of use prohibit commercial use and require a link back for any reuse or distribution.
craftednba.com6Provides an interesting mix of traditional and advanced stats, but mostly limited to the current season.10Fully permissive; robots.txt allows all scraping and no terms of service were found.

However, it’s crucial to respect the robots.txt file of each site, which outlines the rules for web crawlers. Below is an analysis of the scraping-friendliness of several NBA data websites based on their robots.txt files. Each site is rated from 1 (most restrictive) to 10 (least restrictive).

RatingWebsiteNotes
10/10bball-index.comFully permissive. The robots.txt file explicitly allows all crawling.
10/10nbarapm.comFully permissive. No robots.txt file was found.
10/10pbpstats.comFully permissive. No robots.txt file was found.
10/10craftednba.comFully permissive. The robots.txt does not constrain scraping.
10/10thinkingbasketball.netFully permissive. The robots.txt does not constrain scraping.
10/10databallr.comFully permissive. The robots.txt does not constrain scraping.
10/10cleaningtheglass.comFully permissive. The listed bots do not apply to general scraping.
9/10nbastuffer.comPermissive. Disallows crawling of some file types and administrative paths, but content is generally accessible.
2/10basketball-reference.comVery restrictive. Disallows crawling of many data-rich sections like gamelogs, splits, and shooting stats. Imposes a 3-second delay between requests.
1/10nba.comHighly restrictive. Blocks access to its API and disallows many common user agents from crawling large parts of the site.

Always review the terms of service for any website before scraping. The absence or permissiveness of a robots.txt file does not grant a license to use the content in any way you wish.

RatingWebsiteNotes
10/10nbarapm.comNo terms of service page was found.
10/10pbpstats.comNo terms of service page was found.
10/10craftednba.comNo terms of service page was found.
10/10thinkingbasketball.netNo terms of service page was found.
9/10cleaningtheglass.comUser contributions are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License, which allows for non-commercial use with attribution.
8/10nbastuffer.comThe terms of use state that you may not use their work for commercial purposes, but for any reuse or distribution on the internet, you just need to provide a link to the website.
5/10bball-index.comThe terms of service do not explicitly mention automated access or scraping. The terms are standard and don’t contain any specific restrictions on data usage for non-commercial projects, but they also don’t grant any explicit permissions.
2/10databallr.comThe terms of service grant a limited license for personal, non-commercial use and explicitly state that you may not modify or copy the materials or use them for commercial purposes.

After reviewing the content providers, it’s clear that only a few sites offer a substantial amount of free, easily accessible data suitable for a fantasy basketball project. Many sites either have their most valuable data behind a paywall or provide very specific, niche metrics that may not be suitable for a general-purpose fantasy game.

The table below summarizes the available data from each site, with a rating from 1 to 10 indicating the amount of free data provided.

RatingWebsiteSeasonsNotes
9/10pbpstats.com1996-PresentProvides a wide range of statistics from play-by-play data, including On/Off stats, possession-based stats, and game logs for the NBA, WNBA, and G-League, dating back to the 2000-01 season. It also has a documented API.
7/10nbastuffer.com2016-PresentOffers team and player stats, including power rankings, box score-like statistics, and some advanced metrics. However, the focus is primarily on the current and most recent seasons.
6/10craftednba.comPresentThe site provides an interesting mix of traditional and advanced stats. However only current players seem to be available, even though once accessing the players, you can find there former data too.
4/10nbarapm.com2004-PresentProvides specific player impact metrics like RAPM, DARKO, and LEBRON. While the data goes back to 2004, it is highly specialized and may not be suitable for a general fantasy game.
3/10bball-index.com2010-PresentOnly contains Lebron data and some advanced analysis. The data is not suitable to build a simulation on it.
2/10cleaningtheglass.com2003-PresentOnly provides categorised data for top 5 of that category. It’s too fragmented and specific to use it as the foundation of a simulation.
0/10thinkingbasketball.netSince 2016All relevant data seems to be behind a Paetron paywall.