# NBA Stats Official Scraper (`parseforge/nba-stats-scraper`) Actor

Scrapes official NBA stats from stats.nba.com: standings, league leaders, player stats, and team stats for any season. Returns flat JSON rows.

- **URL**: https://apify.com/parseforge/nba-stats-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Sports, News
- **Features:** Limited permissions
- **Stats:** 15 total users, 6 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 results

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner-v4.webp)](https://apify.com/parseforge?fpr=vmoqkp)

### NBA Stats Official Scraper

**Scrape official NBA stats from stats.nba.com: standings, leaders, player stats, and team stats for any season.** Get clean JSON rows with no API key or login. Export to CSV, JSON, Excel, or XML.

The NBA's official stats site has no public API and blocks normal scrapers. This Actor queries stats.nba.com endpoints directly and returns the data as flat rows. Pick an endpoint, a season, and a season type, and get the numbers you need.

| Who uses it | What they scrape NBA Stats for |
|---|---|
| Sports analysts | Pull current standings or player stats for a season to feed a model or report. |
| Fantasy basketball players | Get league leaders or player stats to make waiver wire decisions. |
| Sports bettors | Download team stats for a season to inform betting models. |
| Journalists | Grab official NBA stats for a story without manual copying. |
| Data engineers | Load NBA stats into a warehouse on a schedule. |

### What it does

This Actor collects NBA standings, league leaders, player stats, or team stats from stats.nba.com and returns each record as a flat row.

- 🏀 **League Standings:** current standings for any season and season type.
- 📊 **League Leaders:** top players by points, rebounds, assists, and more.
- 👤 **Player Stats:** per-game or totals for every player in a season.
- 📈 **Team Stats:** team-level stats for a season, regular or playoffs.
- 🗓️ **Season and type filters:** pick any season from 1996-97 onward and Regular Season, Playoffs, Pre Season, or All Star.
- 🔢 **Max items control:** limit rows from 10 up to 1,000,000 per run.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with NBA Stats data

**📊 Build a season dashboard.**

A data analyst runs the Actor for Player Stats, Regular Season, 2024-25, and loads the CSV into a BI tool to track player performance.

**🏆 Track the playoff race.**

A sports writer runs League Standings for the current season every morning and publishes the latest conference rankings.

**🎯 Scout fantasy pickups.**

A fantasy basketball player pulls League Leaders for the last week and sorts by points to find a hot free agent.

**📈 Feed a betting model.**

A bettor downloads Team Stats for the last three seasons and uses the CSV to train a model that predicts point spreads.

**🗄️ Archive NBA history.**

A data engineer schedules the Actor to fetch Player Stats for every season since 1996-97 and stores the JSON in a warehouse.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official source** | Data comes straight from stats.nba.com, the NBA's own stats site. |
| **No API key** | No registration, no OAuth, no rate-limit headaches. |
| **Flat rows** | Every record is a flat object, ready for CSV, JSON, Excel, or XML. |
| **Any season** | Go back to 1996-97 or pull the current season. |
| **Flexible output** | Export to CSV, JSON, Excel, or XML, or push to a dataset. |

### How it compares

No other Store actor targets NBA Stats the same way, so the honest comparison is with the alternatives teams actually weigh.

| | NBA Stats Official Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When NBA Stats changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor from one of four endpoints, then set the season and season type. Max items caps the rows returned. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [NBA Stats Official Scraper](https://apify.com/parseforge/nba-stats-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to NBA Stats through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/nba-stats-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check the season format. It must be YYYY-YY, like 2024-25. Also make sure the season type matches the endpoint. For example, All Star may not have standings.

**Why did I get only 10 rows?**

Free runs are limited to 10 rows. Upgrade to a paid plan and set maxItems higher, up to 1,000,000.

**Why does the run fail with a timeout?**

stats.nba.com can be slow. Increase the Actor's timeout in the run settings, or reduce maxItems.

**Why are some fields empty?**

Not every stat is tracked for every season or season type. For example, advanced stats may be missing for older seasons.

**Can I get data for a custom date range?**

No. The Actor returns full season data. Filter by date in your own code after export.

### FAQ

| Question | Answer |
|---|---|
| Do I need an API key or login? | No. The Actor queries stats.nba.com directly and handles the required headers for you. |
| Which endpoints can I scrape? | League Standings, League Leaders, Player Stats, and Team Stats. Pick one per run. |
| What seasons are available? | Any season from 1996-97 to the current one. Enter the season in YYYY-YY format, like 2024-25. |
| Can I get playoff stats? | Yes. Set seasonType to Playoffs, Pre Season, All Star, or Regular Season. |
| How many rows can I get? | Free runs return up to 10 rows. Paid runs can return up to 1,000,000 rows. |
| What format is the output? | Each record is a flat JSON object. You can export the dataset to CSV, JSON, Excel, or XML. |
| Does this work for WNBA or G League? | No. This Actor only queries stats.nba.com, which covers the NBA. |
| Can I schedule this to run daily? | Yes. Use Apify's scheduler to run the Actor on a cron and push results to a dataset or storage. |
| Is this legal? | You are responsible for how you use the data. The Actor only accesses publicly available stats pages. |
| What if I need a different endpoint? | The Actor supports four endpoints. If you need another stats.nba.com endpoint, contact support and we can add it. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by NBA Media Ventures, LLC. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `endpoint` (type: `string`):

stats.nba.com endpoint to query.

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

NBA season in YYYY-YY format.

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

Type of NBA season to fetch.

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

Free: 10. Paid: up to 1,000,000.

## Actor input object example

```json
{
  "endpoint": "leaguestandingsv3",
  "season": "2024-25",
  "seasonType": "Regular Season",
  "maxItems": 10
}
```

# Actor output Schema

## `results` (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 = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/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 = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/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 '{
  "maxItems": 10
}' |
apify call parseforge/nba-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/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/v4trAUTXdmvasoYCg/builds/WTX7AiIWiH5T5UNzA/openapi.json
