NBA API (nbaapi.com)
Free NBA statistics API with no key: per-season player totals and advanced metrics with full shooting splits, paginated and filterable. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the NBA API (nbaapi.com)?
nbaapi.com serves NBA player statistics as JSON with no API key. The player totals endpoint returns a full season line per player — games, minutes, shooting splits by zone, rebounds, assists, steals, blocks, turnovers and points — with pagination metadata.
The NBA's own stats site has an API, but it is undocumented, aggressively fingerprints clients and blocks anything that looks automated. This project sidesteps that by scraping and normalising the same underlying data into a clean, paginated REST interface that answers plain requests with no headers to spoof and no key to obtain.
The shooting splits are the part that earns its place. Rather than a single field-goal figure, each record breaks attempts and makes into two-point and three-point components and adds `effectFgPercent`, which weights threes correctly — the difference between a shooting percentage that means something and one that does not. Note that `isPlayoff` is a separate boolean rather than a separate endpoint, so any aggregate you build must filter on it or you will be silently mixing regular season and postseason lines.
Quick facts
- Base URL
https://api.server.nbaapi.com/api- Authentication
- No API key and no account.
- Rate limit
- No published limit. It is a community-run mirror — page sensibly rather than pulling whole seasons in a loop.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the NBA API (nbaapi.com)
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Fetch a player's season totals
GET https://api.server.nbaapi.com/api/playertotals?season=2024&pageSize=1
curl 'https://api.server.nbaapi.com/api/playertotals?season=2024&pageSize=1'const res = await fetch("https://api.server.nbaapi.com/api/playertotals?season=2024&pageSize=1");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://api.server.nbaapi.com/api/playertotals?season=2024&pageSize=1", timeout=20)
res.raise_for_status()
print(res.json()){
"data": [
{
"playerId": "doncilu01",
"playerName": "Luka Dončić",
"position": "PG",
"age": 24,
"games": 70,
"gamesStarted": 70,
"minutesPg": 2624,
"fieldGoals": 804,
"fieldAttempts": 1652,
"fieldPercent": 0.487,
"threeFg": 284,
"threeAttempts": 744,
"threePercent": 0.382,
"twoFg": 520,
"twoAttempts": 908,
"twoPercent": 0.573,
"effectFgPercent": 0.573,
"ft": 478,
"ftAttempts": 608,
"ftPercent": 0.786,
"offensiveRb": 59,
"defensiveRb": 588,
"totalRb": 647,
"assists": 686,
"steals": 99,
"blocks": 38,
"turnovers": 282,
"personalFouls": 149,
"points": 2370,
"team": "DAL",
"season": 2024,
"isPlayoff": false
}
],
"pagination": {
"total": 949,
"page": 1,
"pageSize": 1,
"pages": 949
}
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
season | query | Optional | Season by its ending year, so 2024 means the 2023-24 season. 2024 |
pageSize | query | Optional | Records per page. 1 |
page | query | Optional | 1-based page number. 1 |
playerName | query | Optional | Filter by player name. Luka Doncic |
team | query | Optional | Three-letter team abbreviation. DAL |
/playeradvanced | path | Optional | Sibling endpoint returning advanced metrics — PER, win shares, usage rate — instead of raw totals. |
Response fields
data[].playerId / playerNamestring- Basketball-Reference style player slug and display name. The slug is stable across seasons; the name is not.
data[].position / age / teamstring / integer- Listed position, age during that season, and three-letter team code.
data[].games / gamesStarted / minutesPginteger- Appearances, starts and total minutes. Despite the name, `minutesPg` in the captured record is a season total, not a per-game average.
data[].fieldGoals / fieldAttempts / fieldPercentinteger / float- Overall shooting from the floor.
data[].threeFg / threeAttempts / threePercentinteger / float- Three-point splits.
data[].twoFg / twoAttempts / twoPercentinteger / float- Two-point splits.
data[].effectFgPercentfloat- Effective field-goal percentage, weighting three-pointers at 1.5. Use this rather than raw FG% for comparisons.
data[].ft / ftAttempts / ftPercentinteger / float- Free-throw shooting.
data[].offensiveRb / defensiveRb / totalRbinteger- Rebounding split by end of the floor.
data[].assists / steals / blocks / turnovers / personalFouls / pointsinteger- Season totals for the remaining box-score categories.
data[].season / isPlayoffinteger / boolean- Season ending year and whether this line is postseason. Filter on `isPlayoff` before aggregating.
paginationobject- `total`, `page`, `pageSize` and `pages` for walking the result set.
What you can build with the NBA API (nbaapi.com)
- Build a player comparison tool with correct effective field-goal percentages
- Chart a player's shooting profile across seasons
- Assemble a fantasy basketball projection dataset
- Separate regular-season and playoff performance for the same player
Common errors and how to fix them
Totals look doubled
Regular season and playoff lines were summed together.
Fix: Filter on `isPlayoff` explicitly. Both live in the same result set.
Player appears several times in one season
Players traded mid-season have a line per team.
Fix: Aggregate by `playerId` and `season`, or use the combined total row where the source provides one.
Per-game numbers are wrong
The totals endpoint returns season totals, and `minutesPg` is named misleadingly.
Fix: Divide by `games` yourself, and sanity-check any field whose name implies an average.
Empty result set
The filter combination matched nothing.
Fix: Check `season` is the ending year and that the team abbreviation is the three-letter code, then read `pagination.total`.
NBA API (nbaapi.com) — frequently asked questions
Is this NBA API free?
Yes, free with no key and no account. It is a community project mirroring publicly available statistics rather than an official NBA service.
How do I specify a season?
Use the ending year. The 2023-24 season is `season=2024`, following the same convention basketball reference sites use.
What is effectFgPercent?
Effective field-goal percentage, which counts a made three as worth 1.5 makes. It is the correct way to compare shooters with different shot profiles, where raw field-goal percentage misleads.
Does it include playoff statistics?
Yes, in the same result set, flagged by the `isPlayoff` boolean. Filter on it before aggregating or your season totals will silently include postseason games.
Tools that pair with this API
Percentage Calculator
Calculate what X% of a number is, what percent one number is of another, and percentage increase or decrease between two values — instantly and free.
Weighted Average Calculator
Compute a weighted average from value and weight pairs: Σ(value × weight) ÷ Σ(weights). Add rows for grades, portfolios or ratings and see each weight's share.
CSV Column Statistics Calculator
Profile a CSV column by column: type, blanks, distinct values, min, max, mean, median, standard deviation and percentiles, plus top values — all in-browser.
NBA API (nbaapi.com) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.