# Basketball API Scraper — Box Scores, Stats & Standings (`sian.agency/basketball-api-scraper`) Actor

Basketball data API: per-player box scores with points, rebounds, assists, steals, blocks, plus-minus and field goal percentage; league standings with win percentage and games behind; season schedules, quarter-by-quarter scores, play-by-play, rosters with salaries, live games and point spreads.

- **URL**: https://apify.com/sian.agency/basketball-api-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** Sports, Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 game extracteds

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/platform/actors/running/actors-in-store#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

## Basketball API Scraper — Box Scores, Stats & Standings 🚀

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Sports Data Scraper](https://img.shields.io/badge/Store-Sports%20Data%20Scraper-1AE392)](https://apify.com/sian.agency/sports-data-scraper?fpr=sian) [![Sports Betting Odds Scraper](https://img.shields.io/badge/Store-Sports%20Betting%20Odds-1AE392)](https://apify.com/sian.agency/sports-betting-odds-scraper?fpr=sian) [![Instagram AI Transcript Extractor](https://img.shields.io/badge/Store-Instagram%20AI%20Transcript-E4405F)](https://apify.com/sian.agency/instagram-ai-transcript-extractor?fpr=sian)

#### 🎉 Full per-player box scores — 22 stat columns for every player in every game

##### Built for fantasy tools, live score widgets, stat dashboards and betting models

***

### 🔍 What is the Basketball API Scraper — and when should you use it?

The **Basketball API Scraper** turns basketball competitions, games, teams and players into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** per-player box scores (points, rebounds, offensive and defensive rebounds, assists, steals, blocks, turnovers, personal fouls, plus-minus, minutes played, field goals made and attempted, field goal percentage, two-pointers, three-pointers, free throws, player rating), league standings (wins, losses, win percentage, games behind, streak, points for, points against, point differential, qualification), season and team schedules with quarter-by-quarter scoring and playoff series score, shot-classified play-by-play, team profiles with arena and head coach, rosters with jersey numbers and salaries, player profiles with height, weight and contract dates, per-quarter team statistics, point spread and game total odds, and games in progress right now.

**Use something else when:** you need football, tennis, F1, MMA or esports. Use [Sports Data Scraper](https://apify.com/sian.agency/sports-data-scraper?fpr=sian) for 30+ sports, or [Football API Scraper](https://apify.com/sian.agency/football-api-scraper?fpr=sian) for football fixtures, tables and lineups. If you only want bookmaker lines across many sports, use [Sports Betting Odds Scraper](https://apify.com/sian.agency/sports-betting-odds-scraper?fpr=sian).

***

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/basketball-api-scraper

**Your agent can pay for its own runs.** This Actor is eligible for [agentic payments](https://docs.apify.com/platform/actors/publishing/monetize), so an agent can discover it, run it and settle the bill over [x402](https://www.x402.org/) (USDC on Base) or [Skyfire](https://www.skyfire.xyz/) — without an Apify account or API token of its own. Billing is the same either way: per successful row, never for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want a per-player box score for a basketball game using the Apify Actor `sian.agency/basketball-api-scraper`.

Use it when I need: box scores, league standings, season and team schedules, play-by-play, team and player profiles, rosters with salaries, team statistics, point spreads and live games — for basketball.

Don't use it when: I need football, tennis, F1, MMA or esports — use `sian.agency/sports-data-scraper` instead.

How to call it: set `operation` to one of
- searchCompetitions (needs `query`, e.g. "EuroLeague") — find a competitionId
- competitionSeasons (needs `competitionId`) — find a seasonId
- seasonSchedule (needs `competitionId` + `seasonId`) — games, returns gameId and team IDs
- leagueStandings (needs `competitionId` + `seasonId`)
- teamProfile / teamSchedule / teamRoster (need `teamId`)
- playerProfile (needs `playerId`)
- gameSummary / gameBoxScore / gamePlayByPlay / gameTeamStats / gameOdds (need `gameId`)
- liveGames (needs nothing)

Start with this input:
{
  "operation": "gameBoxScore",
  "gameId": "13753624"
}

Ask me which competition and which game I care about, chain searchCompetitions to
competitionSeasons to seasonSchedule to get the IDs, then run the Actor and summarise
the results as a table sorted by points.
```

**Things you can ask your agent for:**

- *"Find the EuroLeague, pull last season's final standings, and tell me which team had the best point differential."*
- *"Get the box score for the most recent game team 3428 played and rank the players by plus-minus."*
- *"Pull the last 90 games of competition 132 season 65360 and show me every game decided by 3 points or fewer."*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/basketball-api-scraper.md](https://apify.com/sian.agency/basketball-api-scraper.md).

***

### 📋 Overview

**Basketball data, finally shaped like basketball.** Most general sports scrapers return football-shaped rows — halves instead of quarters, cards instead of baskets, points tables instead of win-loss records. This Actor is built and tested against basketball payloads only, so every column arrives populated.

**Why professionals choose us:**

- ✅ **22 box-score columns per player**: points, rebounds (total, offensive, defensive), assists, steals, blocks, turnovers, personal fouls, plus-minus, minutes, field goals, three-pointers, free throws, field goal percentage and player rating
- ⚡ **Whole leagues in one call**: standings return every conference, division and league-wide table together — up to 90 rows from a single operation
- 🎯 **Real basketball vocabulary**: win percentage, games behind, streak, point differential, quarter-by-quarter scoring, playoff series score, one/two/three-point shot classification
- 💰 **Pay only for the operation you ran**: 14 discrete charge events instead of one blanket per-row fee, so pulling a standings table never costs the same as pulling 109 play-by-play rows
- 💎 **Salary and contract data**: roster and player rows carry salary amount, currency and contract expiry
- ✨ **Basketball-only search**: competition search is filtered to basketball, so a query never buries you in other sports

***

### ✨ Features

- 🏀 **Game Box Score**: every player from both benches with a full statistical line
- 📋 **League Standings**: wins, losses, win percentage, games behind, streak, points for and against
- 🗓️ **Season Schedule**: paginated game lists with final scores and quarter splits
- 📆 **Team Schedule**: one team's played or upcoming games
- ⏱️ **Play-by-Play**: every basket classified as a one, two or three-pointer with running score
- 📈 **Game Team Stats**: team totals split by full game and by quarter
- 👥 **Team Roster**: jersey number, position, height, weight, nationality, salary, contract
- 👤 **Player Profile**: full biography with salary and contract dates
- 🏟️ **Team Profile**: arena, capacity, city, head coach, team colours, recent form
- 💱 **Game Odds**: point spread, game total, quarter and half markets with opening and current prices
- 🔴 **Live Games**: everything tipped off right now, with quarter scores and current period
- 🔍 **Competition Search**: find any competition by name, basketball results only
- 📤 **Export anywhere**: JSON, CSV, Excel straight from the Apify dataset
- 🧾 **HTML run report**: every run writes a summary report to the key-value store

***

### 🎬 Quick Start

Pick an operation, supply the one or two IDs it needs, and run. Every schedule row hands you the `gameId` and team IDs for the next operation, so you can chain from a competition name to a full box score in three runs.

```bash
curl -X POST https://api.apify.com/v2/acts/sian.agency~basketball-api-scraper/runs?token=YOUR_TOKEN \
-H 'Content-Type: application/json' \
-d '{"operation": "gameBoxScore", "gameId": "13753624"}'
```

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Find your competition

Run `searchCompetitions` with a name like "EuroLeague", "NCAA" or "Liga ACB". Results are basketball only, and each row gives you a `competitionId`.

#### Step 2: Pick a season and pull the schedule

Run `competitionSeasons` with that `competitionId` to get a `seasonId`, then `seasonSchedule` to list the games. Every row carries a `gameId`, `homeTeam.id` and `awayTeam.id`.

#### Step 3: Go deep on what matters

Feed a `gameId` into `gameBoxScore`, `gamePlayByPlay`, `gameTeamStats` or `gameOdds` — or feed a `teamId` into `teamRoster` for salaries and jersey numbers.

**That's it! In under a minute, you'll have:**

- A full per-player statistical line for any game
- A complete league table with win percentage and games behind
- A season's worth of results with quarter-by-quarter scoring

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `operation` | string | Yes | Which dataset to extract (see the 14 operations below) |
| `query` | string | No | Competition name to search for (`searchCompetitions`) |
| `competitionId` | string | No | Numeric competition ID (`competitionSeasons`, `seasonSchedule`, `leagueStandings`) |
| `seasonId` | string | No | Numeric season ID (`seasonSchedule`, `leagueStandings`) |
| `teamId` | string | No | Numeric team ID (`teamProfile`, `teamSchedule`, `teamRoster`) |
| `playerId` | string | No | Numeric player ID (`playerProfile`) |
| `gameId` | string | No | Numeric game ID (all five `game*` operations) |
| `standingsType` | string | No | `total`, `home` or `away` (`leagueStandings`) |
| `gameWindow` | string | No | `played` or `upcoming` (both schedule operations) |
| `page` | integer | No | Zero-based start page for paginated operations |
| `maxPages` | integer | No | How many pages to fetch, up to 50 (30 games per page) |

**The 14 operations:** `searchCompetitions`, `competitionSeasons`, `seasonSchedule`, `leagueStandings`, `teamProfile`, `teamSchedule`, `teamRoster`, `playerProfile`, `gameSummary`, `gameBoxScore`, `gamePlayByPlay`, `gameTeamStats`, `gameOdds`, `liveGames`.

**Example — box score:**

```json
{
  "operation": "gameBoxScore",
  "gameId": "13753624"
}
```

**Example — full league table:**

```json
{
  "operation": "leagueStandings",
  "competitionId": "132",
  "seasonId": "65360",
  "standingsType": "total"
}
```

**Example — a season of results:**

```json
{
  "operation": "seasonSchedule",
  "competitionId": "132",
  "seasonId": "65360",
  "gameWindow": "played",
  "maxPages": 3
}
```

***

### 📤 Output

Results are saved to the Apify dataset. The field set depends on the operation — here are the most valuable columns:

| Field | Type | Description |
|-------|------|-------------|
| `playerName` | string | Player full name (box score, roster, play-by-play) |
| `points` | number | Points scored |
| `rebounds` | number | Total rebounds, plus `offensiveRebounds` and `defensiveRebounds` |
| `assists` | number | Assists |
| `steals` / `blocks` / `turnovers` | number | Defensive and ball-security counts |
| `plusMinus` | number | Point differential while the player was on court |
| `minutesPlayed` | number | Minutes played, to one decimal |
| `fieldGoalPct` | number | Field goal percentage |
| `threePointsMade` / `threePointAttempts` | number | Three-point shooting split |
| `wins` / `losses` / `winPercentage` | number | Standings record |
| `gamesBehind` / `streak` / `pointDifferential` | number/string | Standings context |
| `homeQuarterScores` / `awayQuarterScores` | object | Points by quarter (`q1`–`q4`) plus `overtime` |
| `homeSeriesWins` / `awaySeriesWins` | number | Playoff series score |
| `shotType` | string | `onePoint`, `twoPoints` or `threePoints` |
| `salaryAmount` / `salaryCurrency` | number/string | Player salary |
| `arenaName` / `arenaCapacity` / `headCoach` | string/number | Team profile detail |
| `decimalOdds` / `fractionalOdds` / `movement` | number/string | Odds with price movement |
| `status` / `errorMessage` | string | Row outcome; error rows are never charged |

**Example — one box-score row:**

```json
{
  "gameId": 13753624,
  "side": "home",
  "teamId": 3428,
  "playerId": 1132126,
  "playerName": "Jonathan Kuminga",
  "jerseyNumber": "0",
  "position": "F",
  "isStarter": false,
  "minutesPlayed": 25.6,
  "points": 30,
  "rebounds": 6,
  "offensiveRebounds": 2,
  "defensiveRebounds": 4,
  "assists": 3,
  "steals": 0,
  "blocks": 2,
  "turnovers": 1,
  "personalFouls": 3,
  "plusMinus": 8,
  "playerRating": 8.4,
  "fieldGoalsMade": 11,
  "fieldGoalAttempts": 21,
  "fieldGoalPct": 52,
  "threePointsMade": 2,
  "threePointAttempts": 5,
  "freeThrowsMade": 6,
  "freeThrowAttempts": 7,
  "_operation": "gameBoxScore",
  "status": "success"
}
```

**Example — one standings row:**

```json
{
  "tableName": "Eastern Conference",
  "position": 1,
  "teamId": 3432,
  "teamName": "Cleveland Cavaliers",
  "gamesPlayed": 82,
  "wins": 64,
  "losses": 18,
  "winPercentage": 0.78,
  "gamesBehind": 0,
  "streak": -1,
  "pointsFor": 9999,
  "pointsAgainst": 9217,
  "pointDifferential": "+782",
  "qualification": "Playoffs",
  "_operation": "leagueStandings",
  "status": "success"
}
```

***

### 💼 Use Cases & Examples

#### 1. Fantasy Basketball Draft Boards

**Fantasy platform developers building projections from real per-player production.**

**Input:** `gameBoxScore` for every game in a season, chained from `seasonSchedule`
**Output:** One row per player per game with 22 statistical columns
**Use:** Rolling averages, usage rates, minutes trends and plus-minus splits that drive draft rankings and weekly waiver advice.

#### 2. Live Score Widgets

**Front-end teams shipping an in-play scoreboard.**

**Input:** `liveGames` on a short schedule
**Output:** Every basketball game in progress with current score, quarter splits and status
**Use:** Auto-refreshing widgets and mobile push alerts, covering professional, college and international competitions in one call.

#### 3. Team & Player Season Dashboards

**Analytics teams tracking form, rosters and payroll.**

**Input:** `leagueStandings`, `teamRoster` and `teamSchedule`
**Output:** Complete league tables, roster lines with salary and contract expiry, and full game logs
**Use:** Season-long dashboards showing record, streak, games behind, roster turnover and payroll commitment side by side.

#### 4. Betting Model Inputs

**Quantitative modellers building basketball price models.**

**Input:** `gameOdds` plus `gameTeamStats` and `gamePlayByPlay` for the same games
**Output:** Point spreads and game totals with opening and current prices, alongside quarter-level team stats and shot-classified scoring sequences
**Use:** Backtest closing-line value, model quarter-scoring distributions and quantify three-point variance.

#### 5. Sports Media & Editorial Research

**Journalists, newsletters and academics who need reliable historical data.**

**Input:** `competitionSeasons` then `seasonSchedule` across multiple seasons
**Output:** Every game with final score, venue, round, attendance and playoff series state
**Use:** Match reports, record-tracking pieces, season retrospectives and reproducible academic datasets.

#### 6. Scouting & Recruitment Databases

**Scouts and agencies tracking players across leagues.**

**Input:** `searchCompetitions` across leagues, then `teamRoster` and `playerProfile`
**Output:** Player biographies with height, weight, position, nationality, salary and contract expiry
**Use:** Build a cross-league scouting database and flag players entering the final year of a contract.

#### 7. Quarter-Level Game Analysis

**Coaching and performance staff studying momentum.**

**Input:** `gameTeamStats` with the per-quarter split, plus `gamePlayByPlay`
**Output:** Team totals for every quarter (scoring, rebounds, assists, turnovers, biggest lead, time spent in lead) and every scoring play in sequence
**Use:** Identify which quarters a team wins or loses, and how scoring runs are built.

***

### 🔗 Integration Examples

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/basketball-api-scraper').call({
  operation: 'gameBoxScore',
  gameId: '13753624'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.sort((a, b) => b.points - a.points)[0]);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/basketball-api-scraper').call(
    run_input={'operation': 'leagueStandings', 'competitionId': '132', 'seasonId': '65360'}
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item['position'], item['teamName'], item['wins'], item['losses'], item['winPercentage'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~basketball-api-scraper/runs?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"operation": "seasonSchedule", "competitionId": "132", "seasonId": "65360", "maxPages": 3}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: Schedule (e.g. every 60 seconds during game hours)
2. **HTTP Request**: Call the Actor with `{"operation": "liveGames"}`
3. **Process**: Filter rows where `gameStatusType` is `inprogress`
4. **Action**: Post score changes to Slack, a database or a live widget

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- Full feature access — all 14 operations, same data quality
- No credit card required
- Perfect for evaluating field coverage before you commit

#### PAID Tier (Production Ready)

- Lower per-row rates that taper further as your Apify plan grows
- Charged **per successful row, per operation** — error rows are never billed
- Pulling a standings table costs standings rates, not play-by-play rates

💰 **Pay only for the operation you ran** — 14 discrete charge events instead of one blanket per-row fee.

🔗 [View current pricing](https://apify.com/sian.agency/basketball-api-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: Which competitions are covered?**
A: Professional, college and international basketball worldwide. Use `searchCompetitions` to find any competition by name — results are filtered to basketball.

**Q: How do I find the IDs the operations need?**
A: Chain them. `searchCompetitions` gives you `competitionId`, `competitionSeasons` gives you `seasonId`, and every `seasonSchedule` row gives you `gameId` plus `homeTeam.id` and `awayTeam.id`.

**Q: Why did my home or away standings return an error row?**
A: Competitions split into conferences or divisions publish the combined table only. Use `standingsType: "total"` — for those leagues it returns every conference, division and league-wide table in one run.

**Q: What output formats are available?**
A: JSON, CSV, Excel and XML — export directly from the Apify dataset.

**Q: Are historical seasons available?**
A: Yes. `competitionSeasons` lists every published season, often decades of them, and both schedule operations and standings accept any of those season IDs.

**Q: How current is live data?**
A: `liveGames` reflects games in progress at the moment of the run, including the current quarter and running score.

**Q: Do I get charged for rows that failed?**
A: No. Rows with `status: "error"` are written to the dataset so you can see what happened, but they are never charged.

**Q: How many games per page?**
A: Up to 30. `maxPages` controls how many pages to pull, and pagination stops early when no further pages exist.

***

### 🐛 Troubleshooting

**An operation returns "Not found — check the ID used for this operation."**

- IDs are operation-specific: a `teamId` will not work as a `gameId`.
- Re-derive the ID from the operation that produces it (`seasonSchedule` for `gameId`, `teamRoster` for `playerId`).

**`gameWindow: "upcoming"` returned completed games.**

- The competition or team has no scheduled fixtures right now (off-season, or the season has finished), so played games are returned instead. Check `gameStatusType` on each row.

**`gameBoxScore` returned an error row.**

- Box scores are published once a game has tipped off. For a fixture that has not started, use `gameSummary` for scheduling detail instead.

**`liveGames` returned an error row.**

- No basketball game was in progress at that moment. Schedule the run during game hours for your target competitions.

**Standings look shorter than expected.**

- Single-table competitions return one table; conference-and-division leagues return several. Check `tableName` on each row to see which table it belongs to.

***

### ⚠️ Trademark Disclaimer

All league, competition, team and player names, logos and marks referenced in this Actor's output are the property of their respective owners. SIÁN Agency is not affiliated with, endorsed by, or sponsored by any basketball league, federation, club or governing body. All names are used solely as factual identifiers to describe publicly available sports information. This Actor collects only publicly accessible data and does not access any private, subscription-gated or proprietary system.

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

***

### 🤝 Support

[![Telegram Support](https://img.shields.io/badge/Telegram-Support%20Group-0088cc?logo=telegram)](https://t.me/+vyh1sRE08sAxMGRi)

**Join our active support community**

- For issues or questions, open an issue in the actor's Issues tab
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Actor input Schema

## `operation` (type: `string`):

🏀 Which basketball dataset to extract. Chain: Search Competitions (name → competitionId) → Competition Seasons (→ seasonId) → Season Schedule (→ gameId, teamId) → Game Box Score.

Schedules give games with quarter scores (paginated). Standings give wins, losses, win %, games behind, streak. Team Profile gives arena and coach. Roster and Player Profile give jersey, position, salary. Box Score gives per-player points, rebounds, assists, plus-minus. Also Play-by-Play, Team Stats, Odds, Live.

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

🔍 Competition name to search for. Used by **Search Competitions** only. Results are filtered to basketball. Examples: "NBA", "EuroLeague", "NCAA", "Liga ACB", "WNBA", "Basketball Champions League".

## `competitionId` (type: `string`):

🏆 Numeric competition ID. Used by **Competition Seasons**, **Season Schedule** and **League Standings**. Look one up with the Search Competitions operation. Example: 132 (a major North American professional league), 138 (top European club competition).

## `seasonId` (type: `string`):

📅 Numeric season ID. Used by **Season Schedule** and **League Standings**. Look one up with the Competition Seasons operation. Example: 65360 (the 2024/2025 season of competition 132).

## `teamId` (type: `string`):

🏟️ Numeric team ID. Used by **Team Profile**, **Team Schedule** and **Team Roster**. Team IDs appear in every Season Schedule row under homeTeam.id and awayTeam.id. Example: 3428.

## `playerId` (type: `string`):

👤 Numeric player ID. Used by **Player Profile**. Player IDs appear in every Team Roster and Game Box Score row under playerId. Example: 817122.

## `gameId` (type: `string`):

🏀 Numeric game ID. Used by **Game Summary**, **Game Box Score**, **Game Play-by-Play**, **Game Team Stats** and **Game Odds**. Game IDs appear in every Season Schedule and Team Schedule row under gameId. Example: 13753624.

## `standingsType` (type: `string`):

📋 Which standings table to return. Used by **League Standings**. Competitions split into conferences or divisions publish the combined table only — use "Overall" for those. Home and away splits exist for single-table competitions.

## `gameWindow` (type: `string`):

🗓️ Which games to list. Used by **Season Schedule** and **Team Schedule**. "Played" returns completed games with final scores; "Upcoming" returns scheduled fixtures. If the chosen window has no games, the other one is used automatically.

## `page` (type: `integer`):

📄 Zero-based page to start from. Used by **Season Schedule** and **Team Schedule**. Each page returns up to 30 games.

## `maxPages` (type: `integer`):

📚 How many pages to fetch. Used by **Season Schedule** and **Team Schedule**. Each page returns up to 30 games, so 3 pages is roughly 90 games. Pagination stops early when no further pages are available.

## Actor input object example

```json
{
  "operation": "gameBoxScore",
  "query": "EuroLeague",
  "competitionId": "132",
  "seasonId": "65360",
  "teamId": "3428",
  "playerId": "817122",
  "gameId": "13753624",
  "standingsType": "total",
  "gameWindow": "played",
  "page": 0,
  "maxPages": 3
}
```

# Actor output Schema

## `output` (type: `string`):

One flat row per item: per-player box-score lines, standings rows with wins/losses/win percentage/games behind, games with quarter-by-quarter scoring, roster and player rows with salary, play-by-play scoring plays, team statistics and odds selections.

## `report` (type: `string`):

HTML report with run status, success and error row counts, success rate, pages fetched, duration and the inputs used — written even on a fatal crash.

# 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 = {
    "operation": "gameBoxScore",
    "query": "EuroLeague",
    "competitionId": "132",
    "seasonId": "65360",
    "teamId": "3428",
    "playerId": "817122",
    "gameId": "13753624",
    "standingsType": "total",
    "gameWindow": "played",
    "page": 0,
    "maxPages": 3
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/basketball-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 = {
    "operation": "gameBoxScore",
    "query": "EuroLeague",
    "competitionId": "132",
    "seasonId": "65360",
    "teamId": "3428",
    "playerId": "817122",
    "gameId": "13753624",
    "standingsType": "total",
    "gameWindow": "played",
    "page": 0,
    "maxPages": 3,
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/basketball-api-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "operation": "gameBoxScore",
  "query": "EuroLeague",
  "competitionId": "132",
  "seasonId": "65360",
  "teamId": "3428",
  "playerId": "817122",
  "gameId": "13753624",
  "standingsType": "total",
  "gameWindow": "played",
  "page": 0,
  "maxPages": 3
}' |
apify call sian.agency/basketball-api-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=sian.agency/basketball-api-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/A5uxptCcPJkY1JKgv/builds/p5W5BdXhel9YHblRa/openapi.json
