# NBA Stats Scraper for espn.com (`blackfalcondata/espn-nba-scraper`) Actor

Scrape NBA box scores from espn.com: one row per player per game with the full statline and the team totals - minutes, points, shooting splits, rebounds, assists, turnovers, steals, blocks, fouls and plus/minus, plus opponent and result. Pick a season, a date range or one game.

- **URL**: https://apify.com/blackfalcondata/espn-nba-scraper.md
- **Developed by:** [Black Falcon Data](https://apify.com/blackfalcondata) (community)
- **Categories:** Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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.

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

### What does NBA Stats Scraper for espn.com do?

NBA Stats Scraper for espn.com pulls box scores from [espn.com](https://espn.com): one row per player per game, carrying that player's full statline **and** that team's totals. Every row has `minutesPlayed`, `pointsTotal`, field goals, three pointers and free throws as made / attempted / percentage, `reboundsOffensive` and `reboundsDefensive`, `assistsTotal`, `turnoversTotal`, `stealsTotal`, `blocksTotal`, `foulsPersonal` and `plusMinusNumeric` — plus the quarter-by-quarter score, the opponent, the venue, the margin and the result. Pick a whole season, a date, a date range or a single game, and narrow to the teams you follow.

### How to use this actor

- 👉 **Register for a free Apify account** — no credit card required.
- 🎉 Just click **[Sign up free on Apify →](https://console.apify.com/sign-up?fpr=1h3gvi)** and complete a quick signup.
- 💰 A free Apify account includes $5 in monthly credits — enough to test this actor.
- ⏳ Scrape during the free trial, with no commitment or upfront payment required.

### Key features

- **🏀 Player line and team totals on the same row:** every row is one player in one game: minutes, points, field goals, three pointers and free throws as made/attempted/percentage, offensive and defensive rebounds, assists, turnovers, steals, blocks, personal fouls and plus/minus. The same row also carries that team's full totals — including largest lead, technical and flagrant fouls, and team turnovers — so team-level analysis needs no second run and no join.
- **🔁 The opponent, the venue and the result, already joined:** each row names the opposing team, its id, abbreviation, city and logo, its score, the margin, the venue and whether this row's team won. Filter to a matchup or a result without touching a second dataset.
- **🗓️ A season, a date range or a single game:** `query` takes `season:2025` for a whole season, `2025-03-15` for one night, `2025-03-14..2025-03-16` for a range, or `game:401705534` for one box score. Leave it empty and you get the current season. Use a JSON array to run several at once.
- **♻️ Only what changed — including corrected statlines:** recurring runs deliver and charge only for rows that are new or whose tracked content moved — the change signature covers the whole delivered row, so a corrected statline or a score that settled after a half-time scrape is caught. Opt into UNCHANGED and EXPIRED rows when you need the full picture.
- **⚡ One request per game, no proxy, no browser:** A single request returns both rosters and both teams' totals — roughly 26 rows — as plain JSON. Measured 2026-09-03 from a bare datacenter IP with no proxy and no browser: 4 requests returned 82 rows in 2.0 seconds.
- **🔔 Notifications:** Telegram, Slack, Discord, WhatsApp Cloud API and a generic webhook, out of the box.
- **📦 Compact and empty-field stripping:** `compact` keeps the identity and the core line; `excludeEmptyFields` drops nulls before push. Both shrink payloads for AI agents and dashboards.

### What data can you extract from espn.com?

Every row is one player in one game, and carries four blocks.

**The player's line** — `minutesPlayed`, `pointsTotal`, `fieldGoalsMade` / `fieldGoalsAttempted` / `fieldGoalsPct`, the same three for three pointers and free throws, `reboundsTotal` / `reboundsOffensive` / `reboundsDefensive`, `assistsTotal`, `turnoversTotal`, `assistsToTurnoversRatio`, `stealsTotal`, `blocksTotal`, `foulsPersonal`, `plusMinus` and `plusMinusNumeric`. Players who did not dress still get a row, flagged with `playerDidNotPlay`, `playerActive` and `playerEjected`, so a roster is never silently short.

**The player** — `playerId`, `playerDisplayName`, `playerShortName`, `playerJersey`, `playerPosition`, `playerPositionAbbr`, `playerHeadshot` and `playerStarter`.

**The team's totals, on the same row** — shooting splits with percentages, `teamReboundsTotal` / `teamReboundsOffensive` / `teamReboundsDefensive`, `teamAssistsTotal`, `teamTurnoversTotal`, `teamTurnoversNonPlayer`, `teamAssistsToTurnoversRatio`, `teamStealsTotal`, `teamBlocksTotal`, and `teamFoulsPersonal` / `teamFoulsTechnical` / `teamFoulsFlagrant`. Team-level analysis therefore needs no second run and no join.

**The game** — `gameId`, `gameDate`, `gameDatetime`, `gameSeason`, `gameSeasonTypeName` (Preseason, Regular Season, Play-In Season, Postseason), `teamHomeAway` and `teamIsHome` (home/away splits need no lookup), `teamVenue` with `teamVenueCity` and `teamVenueState`, the quarter-by-quarter score for both sides (`teamQ1Points`..`teamQ4Points`, `teamOvertimePoints` and the matching `opponent*` columns), the full opponent block (`opponentNameFull`, `opponentAbbreviation`, `opponentCity`, `opponentMascot`, `opponentLogo`, `opponentScore`), `scorePointsFor`, `scorePointsAgainst`, `scoreMargin`, `scoreLargestLead` and `teamOutcome`.

Not included: play-by-play, betting odds, standings, injury reports and ESPN's news articles. They ride along in the same response and are a different product; see `docs/FIELD_COVERAGE.md` for the full list and the reason for each.

### Input

The main inputs are a search keyword and a result limit. Additional filters and options are available in the input schema.

Key parameters:

- **`query`** — A season (`season:2025`), a date (`2025-03-15`), a date range (`2025-03-14..2025-03-16`) or one game (`game:401705534`). Leave empty for the current season. Use a JSON array for several, e.g. `["season:2024","season:2025"]`.
- **`teams`** — Only games involving these teams. Abbreviation or name both work: BOS, Celtics, Boston Celtics. Applied when the calendar is read, so you are not charged for the other 29 teams. Leave empty for every team.
- **`maxResults`** — Maximum rows to deliver. One game is about 26 rows (both rosters), one night about 200, a full regular season about 32,000. (default: `100`)
- **`compact`** — Core fields only (for AI-agent/MCP workflows). (default: `false`)
- **`incrementalMode`** — Deliver only rows that are new or whose stats changed since the last run — ESPN corrects box scores after the final whistle. stateKey is optional and defaults to one derived from what you asked for, so two different queries never share state. (default: `false`)
- **`stateKey`** — Optional. Stable identifier for the tracked search universe. Leave empty to auto-generate from search inputs.
- **`telegramToken`** — Telegram bot token (from @BotFather). Required for Telegram notifications.
- **`telegramChatId`** — Telegram chat or channel ID (e.g. "-100123456789"). Required when telegramToken is set.
- **`discordWebhookUrl`** — Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook.
- **`slackWebhookUrl`** — Slack incoming webhook URL. api.slack.com/messaging/webhooks.
- **`notificationLimit`** — Maximum number of listings included in each notification message (1–20). (default: `5`)
- **`notifyOnlyChanges`** — When Incremental Mode is on, only send notifications for NEW and UPDATED listings. Has no effect outside incremental mode. (default: `false`)
- ...and 10 more parameters

### Input examples

**Basic search** — Keyword-driven search with a result cap.

→ Full payload per result — all standard fields populated where the source provides them.

```json
{
  "query": "season:2025",
  "maxResults": 50
}
```

**Incremental tracking** — Only emit box score rows that changed since the previous run with this `stateKey`.

→ First run builds the baseline state. Subsequent runs emit only records that are new or whose tracked content changed. Set `emitUnchanged: true` to include unchanged records as well.

```json
{
  "query": "season:2025",
  "maxResults": 200,
  "incrementalMode": true,
  "stateKey": "season:2025-tracker"
}
```

**Compact output for AI agents** — Return only core fields for AI-agent and MCP workflows.

→ Small payload with the most important fields — ideal for piping into LLMs without token overhead.

```json
{
  "query": "season:2025",
  "maxResults": 50,
  "compact": true
}
```

### Output

Each run produces a dataset of structured box score row records. Results can be downloaded as JSON, CSV, or Excel from the Dataset tab in Apify Console.

### Example box score row record

```json
{
  "recordType": "playerGame",
  "gameId": "401812480",
  "gameDate": "2025-10-02",
  "gameDatetime": "2025-10-02T16:00Z",
  "gameSeason": 2026,
  "gameSeasonType": 1,
  "gameSeasonTypeName": "Preseason",
  "gameOutcome": "L",
  "teamId": "20",
  "teamNameFull": "Philadelphia 76ers",
  "teamAbbreviation": "PHI",
  "teamCity": "Philadelphia",
  "teamMascot": "76ers",
  "teamLogo": "https://a.espncdn.com/i/teamlogos/nba/500/phi.png",
  "teamHomeAway": "away",
  "teamIsHome": false,
  "teamVenue": "Etihad Arena",
  "teamVenueCity": "Abu Dhabi",
  "teamOutcome": "L",
  "opponentId": "18",
  "opponentNameFull": "New York Knicks",
  "opponentAbbreviation": "NY",
  "opponentCity": "New York",
  "opponentMascot": "Knicks",
  "opponentLogo": "https://a.espncdn.com/i/teamlogos/nba/500/ny.png",
  "opponentScore": 99,
  "scorePointsFor": 84,
  "scorePointsAgainst": 99,
  "scoreMargin": -15,
  "scoreLargestLead": 6,
  "teamQ1Points": 25,
  "teamQ2Points": 18,
  "teamQ3Points": 14,
  "teamQ4Points": 27,
  "teamOvertimePoints": 0,
  "opponentQ1Points": 25,
  "opponentQ2Points": 28,
  "opponentQ3Points": 28,
  "opponentQ4Points": 18,
  "opponentOvertimePoints": 0,
  "teamFieldGoalsMade": 27,
  "teamFieldGoalsAttempted": 78,
  "teamFieldGoalsPct": 35,
  "teamThreePointersMade": 3,
  "teamThreePointersAttempted": 35,
  "teamThreePointersPct": 9,
  "teamFreeThrowsMade": 27,
  "teamFreeThrowsAttempted": 32,
  "teamFreeThrowsPct": 84,
  "teamReboundsTotal": 46,
  "teamReboundsOffensive": 10,
  "teamReboundsDefensive": 36,
  "teamAssistsTotal": 17,
  "teamTurnoversTotal": 20,
  "teamTurnoversNonPlayer": 0,
  "teamAssistsToTurnoversRatio": 0.85,
  "teamStealsTotal": 8,
  "teamBlocksTotal": 5,
  "teamFoulsPersonal": 24,
  "teamFoulsTechnical": 0,
  "teamFoulsFlagrant": 0,
  "playerId": "4870562",
  "playerDisplayName": "Dominick Barlow",
  "playerShortName": "D. Barlow",
  "playerJersey": "25",
  "playerPosition": "Forward",
  "playerPositionAbbr": "F",
  "playerHeadshot": "https://a.espncdn.com/i/headshots/nba/players/full/4870562.png",
  "playerStarter": true,
  "playerActive": true,
  "playerDidNotPlay": false,
  "playerEjected": false,
  "minutesPlayed": 30,
  "pointsTotal": 6,
  "fieldGoalsMade": 2,
  "fieldGoalsAttempted": 5,
  "fieldGoalsPct": 40,
  "threePointersMade": 0,
  "threePointersAttempted": 2,
  "threePointersPct": 0,
  "freeThrowsMade": 2,
  "freeThrowsAttempted": 2,
  "freeThrowsPct": 100,
  "reboundsTotal": 10,
  "reboundsOffensive": 1,
  "reboundsDefensive": 9,
  "assistsTotal": 2,
  "turnoversTotal": 1,
  "assistsToTurnoversRatio": 2,
  "stealsTotal": 1,
  "blocksTotal": 0,
  "foulsPersonal": 4,
  "plusMinus": "+9",
  "plusMinusNumeric": 9,
  "name": "Dominick Barlow",
  "listingId": "06e8eeabfa1d87b31760a0afb472cd32965b168cd5d5bb1d9e5db284e427d276",
  "url": "https://www.espn.com/nba/boxscore/_/gameId/401812480",
  "portalUrl": "https://www.espn.com/nba/boxscore/_/gameId/401812480",
  "searchQuery": "season:2026",
  "contentQuality": "full",
  "detailFetched": false,
  "scrapedAt": "2026-09-03T21:25:08.503Z",
  "source": "espn.com",
  "contentHash": "059143bde501e7c7388921065d06723b1cf06ce1f406db7e97c85a393f2317ba"
}
```

### Incremental fields

When incremental mode is on, each record also carries:

- `changeType` — one of `NEW`, `UPDATED`, `UNCHANGED`, `REAPPEARED`, `EXPIRED`. Default output covers `NEW` / `UPDATED` / `REAPPEARED`; set `emitUnchanged: true` or `emitExpired: true` to opt into the others.

### How to scrape espn.com

1. Go to [NBA Stats Scraper for espn.com](https://apify.com/blackfalcondata/espn-nba-scraper?fpr=1h3gvi) in Apify Console.
2. Enter a search keyword.
3. Set `maxResults` to control how many results you need.
4. Click **Start** and wait for the run to finish.
5. Export the dataset as JSON, CSV, or Excel.

### Use cases

- Extract box score row data from espn.com for market research and competitive analysis.
- Monitor new and changed box score rows on scheduled runs without processing the full dataset every time.
- Feed structured data into AI agents, MCP tools, and automated pipelines using compact mode.
- Export clean, structured data to dashboards, spreadsheets, or data warehouses.

### How much does it cost to scrape espn.com?

NBA Stats Scraper for espn.com uses [pay-per-event](https://docs.apify.com/platform/actors/paid-actors/pay-per-event) pricing. You pay a small fee when the run starts and then for each result that is actually produced.

- **Run start:** $0.001 per run
- **Per result:** $0.0005 per box score row record

Example costs:

- 10 results: **$0.006**
- 25 results: **$0.014**
- 100 results: **$0.051**
- 200 results: **$0.1**
- 500 results: **$0.25**

#### Example: recurring monitoring savings

These examples compare full re-scrapes with incremental runs at different churn rates. Churn is the share of box score rows that are new or whose tracked content changed since the previous run. Actual churn depends on your query breadth, source activity, and polling frequency — the scenarios below are examples, not predictions.

Example setup: 250 box score rows per run, daily polling (30 runs/month). Costs scale linearly with the number of box score rows.

| Churn rate | Full re-scrape run cost | Incremental run cost | Savings vs full re-scrape | Monthly cost after baseline |
|---|---:|---:|---:|---:|
| 5% — stable niche query | $0.13 | $0.00725 | $0.12 (94%) | $0.22 |
| 15% — moderate broad query | $0.13 | $0.02 | $0.11 (84%) | $0.59 |
| 30% — high-volume aggregator | $0.13 | $0.04 | $0.09 (69%) | $1.16 |

Full re-scrape monthly cost at the same cadence: $3.78. First month with incremental costs $0.34 / $0.70 / $1.24 for the 5% / 15% / 30% scenarios because the first run builds baseline state at full cost before incremental savings apply.

Platform usage is included in the per-result fee shown above.

### FAQ

#### How many results can I get from espn.com?

The number of results depends on the search query and available box score rows on espn.com. Use the `maxResults` parameter to control how many results are returned per run.

#### Does NBA Stats Scraper for espn.com support recurring monitoring?

Yes. Enable incremental mode to only receive new or changed box score rows on subsequent runs. This is ideal for scheduled monitoring where you want to track changes over time without re-processing the full dataset.

#### Can I integrate NBA Stats Scraper for espn.com with other apps?

Yes. NBA Stats Scraper for espn.com works with Apify's [integrations](https://apify.com/integrations?fpr=1h3gvi) to connect with tools like Zapier, Make, Google Sheets, Slack, and more. You can also use webhooks to trigger actions when a run completes.

#### Can I use NBA Stats Scraper for espn.com with the Apify API?

Yes. You can start runs, manage inputs, and retrieve results programmatically through the [Apify API](https://docs.apify.com/api/v2). Client libraries are available for JavaScript, Python, and other languages.

#### Can I use NBA Stats Scraper for espn.com through an MCP Server?

Yes. Apify provides an [MCP Server](https://apify.com/apify/actors-mcp-server?fpr=1h3gvi) that lets AI assistants and agents call this actor directly. Use compact mode and `excludeEmptyFields` to keep payloads manageable for LLM context windows.

#### Is it legal to scrape espn.com?

This actor extracts publicly available data from espn.com. Web scraping of public information is generally considered legal, but you should always review the target site's terms of service and ensure your use case complies with applicable laws and regulations, including GDPR where relevant.

#### Your feedback

If you have questions, need a feature, or found a bug, please [open an issue](https://apify.com/blackfalcondata/espn-nba-scraper/issues?fpr=1h3gvi) on the actor's page in Apify Console. Your feedback helps us improve.

### You might also like

- [Betano Odds API — Live and Pre-Match Odds, 14 Countries](https://apify.com/blackfalcondata/betano-odds-api?fpr=1h3gvi) — $3 day pass or $0.002 per call. Betano odds as a REST API: pre-match and live with score and clock,.
- [Betano Odds Scraper — Live + All Markets, 14 Countries](https://apify.com/blackfalcondata/betano-scraper?fpr=1h3gvi) — Scrape Betano betting odds from 14 country books at $3 per 1,000 events: pre-match and in-play.
- [MLB Stats Scraper 💰$2/1K — Scores, Standings & Stats](https://apify.com/blackfalcondata/mlb-scraper?fpr=1h3gvi) — Scrape statsapi.mlb.com for teams, rosters, schedules, live scores, standings, season batting,.
- [Sportradar Match Stats Scraper — Lineups, Timeline, Players](https://apify.com/blackfalcondata/sportradar-stats-scraper?fpr=1h3gvi) — Match statistics from Sportradar at $2 per 1,000 matches plus $1 per 1,000 data layers: lineups,.
- [Transfermarkt \[Just 💰$0.5\] — football market values](https://apify.com/blackfalcondata/transfermarkt-market-value-scraper?fpr=1h3gvi) — 💰 $0.5 per 1,000 records. Scrape transfermarkt.com — player market values with full history ·.
- [UFC & MMA Stats Scraper for espn.com — $0.50/1k](https://apify.com/blackfalcondata/espn-mma-scraper?fpr=1h3gvi) — Scrape espn.com for MMA fights, fighters, rankings and events at $0.50 per 1,000 rows — the lowest.

### Getting started with Apify

New to Apify? [Create a free account with $5 credit](https://console.apify.com/sign-up?fpr=1h3gvi) — no credit card required.

1. Sign up — $5 platform credit included
2. Open this actor and configure your input
3. Click **Start** — export results as JSON, CSV, or Excel

Need more later? [See Apify pricing](https://apify.com/pricing?fpr=1h3gvi).

### Disclaimer

This actor accesses only publicly available data on espn.com. You are responsible for how you use the extracted data — in particular any personal information such as names, phone numbers, or email addresses — and for complying with NBA Stats's terms of use, applicable data-protection law (including the GDPR where it applies), and the anti-spam rules of your jurisdiction.

This actor is not affiliated with, endorsed by, or connected to NBA Stats.

### Search keywords

espn scraper, espn api, apify espn, espn data extraction, nba stats scraper, nba stats api, apify nba stats, nba stats data extraction, espn.com scraper, espn.com data, espn.com api.

# Actor input Schema

## `query` (type: `string`):

A season (`season:2025`), a date (`2025-03-15`), a date range (`2025-03-14..2025-03-16`) or one game (`game:401705534`). Leave empty for the current season. Use a JSON array for several, e.g. `["season:2024","season:2025"]`.

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

Only games involving these teams. Abbreviation or name both work: BOS, Celtics, Boston Celtics. Applied when the calendar is read, so you are not charged for the other 29 teams. Leave empty for every team.

## `maxResults` (type: `integer`):

Maximum rows to deliver. One game is about 26 rows (both rosters), one night about 200, a full regular season about 32,000.

## `compact` (type: `boolean`):

Core fields only (for AI-agent/MCP workflows).

## `incrementalMode` (type: `boolean`):

Deliver only rows that are new or whose stats changed since the last run — ESPN corrects box scores after the final whistle. stateKey is optional and defaults to one derived from what you asked for, so two different queries never share state.

## `stateKey` (type: `string`):

Optional. Stable identifier for the tracked search universe. Leave empty to auto-generate from search inputs.

## `telegramToken` (type: `string`):

Telegram bot token (from @BotFather). Required for Telegram notifications.

## `telegramChatId` (type: `string`):

Telegram chat or channel ID (e.g. "-100123456789"). Required when telegramToken is set.

## `discordWebhookUrl` (type: `string`):

Discord incoming webhook URL. Server Settings → Integrations → Webhooks → New Webhook.

## `slackWebhookUrl` (type: `string`):

Slack incoming webhook URL. api.slack.com/messaging/webhooks.

## `notificationLimit` (type: `integer`):

Maximum number of listings included in each notification message (1–20).

## `notifyOnlyChanges` (type: `boolean`):

When Incremental Mode is on, only send notifications for NEW and UPDATED listings. Has no effect outside incremental mode.

## `whatsappAccessToken` (type: `string`):

WhatsApp Cloud API permanent access token (System User token from Meta Business). Recipient must have messaged the business number within the last 24h (service-conversation window — free since Nov 2024).

## `whatsappPhoneNumberId` (type: `string`):

Your WhatsApp Business phone-number ID (numeric, from Meta dashboard). Required when whatsappAccessToken is set.

## `whatsappTo` (type: `string`):

Recipient phone in E.164 format without + (e.g. "436641234567"). Recipient must have messaged your business number within last 24h.

## `webhookUrl` (type: `string`):

Receives a JSON POST with {metadata, items} after each run. Universal escape hatch for n8n / Make / Zapier / custom backends.

## `webhookHeaders` (type: `object`):

Optional JSON object of custom headers (e.g. {"Authorization":"Bearer ..."}).

## `appConnector` (type: `string`):

Optional. Pick a connected app under Settings → API & Integrations to receive your results (including any contact details). Best-effort across MCP connectors as Apify expands its catalog.

## `mcpIssueTeam` (type: `string`):

Only when the connected app is an issue tracker: the team (name or ID) the summary issue is created under, if that app requires one.

## `excludeEmptyFields` (type: `boolean`):

Drop null, empty-string, and empty-array fields from each record before push. Smaller payloads for AI agents and dashboards.

## `emitUnchanged` (type: `boolean`):

When incremental, also deliver rows whose stats did not move since the last run.

## `emitExpired` (type: `boolean`):

When incremental, also deliver rows that are no longer returned for the query.

## Actor input object example

```json
{
  "query": "season:2025",
  "teams": [
    "BOS"
  ],
  "maxResults": 100,
  "compact": false,
  "incrementalMode": false,
  "notificationLimit": 5,
  "notifyOnlyChanges": false,
  "excludeEmptyFields": false,
  "emitUnchanged": false,
  "emitExpired": false
}
```

# 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 = {
    "query": "season:2025",
    "teams": [
        "BOS"
    ],
    "maxResults": 100,
    "excludeEmptyFields": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("blackfalcondata/espn-nba-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 = {
    "query": "season:2025",
    "teams": ["BOS"],
    "maxResults": 100,
    "excludeEmptyFields": False,
}

# Run the Actor and wait for it to finish
run = client.actor("blackfalcondata/espn-nba-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 '{
  "query": "season:2025",
  "teams": [
    "BOS"
  ],
  "maxResults": 100,
  "excludeEmptyFields": false
}' |
apify call blackfalcondata/espn-nba-scraper --silent --output-dataset

```

## MCP server setup

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