API Directory › ⚽ Sports › balldontlie (NBA)
No authHTTPSCORS

balldontlie (NBA) API

Free NBA stats — players, teams and game box scores.

Category
Auth
No auth needed
HTTPS
Yes
CORS
Yes
Open balldontlie (NBA) docs ↗

What it does

balldontlie is a free NBA stats API — teams, players, games, per-game box-score stats and season averages from 1946 to today, with live scores, standings and betting odds on paid tiers. This page covers it from the sports-stats angle; the same API is documented under games.

Base URL

https://api.balldontlie.io/v1

Authentication

A free account and API key are required — send it as the Authorization header. The old key-less www.balldontlie.io/api/v1 endpoint has been shut down.

Code examples

curl (a player's season averages)
PID=$(curl -s "https://api.balldontlie.io/v1/players?search=jokic" -H "Authorization: $KEY" | jq '.data[0].id')
curl -s "https://api.balldontlie.io/v1/season_averages?season=2025&player_ids[]=$PID" \
  -H "Authorization: $KEY"
Python (box scores for a date)
import requests

H = {"Authorization": KEY}
r = requests.get("https://api.balldontlie.io/v1/stats",
    params={"dates[]": "2026-01-15", "per_page": 100}, headers=H, timeout=10)
for s in r.json()["data"][:5]:
    print(s["player"]["last_name"], s["pts"], "pts", s["reb"], "reb", s["ast"], "ast")

Rate limits & quotas

Free tier: about 5 requests/minute (higher on paid), HTTP 429 over that. Cursor pagination: read meta.next_cursor and pass it as cursor; per_page maxes at 100. Live game data, standings and odds are paid tiers.

Key response fields

(players) data[].id / first_name / last_name / team.full_name / positionPlayer record
(games) data[].date / home_team_score / visitor_team_score / statusGame result
(stats) data[].pts / reb / ast / stl / blk / turnover / minBox-score line for one player in one game
(season_averages) data[].pts / fg_pct / fg3_pct / games_playedAggregated season stats
meta.next_cursor / meta.per_pagePagination

Common errors

401Missing or invalid Authorization key.
429Over ~5 requests/minute on the free tier — back off.
400Bad dates[]/seasons[] value, or per_page over 100.

When to use it (and alternatives)

The simplest free route to NBA box scores and player history — stat leaders, player comparison tools, fantasy and quiz apps. For other leagues: MLB Stats API, NHL api-web, API-Football (soccer).

FAQ

Is this different from the games/ page for balldontlie?

Same API. That page frames it around game-data projects; this one around stats/fantasy use. Read either — the endpoints, auth and limits are identical.

How do I get a full season of a player's games?

/stats?seasons[]=2025&player_ids[]=ID&per_page=100, then follow meta.next_cursor — while respecting the ~5 req/min free limit (so a full season takes a few paced requests).

Why did my old integration break?

The original open www.balldontlie.io/api/v1 was retired. Move to api.balldontlie.io, add a free API key in the Authorization header, and handle the new rate limit.

New to APIs?

Short guides for working with this API — and any other.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Sports APIs

← Back

More Sports APIs · All 196 APIs