# NBA Stats Scraper - Players, Teams, Box Scores & Standings (`scrapewise/nba-stats-scraper`) Actor

Scrape official NBA stats from stats.nba.com: player and team season stats (base or advanced), player and team game logs, box scores, daily scoreboard and standings, for any season since 1946-47. No login. Filter by team, player, dates. Error rows are free.

- **URL**: https://apify.com/scrapewise/nba-stats-scraper.md
- **Developed by:** [Scrapewise Data](https://apify.com/scrapewise) (community)
- **Categories:** Sports, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.37 / 1,000 stat row delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## NBA Stats Scraper: official player, team, game log, box score and standings data

NBA Stats Scraper collects **official NBA statistics from stats.nba.com**, the same numbers that power the stats pages
of nba.com. No login, no API key. Pick the table you want (player season stats, team season stats, player
or team game logs, box scores, the daily scoreboard, standings or the player list), pick a season, and every row comes
back as one clean JSON item with camelCase field names, ready for a spreadsheet, a database or a model.

It is used for fantasy basketball and DFS research, sports analytics and betting models, dashboards that refresh every
night during the season, journalism and content, and training data for AI agents that need real sports numbers.

### At a glance

| What | Price |
|---|---|
| Row delivered (one player line, team line, game log line, box score line, game or standings line) | **US$ 1.80 per 1,000 rows** (US$ 0.0018 each) |
| Run start | US$ 0.005 per run |

- The 50 top scorers of a season (default input) = 50 rows = **US$ 0.095**.
- One full box score (both teams, about 26 players) = about **US$ 0.05**.
- Error rows and duplicates are never charged. `maxItems` is a hard cap, and a spending limit set on the run stops it
  cleanly with everything delivered so far.
- Every season since 1946-47 is available for the tables the NBA keeps for that era.

### Quick start

Top 50 scorers of the latest season (this is also what an empty input does):

```json
{
  "dataType": "playerStats",
  "maxItems": 50
}
```

Advanced stats (offensive, defensive and net rating, usage, true shooting, PIE) for two teams in 2024-25:

```json
{
  "dataType": "playerStats",
  "season": "2024-25",
  "measureType": "Advanced",
  "teams": ["LAL", "BOS"],
  "maxItems": 0
}
```

Every game of a player this season, one row per game:

```json
{
  "dataType": "playerGameLogs",
  "players": ["Stephen Curry"],
  "maxItems": 0
}
```

Box scores of chosen games, plus team totals:

```json
{
  "dataType": "boxScores",
  "gameIds": ["0022401199", "https://www.nba.com/game/lal-vs-por-0022401198"],
  "includeTeamTotals": true
}
```

Last night's scores (scoreboard of one day):

```json
{
  "dataType": "scoreboard",
  "dateFrom": "2025-03-10"
}
```

### Input

| Field | What it does |
|---|---|
| `dataType` | `playerStats`, `teamStats`, `playerGameLogs`, `teamGameLogs`, `boxScores`, `scoreboard`, `standings` or `players`. Default `playerStats`. |
| `season` | Season like `2025-26` (or `2025`). Empty = the latest season with data: before the new regular season starts, the previous one is used automatically. |
| `seasonType` | `Regular Season` (default), `Playoffs`, `PlayIn`, `Pre Season`, `All Star`. |
| `perMode` | For season stats: `PerGame` (default), `Totals`, `Per36`, `Per48`, `Per40`, `Per100Possessions`, `Per100Plays`, `PerMinute`, `PerPossession`. |
| `measureType` | `Base` (default), `Advanced`, `Misc`, `Scoring`, `Usage`, `Defense`, `Four Factors`, `Opponent`. Applies to season stats and player game logs. |
| `teams` | Keep only these teams: `LAL`, `BOS`, `GSW`... or names like `Lakers`. |
| `players` | Keep only these players: full name as on nba.com, numeric player id or nba.com player link. |
| `gameIds` | For box scores: 10-digit game ids or nba.com game links. Empty = the newest games of the season or of the date range. |
| `dateFrom`, `dateTo` | Date range (YYYY-MM-DD) for game logs, box scores, scoreboard and season stats. Scoreboard: empty = today, up to 62 days per run. |
| `lastNGames` | Season stats and game logs over the last N games only. |
| `includeRanks` | Adds the league rank of every stat (`ptsRank`, `astRank`...). |
| `includeTeamTotals` | Box scores: one extra row per team per game with team totals. |
| `maxItems` | Hard cap for the run (default 50; 0 = no cap). |
| `proxyConfiguration` | Datacenter by default. |

`type`, `mode`, `statType`, `team`, `player`, `gameId`, `startUrls`, `startDate`, `endDate`, `maxResults` and `limit`
are accepted too, so inputs written for other NBA tools keep working.

Season stats come sorted with the leaders first (points for base stats, minutes for the other measure types), so a
small `maxItems` gives you the players that matter.

### Output fields

Every row has `type`, `scrapedAt`, `errorCode` and `error`, plus nba.com links (`playerUrl`, `teamUrl`, `gameUrl`)
when the row has the matching id.

| Data type | Row `type` | Main fields |
|---|---|---|
| `playerStats` | `playerSeasonStats` | `season`, `seasonType`, `playerId`, `playerName`, `teamId`, `teamAbbreviation`, `age`, `gp`, `w`, `l`, `min`, `fgm`, `fga`, `fgPct`, `fg3m`, `fg3a`, `fg3Pct`, `ftm`, `fta`, `ftPct`, `oreb`, `dreb`, `reb`, `ast`, `tov`, `stl`, `blk`, `pf`, `pts`, `plusMinus`, `nbaFantasyPts`, `dd2`, `td3`, `perMode`, `measureType`. Advanced: `offRating`, `defRating`, `netRating`, `astPct`, `astTo`, `rebPct`, `efgPct`, `tsPct`, `usgPct`, `pace`, `pie`, `poss` and more. |
| `teamStats` | `teamSeasonStats` | `teamId`, `teamName`, `gp`, `w`, `l`, `wPct` and the same stat columns as players. |
| `playerGameLogs` | `playerGameLog` | `gameId`, `gameDate`, `matchup`, `wl`, `playerId`, `playerName`, `teamAbbreviation`, `min`, shooting, rebounds, assists, steals, blocks, turnovers, `pts`, `plusMinus`, `nbaFantasyPts`. |
| `teamGameLogs` | `teamGameLog` | `gameId`, `gameDate`, `matchup`, `isHome`, `opponentAbbreviation`, `wl`, team box score totals, `plusMinus`. |
| `boxScores` | `playerBoxScore` | `gameId`, `gameDate` (when found by date), `teamTricode`, `isHome`, `opponentTricode`, `playerId`, `playerName`, `position`, `isStarter`, `comment` (DNP reason), `minutes`, `points`, `reboundsTotal`, `assists`, `steals`, `blocks`, `turnovers`, field goal, three point and free throw made/attempted/percentage, `plusMinusPoints`. |
| `scoreboard` | `game` | `gameId`, `gameDate`, `gameStatus`, `arena`, TV broadcasters, `home*` and `away*` team id, code, city, name, record, points, points by quarter, overtime points (only in overtime games), shooting percentages, assists, rebounds, turnovers. |
| `standings` | `standing` | `teamId`, `teamCity`, `teamName`, `conference`, `division`, `playoffRank`, `wins`, `losses`, `winPct`, `record`, `home`, `road`, `l10`, streaks, games back, clinch flags, records by margin and by month. |
| `players` | `player` | `playerId`, `playerName`, `playerNameLastFirst`, `playerSlug`, `teamId`, `teamAbbreviation`, `teamName`, `isOnRoster`, `fromYear`, `toYear`. |

### Example output

One row of the default input (2025-26 regular season, per game):

```json
{
  "type": "playerSeasonStats",
  "season": "2025-26",
  "seasonType": "Regular Season",
  "playerId": 1629029,
  "playerName": "Luka Dončić",
  "teamId": 1610612747,
  "teamAbbreviation": "LAL",
  "age": 27.0,
  "gp": 64,
  "w": 43,
  "l": 21,
  "min": 35.8,
  "fgPct": 0.476,
  "fg3Pct": 0.366,
  "ftPct": 0.78,
  "reb": 7.7,
  "ast": 8.3,
  "stl": 1.6,
  "blk": 0.5,
  "tov": 4.0,
  "pts": 33.5,
  "plusMinus": 2.9,
  "nbaFantasyPts": 57.7,
  "dd2": 34,
  "td3": 8,
  "perMode": "PerGame",
  "measureType": "Base",
  "playerUrl": "https://www.nba.com/player/1629029",
  "teamUrl": "https://www.nba.com/team/1610612747"
}
```

### Errors

Problems come back as free rows with `type: "error"`, so a run never fails silently and you are never charged for them.

| `errorCode` | Meaning |
|---|---|
| `INVALID_INPUT` | Unknown data type, season, team code, or stats.nba.com rejected the filter combination. |
| `NOT_FOUND` | Player name not found, or a game id without a box score (not played yet or wrong id). |
| `INVALID_URL` | A game id or link that is not an NBA game. |
| `NO_RESULTS` | The season, dates or filters have no rows. |
| `RANGE_TRIMMED` | Scoreboard range longer than 62 days; the first 62 days were read. |
| `BLOCKED` | stats.nba.com did not answer after several attempts; run again in a few minutes. |

### Integrations, scheduling and AI agents

- **Schedules:** run `scoreboard` and `boxScores` every morning during the season with an empty date (today) or a
  rolling date to keep a database current. Season stats with `lastNGames: 10` make a good daily "form" table.
- **Export:** every dataset downloads as JSON, CSV, Excel, XML or RSS, or reads straight from the Apify API.
- **Make, n8n, Zapier:** use the Apify integration to send new rows to Google Sheets, Airtable, Slack or a webhook.
- **Apify MCP server:** AI agents (Claude, ChatGPT, Cursor and others) can call this Actor as a tool through the
  Apify MCP server to answer questions like "who led the league in assists last season" with live official numbers.

### FAQ

**Is this the official data?** Yes. Every number comes from stats.nba.com, the official NBA statistics service.

**Which seasons work?** Season stats, game logs and standings go back decades; box score detail depends on what the NBA
keeps for older games. The current season works as soon as games are played, preseason included.

**Why did I get last season?** With `season` empty and the new regular season not started yet, the Actor uses the
latest season that has data, and says so in the log. Set `season` to force one.

**How many rows is a full season?** About 570 player lines, 30 team lines, 2,460 team game log lines and about 26,000
player game log lines for a regular season.

**Do I need a proxy?** The default Apify proxy works. You do not have to configure anything.

### Limitations

- Play-by-play, shot charts, tracking and hustle stats are not included in this version.
- Player profile details beyond the statistics (photos, height, college, contracts) are not collected.
- The NBA updates stats.nba.com a little after each game ends; live in-game numbers can lag.
- Very large requests (all player game logs of a season) download about 10 MB and take a few seconds.

### Changelog

- **16 Oct 2026:** first version with player and team season stats (all measure and per modes), player and team game
  logs, box scores by id or date, scoreboard, standings and the player list.

# Actor input Schema

## `dataType` (type: `string`):

The kind of table to collect. Each row of that table is one dataset item.

## `season` (type: `string`):

Season like 2025-26 (2025 also works). Empty = the latest season with data (if the new season has not started yet, the previous one).

## `seasonType` (type: `string`):

Regular season, playoffs, play-in, preseason or All-Star.

## `perMode` (type: `string`):

How player and team season stats are expressed: per game, season totals, per 36 minutes, per 100 possessions and so on.

## `measureType` (type: `string`):

Base = traditional box score stats. Advanced adds offensive, defensive and net rating, usage, true shooting, pace and PIE. Applies to season stats and player game logs.

## `teams` (type: `array`):

Keep only these teams: 3-letter codes like LAL, BOS, GSW or names like Lakers. Empty = all 30 teams.

## `players` (type: `array`):

Keep only these players: full name as on nba.com (for example Stephen Curry), numeric player id or nba.com player link. Empty = every player.

## `gameIds` (type: `array`):

For box scores: 10-digit game ids like 0022401199 or nba.com game links. Empty = the newest games of the season (or of the date range).

## `dateFrom` (type: `string`):

First day (YYYY-MM-DD) for game logs, box scores, scoreboard and season stats. For the scoreboard, empty = today.

## `dateTo` (type: `string`):

Last day (YYYY-MM-DD). Scoreboard reads up to 62 days per run.

## `lastNGames` (type: `integer`):

Season stats and game logs over the last N games only. 0 or empty = whole season.

## `includeRanks` (type: `boolean`):

Adds the league rank of every stat (ptsRank, astRank...) to season stats and game logs.

## `includeTeamTotals` (type: `boolean`):

Adds one row per team per game with the team totals (charged as one row).

## `maxItems` (type: `integer`):

Hard cap for the whole run. 0 = no cap (a full season of player stats is about 570 rows).

## `proxyConfiguration` (type: `object`):

Apify datacenter proxy by default.

## Actor input object example

```json
{
  "dataType": "playerStats",
  "season": "2025-26",
  "seasonType": "Regular Season",
  "perMode": "PerGame",
  "measureType": "Base",
  "includeRanks": false,
  "includeTeamTotals": false,
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `resultsCsv` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "dataType": "playerStats",
    "season": "2025-26",
    "maxItems": 50,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapewise/nba-stats-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "dataType": "playerStats",
    "season": "2025-26",
    "maxItems": 50,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapewise/nba-stats-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "dataType": "playerStats",
  "season": "2025-26",
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call scrapewise/nba-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapewise/nba-stats-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gzcDe3hE0Y8k3NQoi/builds/ERjeGcaBbbTbtXFCX/openapi.json
