# Basketball Match Scraper — Scores & Match Intel (`teamkamkod/basketball-match-intel`) Actor

Basketball scores & match intel from Flashscore, 150+ leagues (NBA, EuroLeague, ACB, NBL). List: every game of a day with quarter-by-quarter lines incl. overtimes. Enrich: per-period stats, H2H & form, standings, venue + opt-in odds (1X2, Over/Under, Asian Handicap) on scheduled/live games.

- **URL**: https://apify.com/teamkamkod/basketball-match-intel.md
- **Developed by:** [Team Kamkod](https://apify.com/teamkamkod) (community)
- **Categories:** Sports, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 match-listeds

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?

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 Match Scraper — Scores & Match Intel

Basketball scores and full match context from Flashscore, structured for automation and AI agents.

**Match Intel — the full picture per game (flag `enrich: true`).** Turn any game into a complete
report: **quarter-by-quarter breakdown** (1Q→4Q + overtimes, incl. live partial quarters), per-period
match statistics (points, rebounds, assists, shooting %, PIR… where provided by the source),
recent form & head-to-head, competition standings when available, venue/city info — and optional
**bookmaker odds comparison** (opt-in via `odds: true`): default markets **1X2, Over/Under, Asian
Handicap** (the live-betting decision markets), more markets selectable via `oddsMarkets`. Bookmaker
ids, handicap/total lines and odds movement included — best-effort: availability varies by market and
region (US/EU datacenter IPs see the widest coverage).

One run returns **every game of a day** (default: today) across 150+ competitions — NBA, EuroLeague,
EuroCup, Liga ACB, BBL, LNB, NBL, NCAA, internationals and more — as clean JSON rows, one per game.
Browse ±3 days, filter by league or status.

### What you get per game (list mode)

| Field | Example |
|---|---|
| `match_id` | `fDVzhLOp` |
| `home` / `away` | `South East Melbourne Phoenix` / `Illawarra Hawks` |
| `home_team_id` / `away_team_id` | stable ids (join records across days) |
| `status` | `SCHEDULED` · `LIVE` · `FINISHED` · `POSTPONED` … |
| `minute` (live) | `Q4 3` (period + clock) |
| `status_detail` | `OT` (after overtime) |
| `home_score` / `away_score` | running / final totals |
| `quarters` | `[{"period":"Q1","home":28,"away":18}, …]` incl. `OT1…` |
| `country` / `league` / `league_slug` | `australia` / `NBL` / `nbl` |
| `match_url` | direct Flashscore link |

### Example input

```json
{
  "matchStatuses": ["finished", "live"],
  "leagues": ["nba", "euroleague", "nbl"],
  "enrich": true,
  "odds": true,
  "maxMatches": 200
}
```

### Enrichment blocks (enrich: true)

- `statistics` — per-period rows (`period: FT/1H/2H` semantics for halves where the league reports
  them, labelled rows like points, rebounds, assists, shooting percentages)
- `h2h` — recent form (last N games) + head-to-head meetings between the two teams
- `standings` — competition table when available
- venue / city / capacity
- `odds` — opt-in, scheduled/live only, default 3 markets (1X2, Over/Under, Asian Handicap)

### Pricing & notes

- Pay-per-event, **billed per returned game**: list mode pushes one row per game
  (a 400-game day ≈ 400 **match-listed** events ≈ $0.40). No subscription, no per-run fee.
- Enrichment billed per enriched game as **match-intel**.
- Live games report current score, clock and partial quarter at scrape time.
- Status normalization: `Finished`, `After Overtime`, `Postponed`, `Abandoned`, `Cancelled`…
- Odds & statistics availability varies by league and region — graceful nulls, never a crash.

### Call it from an AI agent (MCP)

```text
Use the MCP server: mcp.apify.com?tools=<username>/basketball-match-intel
```

Ask: *"What are tonight's NBA scores and current quarter scores?"* — the agent runs the actor and reads the dataset.

### Legal

This actor scrapes publicly available data. Use it in compliance with the target website's terms and your local regulations.

# Actor input Schema

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

Which day to list. Leave empty for today. dayOffsets below are relative to this date.

## `dayOffsets` (type: `array`):

Also fetch the days before/after the anchor date. Default: anchor day only.

## `matchStatuses` (type: `array`):

Only return matches in these states. Leave empty for all.

## `leagues` (type: `array`):

Free-text filter (case-insensitive) on league name OR country. Examples: "premier league", "champions", "france", "brazil", "nsw". Empty = all leagues active that day.

## `maxMatches` (type: `integer`):

Upper limit on the number of matches returned. The full day is parsed; this caps the output.

## `enrich` (type: `boolean`):

Merge per match: timeline of events (goals/cards/subs), full match statistics, recent form + head-to-head, standings when available, venue/referee/TV. Billed as match-intel per enriched match.

## `odds` (type: `boolean`):

Best-effort per-market odds comparison (1X2, Over/Under, Asian Handicap...) from the match odds page, with bookmaker ids and value movement. Depends on your region's availability (some geos show no odds); billed as match-intel events.

## `oddsMarkets` (type: `array`):

Which markets to capture (empty = default core 3: 1x2-odds, over-under, asian-handicap — the fast live-betting set; add double-chance, both-teams-to-score, draw-no-bet, correct-score, ht-ft, odd-even for more depth).

## `pageUrl` (type: `string`):

Override the section to scrape (default: https://www.flashscore.com/football/). Rarely needed.

## Actor input object example

```json
{
  "dayOffsets": [
    "0"
  ],
  "matchStatuses": [],
  "leagues": [],
  "maxMatches": 1000,
  "enrich": false,
  "odds": false,
  "oddsMarkets": []
}
```

# Actor output Schema

## `match_records` (type: `string`):

Dataset of daily match records. Use the 'overview' view.

# 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 = {
    "dayOffsets": [
        "0"
    ],
    "matchStatuses": [],
    "leagues": [],
    "oddsMarkets": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("teamkamkod/basketball-match-intel").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 = {
    "dayOffsets": ["0"],
    "matchStatuses": [],
    "leagues": [],
    "oddsMarkets": [],
}

# Run the Actor and wait for it to finish
run = client.actor("teamkamkod/basketball-match-intel").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 '{
  "dayOffsets": [
    "0"
  ],
  "matchStatuses": [],
  "leagues": [],
  "oddsMarkets": []
}' |
apify call teamkamkod/basketball-match-intel --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,teamkamkod/basketball-match-intel"
        }
    }
}

```

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/a14geIez8mIP6Qes0/builds/NTPQhBkG1PUUcKhXH/openapi.json
