# NBA Scores & Schedule Scraper (`rl1987/nba-api-scraper`) Actor

Fetches NBA games for a date or date range from the NBA app's core-api: live/scheduled/final scores, clock, teams, records and broadcast info. No account needed (guest subscription key).

- **URL**: https://apify.com/rl1987/nba-api-scraper.md
- **Developed by:** [R.L.](https://apify.com/rl1987) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 games

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## NBA Scores Scraper – Live, Final & Historical NBA Game Data 🏀

Scrape **NBA scores, results and schedules** for any date — from tonight's games all the way back to **1998** — without an NBA account, login, or API key. This NBA data scraper talks directly to the NBA's own mobile `core-api` (the feed that powers the official NBA app), so you get fast, structured, **real-time and historical basketball data** as clean JSON, CSV or Excel.

Whether you're building a sports app, powering a fantasy or betting model, running basketball analytics, or backfilling a stats database, this actor gives you reliable **NBA game data** in seconds.

### What this NBA scraper does

- 📅 **Scores by date or date range** — pull every NBA game for a single day or a full span of days.
- 🔴 **Live, scheduled and final scores** — in-progress games include the game clock and current period; finished games include the final result.
- 🏆 **Full game history back to 1998** — grab legendary games (Jordan's "Last Shot", the Cavs' 2016 comeback) or backfill entire seasons and playoffs.
- 📊 **Rich per-game detail** — final score plus **quarter-by-quarter breakdown**, both teams' **win–loss records**, playoff/neutral-site context, and a **direct link to the game's page on NBA.com**.
- ⚡ **No API key, no account** — the app's guest access is built in; just pick a date and run.

### Key features

| Feature | Details |
|--------|---------|
| **Data source** | Official NBA mobile `core-api` — the same feed the NBA app uses |
| **Coverage** | Regular season, playoffs and Finals; **1998 → today** |
| **Score states** | `UPCOMING` (scheduled), `LIVE` (with clock & period), `POST` (final) |
| **Granularity** | Team & per-quarter scores, W–L records, status & season context, NBA.com game URL |
| **Export formats** | JSON, CSV, Excel, HTML, or via the Apify API |
| **Auth required** | None — no NBA login or API key |

### Popular use cases

- **Sports & scores apps** — power a live scoreboard or results page with fresh NBA data.
- **Fantasy basketball & sports betting models** — feed historical and live game results into your models.
- **Basketball analytics & research** — build datasets of scores, margins and quarter splits across seasons.
- **Media & content** — auto-generate recaps, standings widgets and matchup pages.
- **Data backfill** — reconstruct a full season, a playoff series, or decades of Finals in one run.

### Input

Pick a single day, or a date range. A brand-new run is **pre-filled with a real game** (Game 7 of the 2016 NBA Finals) so you can try it instantly.

| Field | Type | Description |
|-------|------|-------------|
| `date` | date | One day of games. Accepts `YYYY-MM-DD` or a relative value like `1 day`. Empty = today. |
| `startDate` / `endDate` | date | Range mode — every game between two dates (inclusive). Provide both. |
| `liveOnly` | boolean | Return only games currently in progress. |
| `maxItems` | integer | Cap the number of games returned (`0` = all). |
| `proxyConfiguration` | proxy | **Residential proxy recommended** (default). The NBA edge blocks datacenter IPs. |

#### Try these historically significant dates

| Date | Game |
|------|------|
| `1998-06-14` | Michael Jordan's "Last Shot" — Bulls 87, Jazz 86 (Finals G6) |
| `2013-06-18` | Ray Allen's clutch 3 — Heat 103, Spurs 100 (OT, Finals G6) |
| `2016-06-19` | Cavaliers complete the 3–1 comeback — Cavs 93, Warriors 89 (Finals G7) |
| `2020-10-11` | Lakers win the "bubble" title (Finals G6) |
| `2023-06-12` | Nuggets clinch their first-ever title (Finals G5) |
| `2024-06-17` | Celtics win a record 18th title (Finals G5) |

#### Example input

```json
{
  "startDate": "2016-06-02",
  "endDate": "2016-06-19",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Output

One clean row per game — export as JSON, CSV or Excel:

```json
{
  "gameId": "0041500407",
  "status": "POST",
  "statusText": "Final",
  "dateEastern": "2016-06-19T20:00:00-04:00",
  "awayTeam": {
    "teamTricode": "CLE", "teamName": "Cavaliers",
    "score": 93, "wins": 4, "losses": 3,
    "periods": [{ "period": 1, "score": 23 }, { "period": 2, "score": 19 }]
  },
  "homeTeam": {
    "teamTricode": "GSW", "teamName": "Warriors",
    "score": 89, "wins": 3, "losses": 4,
    "periods": [{ "period": 1, "score": 22 }, { "period": 2, "score": 20 }]
  },
  "seasonType": "Playoffs",
  "isNeutral": false,
  "headline": "Cavaliers @ Warriors",
  "url": "https://www.nba.com/game/cle-vs-gsw-0041500407"
}
```

### Pricing

Simple **pay-per-event: $0.001 per game** returned. No monthly subscription, no minimum — you only pay for the data you scrape.

### FAQ

**Do I need an NBA API key or account?**
No. The actor uses the NBA app's built-in guest access, so there's nothing to sign up for.

**Can I get live, in-progress scores?**
Yes. Games currently being played come back as `LIVE` with the game clock and period; use `liveOnly` to keep just those.

**How far back does the NBA data go?**
All the way to **1998** — including iconic playoff and Finals games — so you can backfill historical seasons as well as scrape today's games.

**Which formats can I export?**
JSON, CSV, Excel, HTML, RSS, or straight from the Apify API and dataset.

**Why does a "today" run sometimes return nothing?**
The NBA is off-season in summer. Pick an in-season date (or use one of the historic dates above) to see games.

**Does this include individual player box scores?**
This actor focuses on **game-level scores, results and schedules** (teams, final and quarter scores, records, status). It is not a player box-score scraper.

### Disclaimer

This is an unofficial tool and is **not affiliated with, endorsed by, or sponsored by the NBA**. All team names and trademarks belong to their respective owners. Use the scraped data responsibly and in line with applicable terms and laws.

# Actor input Schema

## `date` (type: `string`):

Single day to fetch (games are date-specific). Prefilled with 2016-06-19 — Game 7 of the 2016 Finals (Cavaliers 93, Warriors 89: Cleveland completes the 3-1 comeback for its first title), so a default run scrapes real data. Other historically significant dates to try: 1998-06-14 (Jordan's "Last Shot", Bulls 87-86 Jazz), 2013-06-18 (Ray Allen's clutch 3, Heat 103-100 Spurs OT), 2020-10-11 (Lakers bubble title), 2023-06-12 (Nuggets' first title), 2024-06-17 (Celtics' 18th title). Accepts a relative value like "1 day"; empty = today (off-season in summer returns no games).

## `startDate` (type: `string`):

RANGE MODE. First day of a date range. Provide both start and end.

## `endDate` (type: `string`):

RANGE MODE. Last day of the date range (inclusive).

## `liveOnly` (type: `boolean`):

Keep only games that are currently LIVE.

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

0 = all games in the selected date(s).

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

Route requests through a proxy. The NBA core-api works from datacenter IPs, so Apify Proxy (automatic) is enough.

## Actor input object example

```json
{
  "date": "2016-06-19",
  "liveOnly": false,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "date": "2016-06-19",
    "startDate": "",
    "endDate": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("rl1987/nba-api-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 = {
    "date": "2016-06-19",
    "startDate": "",
    "endDate": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("rl1987/nba-api-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 '{
  "date": "2016-06-19",
  "startDate": "",
  "endDate": "",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call rl1987/nba-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rl1987/nba-api-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/5zz7HRzwjEaZJD035/builds/zDP5sKt4cPnR5rL7z/openapi.json
