# SofaScore Matches & Stats Scraper (`neuro-scraper/sofascore-matches-stats-scraper`) Actor

Sofascore Scraper SD - Sofascore Scraper is a sports data tool that extracts Sofascore events by sport and day or live, with tournament, teams, scores, status, venue and referee, plus match statistics (xG, possession, shots), lineups with player ratings and incidents.

- **URL**: https://apify.com/neuro-scraper/sofascore-matches-stats-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

### Sofascore Scraper — events, live scores, statistics and lineups

The Sofascore Scraper returns Sofascore events for any sport: every event of a day, the events live right now, or full details for event links, with tournament, teams, scores per period, status, venue and referee, plus match statistics (xG, possession, shots, passes ...), lineups with player ratings and incidents (goals, cards, substitutions). No login.

The API base and the request token algorithm are read from Sofascore's own web app on every run.

#### Input

| Field | Meaning |
|---|---|
| `mode` | `eventsByDate` (default), `live`, `eventDetails` |
| `sport` | `football`, `tennis`, `basketball`, `ice-hockey`, `baseball`, `american-football`, `handball`, `volleyball`, `cricket`, `esports` ... |
| `dates` | Days as YYYY-MM-DD; empty = today |
| `timezoneOffset` | Hours from UTC where the day starts |
| `tournamentFilter` | Keep "Category: Tournament" names containing these texts (other categories are not read) |
| `includeStatistics`, `includeLineups`, `includeIncidents` | Extra data, 1 request each per event |
| `eventUrls` | eventDetails: links with `#id:` or event ids (statistics, lineups and incidents always included) |
| `maxItems` | Events per day (default 50) |

#### Output (one row per event)

eventId, eventUrl, sport, category, tournament, season, round, startTime (UTC), status, statusDescription, homeTeam, awayTeam, homeScore, awayScore, homePeriodScores, awayPeriodScores, winner, hasXg; eventDetails adds venue, venueCity, referee; with the options: statistics, lineups, incidents.

#### Measured (2026-10-03, local, see TEST_REPORT.md)

- 50 football events of a day in 31-32 s; 400 in 47 s. 10 live basketball events in 4 s.
- 2 events with full details (133 statistics rows, lineups, 16 incidents) in 12 s.

#### Limits

- A football day spans about 160 categories on Sofascore, read one request each, so big days take minutes; use `tournamentFilter` to read only what you need.
- Sofascore's edge rejects non-browser clients; residential proxy is the default.

#### Example

```json
{"mode": "eventsByDate", "sport": "football", "dates": ["2026-10-04"], "tournamentFilter": ["England: Premier League", "Spain: LaLiga"], "includeStatistics": true, "maxItems": 30}
```

# Actor input Schema

## `mode` (type: `string`):

eventsByDate = every event of a sport on the chosen days; live = events in play right now; eventDetails = full details (statistics, lineups, incidents) for the event links you give.

## `sport` (type: `string`):

Sofascore sport slug: football, tennis, basketball, ice-hockey, baseball, american-football, handball, volleyball, cricket, rugby, esports, table-tennis, futsal, darts, snooker, mma ...

## `dates` (type: `array`):

Days as YYYY-MM-DD. Empty = today in the chosen time zone.

## `timezoneOffset` (type: `integer`):

Where the day starts and ends, in hours from UTC (0 = UTC, 1 = CET, -5 = New York, 6 = Dhaka). Start times in the output are UTC.

## `tournamentFilter` (type: `array`):

Keep only events whose 'Category: Tournament' text contains one of these (not case-sensitive), e.g. England: Premier League, LaLiga, ATP. Saves requests: other categories are not read.

## `includeStatistics` (type: `boolean`):

Add match statistics per period (possession, xG, shots, passes, duels ...): 1 extra request per event.

## `includeLineups` (type: `boolean`):

Add formations and players with position, shirt number, rating and minutes: 1 extra request per event.

## `includeIncidents` (type: `boolean`):

Add goals, cards, substitutions and period markers with minute and player: 1 extra request per event.

## `eventUrls` (type: `array`):

Sofascore event links with #id:, e.g. https://www.sofascore.com/football/match/fulham-manchester-united/KsT#id:16363652, or plain event ids. Statistics, lineups and incidents are always included in this mode.

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

Maximum events per day (eventsByDate) or in total (live). A football day has well over 1,000 events on Sofascore.

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

Residential proxy is the default; Sofascore's edge rejects non-browser clients and has blocked datacenter IPs in public reports.

## Actor input object example

```json
{
  "mode": "eventsByDate",
  "sport": "football",
  "timezoneOffset": 0,
  "includeStatistics": false,
  "includeLineups": false,
  "includeIncidents": false,
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {
    "sport": "football",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/sofascore-matches-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 = {
    "sport": "football",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/sofascore-matches-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 '{
  "sport": "football",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call neuro-scraper/sofascore-matches-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/sofascore-matches-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/aB5y9XYDJXOuosQS2/builds/JfiMrBGoiIS5LrMLz/openapi.json
