# SofaScore Scraper - Live Scores, Fixtures, Stats & Odds (`fanndev/sofascore-scraper`) Actor

Scrape SofaScore for 25 sports: fixtures by date, live scores, and full match detail with statistics, incidents, lineups and odds. Football, tennis, basketball, hockey, cricket, esports and more. No login.

- **URL**: https://apify.com/fanndev/sofascore-scraper.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/fanndev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 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.
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 — Live Scores, Fixtures, Stats & Odds

Scrape **SofaScore** for 25 sports: every fixture and result on a date, everything live right now, and full match detail with statistics, minute-by-minute incidents, lineups, and odds. Football, tennis, basketball, ice hockey, cricket, esports, and more, all in one actor.

### Why use this actor

- **25 sports in one actor**: no separate scraper per sport.
- **Complete daily coverage**: one run returned **1,113 football and tennis matches for a single day**, every league SofaScore lists rather than just the big ones.
- **Match detail on demand**: statistics (possession, shots, xG, distance covered...), incidents (goals, cards, substitutions), confirmed lineups, and bookmaker odds markets.
- **Readable columns plus full data**: home/away team, score, status, competition, and country in plain columns, followed by SofaScore's complete match object.
- **Tournament filter**: keep only the competitions you care about, e.g. `Premier League`, `ATP`, `NBA`.
- **No account, no login, no API key.**

### How it works

1. Choose a mode: **scheduled** (fixtures and results by date), **live** (in progress now), or **event** (specific matches).
2. Pick sports and dates, or paste match links.
3. The actor collects every match and, in event mode, the detail sections you ask for.
4. Export as JSON, CSV, or Excel, or connect it to a database, a dashboard, or a betting model.

You don't need to manage browsers, sessions, or retries.

### Input

```json
{
    "mode": "scheduled",
    "sports": ["football", "tennis"],
    "dates": ["today"],
    "strictDate": true,
    "tournamentFilter": ["Premier League", "ATP"],
    "eventIds": ["https://www.sofascore.com/football/match/aston-villa-crystal-palace/hP#id:14025091"],
    "include": ["statistics", "incidents", "lineups", "odds"],
    "maxItems": 0,
    "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

| Field | Type | Description |
|---|---|---|
| `mode` | string | `scheduled`, `live`, or `event`. |
| `sports` | array | Any of: football, tennis, basketball, ice-hockey, american-football, baseball, cricket, volleyball, handball, esports, table-tennis, mma, motorsport, rugby, darts, snooker, futsal, badminton, beach-volley, aussie-rules, water-polo, floorball, bandy, cycling, minifootball. |
| `dates` | array | `YYYY-MM-DD`, `today`, `tomorrow`, or `yesterday` (UTC). Past dates give results; future dates give fixtures. |
| `strictDate` | boolean | Drop matches that start on a neighbouring day (default on). |
| `tournamentFilter` | array | Keep only competitions whose name, country, or id matches. It also makes the run faster. |
| `eventIds` | array | Match URLs (ending `#id:<number>`) or numeric ids, for `event` mode. |
| `include` | array | `event` mode sections: `statistics`, `incidents`, `lineups`, `odds`. |
| `maxItems` | integer | Cap on rows for the run (0 = no cap). |

### Output

One row per match (real output, abridged):

```json
{
  "_input": "14025091",
  "_source": "S1-event-api",
  "_scrapedAt": "2026-11-12T12:04:16+00:00",
  "recordType": "eventDetail",
  "eventId": 14025091,
  "eventUrl": "https://www.sofascore.com/football/match/aston-villa-crystal-palace/hP#id:14025091",
  "sport": "football",
  "startTime": "2025-08-31T18:00:00+00:00",
  "statusType": "finished",
  "statusDescription": "Ended",
  "homeTeamName": "Aston Villa",
  "awayTeamName": "Crystal Palace",
  "homeScoreCurrent": 0,
  "awayScoreCurrent": 3,
  "winner": "away",
  "tournamentName": "Premier League",
  "uniqueTournamentId": 17,
  "uniqueTournamentName": "Premier League",
  "categoryName": "England",
  "country": "England",
  "seasonName": "Premier League 25/26",
  "round": 3,
  "statistics": {
    "statistics": [
      {
        "period": "ALL",
        "groups": [
          {
            "groupName": "Match overview",
            "statisticsItems": [
              { "name": "Ball possession", "home": "58%", "away": "42%", "homeValue": 58, "awayValue": 42, "key": "ballPossession" },
              { "name": "Distance covered", "home": "103.4 km", "away": "108.4 km", "homeValue": 103.36, "awayValue": 108.41, "key": "kilometersCovered" },
              "... more"
            ]
          }
        ]
      }
    ]
  },
  "incidents": { "incidents": [ { "text": "FT", "homeScore": 0, "awayScore": 3, "time": 90, "incidentType": "period" }, "... goals, cards, substitutions" ] },
  "lineups": { "confirmed": true, "home": { "...": "players, positions, ratings" }, "away": { "...": "..." } },
  "odds": { "markets": [ "... bookmaker markets" ] },
  "homeTeam": { "...": "SofaScore's full team object" },
  "tournament": { "...": "..." }
}
```

In `scheduled` and `live` modes the rows carry the same readable columns (without the detail sections), plus `date`.

| Field | Description |
|---|---|
| `eventId`, `eventUrl` | SofaScore match id and link. |
| `startTime` | Kick-off (UTC). |
| `statusType`, `statusDescription` | `notstarted`, `inprogress`, `finished`, `postponed`, `canceled`... |
| `homeTeamName`, `awayTeamName`, `homeScoreCurrent`, `awayScoreCurrent`, `winner` | Teams and score. |
| `uniqueTournamentName`, `tournamentName`, `country`, `seasonName`, `round` | Competition context. |
| `statistics`, `incidents`, `lineups`, `odds` | Event mode only. `null` when a sport or match has no such section (e.g. no lineups in tennis). |
| `_error`, `_errorDetail` | Only on error rows (unknown match, bad input). |

### Tips

- **Daily results feed:** schedule `scheduled` with `dates: ["yesterday"]` every morning.
- **Live tracker:** schedule `live` every few minutes for in-play scores.
- **Big-league only:** set `tournamentFilter` (e.g. `Premier League`, `LaLiga`, `Champions League`). It's faster and cheaper than a full day.

# Actor input Schema

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

scheduled reads Sports + Dates; live reads Sports; event reads Event IDs or URLs.

## `sports` (type: `array`):

Sports for scheduled and live modes.

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

YYYY-MM-DD, or 'today', 'tomorrow', 'yesterday' (UTC). Past dates return final results; future dates return fixtures.

## `strictDate` (type: `boolean`):

SofaScore also returns some matches from neighbouring days; keep this on to drop them.

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

Optional. Keep only matches whose tournament, league, country/category name contains one of these words, or whose tournament id matches (e.g. 'Premier League', 'ATP', 'NBA', '17').

## `eventIds` (type: `array`):

Mode 'event'. SofaScore match URLs (ending in #id:12345678) or numeric event ids.

## `include` (type: `array`):

Mode 'event': extra sections to attach to each match. Missing sections (e.g. no lineups in tennis) come back as null.

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

Cap on data rows for the whole run. 0 = no cap.

## `requestDelaySecs` (type: `number`):

Polite pause between calls.

## `maxRetries` (type: `integer`):

Retries per request with a fresh connection and IP.

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

Apify Proxy recommended.

## Actor input object example

```json
{
  "mode": "scheduled",
  "sports": [
    "football",
    "tennis"
  ],
  "dates": [
    "today"
  ],
  "strictDate": true,
  "include": [
    "statistics",
    "incidents"
  ],
  "maxItems": 0,
  "requestDelaySecs": 0.3,
  "maxRetries": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Every match and diagnostic record from this run.

# 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 = {
    "sports": [
        "football",
        "tennis"
    ],
    "dates": [
        "today"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("fanndev/sofascore-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 = {
    "sports": [
        "football",
        "tennis",
    ],
    "dates": ["today"],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

```

## MCP server setup

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