# Sofascore Live Scores & Match Stats Scraper (`scrapers_lat/sofascore-scraper`) Actor

Scrape live football scores, fixtures, results, lineups, player ratings and match statistics from Sofascore. Track the World Cup and any league by tournament or match. Export to JSON, CSV or Excel.

- **URL**: https://apify.com/scrapers\_lat/sofascore-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** News, Automation, Developer tools
- **Stats:** 6 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.15 / 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?

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

[![Sofascore Live Scores & Match Stats Scraper](https://scrapers.lat/banners/sofascore-scraper.png)](https://console.apify.com/actors/nDJWjucSy8xGV3bPj/input)

## Sofascore Live Scores & Match Stats Scraper

Here is one real result, with every field the actor returns (the `statistics` and `incidents` arrays are trimmed here with `...` to keep the example readable; live records return them in full):

```json
{
  "eventId": 16588759,
  "slug": "ostrovets-fc-minsk-2",
  "status": "inprogress",
  "statusDescription": "1st half",
  "minute": 8,
  "startTime": "2026-08-10T14:30:00.000Z",
  "tournament": "Pershaya Liga",
  "category": "Belarus",
  "season": "Pershaya Liga 2026",
  "round": "Round 19",
  "homeTeam": "FC Minsk 2",
  "homeTeamId": 100887,
  "homeTeamCountry": "Belarus",
  "awayTeam": "Ostrovets",
  "awayTeamId": 345530,
  "awayTeamCountry": "Belarus",
  "homeScore": 0,
  "awayScore": 0,
  "homeScoreHalftime": 0,
  "awayScoreHalftime": 0,
  "homePenalties": null,
  "awayPenalties": null,
  "winner": null,
  "hasStatistics": null,
  "venue": null,
  "venueCity": null,
  "venueCountry": null,
  "venueCapacity": null,
  "referee": null,
  "attendance": null,
  "url": "https://www.sofascore.com/ostrovets-fc-minsk-2/MrPsFkNc",
  "statistics": [
    { "group": "Match overview", "name": "Corner kicks", "home": "0", "away": "0" },
    { "group": "Attack", "name": "Offsides", "home": "0", "away": "0" }
  ],
  "lineups": null,
  "incidents": [
    { "type": "period", "detail": "First half", "minute": 45, "addedTime": 999, "team": null, "player": null, "assist": null, "playerIn": null, "playerOut": null, "homeScore": 0, "awayScore": 0, "reason": null }
  ],
  "observedAt": "2026-08-10T14:39:38.896Z",
  "error": null
}
```

The most complete Sofascore match scraper available. It returns every field a Sofascore event exposes per match, plus half-time and penalty scores, team country, and full detail (statistics, lineups, incidents, venue, referee and attendance) when you enable it, across 11 sports, live matches, tournament fixtures or individual match ids.

**📥 [Input](https://apify.com/scrapers_lat/sofascore-scraper/input-schema) · 📤 [Output](https://apify.com/scrapers_lat/sofascore-scraper/output-schema) · 💰 [Pricing](https://apify.com/scrapers_lat/sofascore-scraper/pricing) · ▶️ [Examples](https://apify.com/scrapers_lat/sofascore-scraper/examples)**

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify\&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-Global-blue)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)
![Billing](https://img.shields.io/badge/Billing-Pay%20per%20result-brightgreen)

### Table of contents

- [What it does](#what-it-does)
- [Quickstart](#quickstart)
- [Input reference](#input-reference)
- [Output reference](#output-reference)
- [Example output record](#example-output-record)
- [Run via API and CLI](#run-via-api-and-cli)
- [Fetch results](#fetch-results)
- [Billing and limits](#billing-and-limits)
- [FAQ and troubleshooting](#faq-and-troubleshooting)

### What it does

The actor reads Sofascore and writes one normalized record per match to the run's dataset. It runs in three modes: live matches (every game in play right now for a chosen sport), tournament fixtures (results and upcoming matches for one competition, with optional standings), and single matches by id. Each record carries scores, half-time and penalty scores, status, tournament, round, both teams with ids and countries, and the match URL.

With `withDetails` on (the default) each match also gets full statistics, starting lineups with player ratings and formations, timeline incidents (goals, cards, substitutions), venue, referee and attendance. Detail fields are `null` when the source has not published them yet, for example before kickoff.

### Quickstart

Open the actor, paste this into the input, and press Run. It returns up to 10 football matches in play right now, with full statistics.

```json
{
  "mode": "live-matches",
  "sport": "football",
  "maxMatches": 10,
  "withDetails": true
}
```

Every input field is optional. With an empty input the actor defaults to live football matches, so a run always returns data.

### Input reference

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `mode` | enum | no | `live-matches` | What to scrape. `live-matches` (every game in play now), `tournament-events` (fixtures and results for one competition), or `event-detail` (specific matches by id). |
| `sport` | enum | no | `football` | Sport for live matches mode. One of `football`, `basketball`, `tennis`, `ice-hockey`, `baseball`, `american-football`, `rugby`, `cricket`, `handball`, `volleyball`, `mma`. |
| `maxMatches` | integer | no | `10` | Maximum number of matches to collect. Free Apify plans are capped at 10 per run. |
| `withDetails` | boolean | no | `true` | When on, adds lineups, player ratings, formations, statistics, incidents, venue, referee and attendance to each match. Adds two requests per match. |
| `tournamentId` | integer | no | `16` | Numeric tournament id for tournament fixtures mode. Defaults to 16 (FIFA World Cup). Examples: 17 Premier League, 8 LaLiga, 35 Bundesliga, 34 Ligue 1, 23 Serie A, 7 UEFA Champions League, 384 Copa Libertadores. |
| `seasonId` | integer | no | (latest) | Optional numeric season id. Leave empty to use the most recent season of the chosen tournament automatically. |
| `includeStandings` | boolean | no | `false` | Also collect the league or group standings table for the tournament and season. |
| `eventIds` | string\[] | no | (empty) | Numeric match ids for single matches mode, one per line. |

### Output reference

One dataset item per match. Types: `string`, `integer`, `object[]`, `object`, or `null` when the source value is absent. Detail fields (`statistics`, `lineups`, `incidents`, `venue`, `referee`, `attendance`) are populated only when `withDetails` is on and the source has published them.

| Field | Type | Description |
|---|---|---|
| `eventId` | integer | Sofascore match identifier. |
| `slug` | string | URL slug for the match. |
| `status` | string | Match status code, for example `inprogress`, `finished`, `notstarted`. |
| `statusDescription` | string | Human-readable status, for example `1st half`. |
| `minute` | integer | Current match minute for live games, or `null`. |
| `startTime` | string | ISO 8601 kickoff time. |
| `tournament` | string | Tournament or competition name. |
| `category` | string | Category or country of the tournament. |
| `season` | string | Season name. |
| `round` | string | Round or matchday label. |
| `homeTeam` | string | Home team name. |
| `homeTeamId` | integer | Sofascore id of the home team. |
| `homeTeamCountry` | string | Country of the home team. |
| `awayTeam` | string | Away team name. |
| `awayTeamId` | integer | Sofascore id of the away team. |
| `awayTeamCountry` | string | Country of the away team. |
| `homeScore` | integer | Home team current score. |
| `awayScore` | integer | Away team current score. |
| `homeScoreHalftime` | integer | Home team half-time score, or `null`. |
| `awayScoreHalftime` | integer | Away team half-time score, or `null`. |
| `homePenalties` | integer | Home team penalty shootout score, or `null`. |
| `awayPenalties` | integer | Away team penalty shootout score, or `null`. |
| `winner` | string | Winner (`home`, `away`, `draw`), or `null` while undecided. |
| `hasStatistics` | boolean | Whether the match has published statistics, or `null`. |
| `venue` | string | Venue name, or `null`. |
| `venueCity` | string | Venue city, or `null`. |
| `venueCountry` | string | Venue country, or `null`. |
| `venueCapacity` | integer | Venue capacity, or `null`. |
| `referee` | string | Match referee, or `null`. |
| `attendance` | integer | Reported attendance, or `null`. |
| `url` | string | Public Sofascore match URL. |
| `statistics` | object\[] | Match statistics as `{group, name, home, away}` entries. `null` until published. |
| `lineups` | object | Starting lineups, formations and player ratings. `null` until published. |
| `incidents` | object\[] | Timeline events (goals, cards, substitutions, periods). `null` until published. |
| `observedAt` | string | ISO 8601 timestamp of when the record was collected. |
| `error` | string | `null` on success. On a failed run, a single item with a populated `error` field is written instead. |

### Example output record

Real record from a live run (input `{"mode":"live-matches","sport":"football","maxMatches":10,"withDetails":true}`). The `statistics` and `incidents` arrays are trimmed here with `...`; live records return them in full:

```json
{
  "eventId": 16588759,
  "slug": "ostrovets-fc-minsk-2",
  "status": "inprogress",
  "statusDescription": "1st half",
  "minute": 8,
  "startTime": "2026-08-10T14:30:00.000Z",
  "tournament": "Pershaya Liga",
  "category": "Belarus",
  "season": "Pershaya Liga 2026",
  "round": "Round 19",
  "homeTeam": "FC Minsk 2",
  "homeTeamId": 100887,
  "homeTeamCountry": "Belarus",
  "awayTeam": "Ostrovets",
  "awayTeamId": 345530,
  "awayTeamCountry": "Belarus",
  "homeScore": 0,
  "awayScore": 0,
  "homeScoreHalftime": 0,
  "awayScoreHalftime": 0,
  "winner": null,
  "url": "https://www.sofascore.com/ostrovets-fc-minsk-2/MrPsFkNc",
  "statistics": [
    { "group": "Match overview", "name": "Corner kicks", "home": "0", "away": "0" }
  ],
  "incidents": [
    { "type": "period", "detail": "First half", "minute": 45, "team": null, "player": null }
  ],
  "observedAt": "2026-08-10T14:39:38.896Z",
  "error": null
}
```

### Run via API and CLI

Start a run and wait for it to finish, then read the dataset. Replace `<TOKEN>` with your Apify API token.

Run synchronously and get dataset items in one call:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sofascore-scraper/run-sync-get-dataset-items?token=%3CTOKEN%3E" \
  -H "Content-Type: application/json" \
  -d '{"mode":"live-matches","sport":"football","maxMatches":25,"withDetails":true}'
```

Start a run asynchronously:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~sofascore-scraper/runs?token=%3CTOKEN%3E" \
  -H "Content-Type: application/json" \
  -d '{"mode":"tournament-events","tournamentId":17,"includeStandings":true}'
```

Apify CLI:

```bash
apify call scrapers_lat/sofascore-scraper \
  --input '{"mode":"event-detail","eventIds":["16588759"]}'
```

### Fetch results

Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing `format`:

```bash
## JSON
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&clean=true&format=json"

## CSV
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&clean=true&format=csv"

## Paginate large datasets
curl "https://api.apify.com/v2/datasets/%3CDATASET_ID%3E/items?token=%3CTOKEN%3E&offset=1000&limit=1000"
```

`<DATASET_ID>` is returned as `defaultDatasetId` in the run object. Use `offset` and `limit` to page through large result sets. `clean=true` drops empty and internal fields.

### Billing and limits

- **Pay per result.** You are charged per match returned (`result` event). See the [pricing tab](https://apify.com/scrapers_lat/sofascore-scraper/pricing) for the current per-result price.
- **No charge on failure.** If a run errors, the actor writes a single item with a populated `error` field and does not charge for it. Empty runs cost nothing.
- **Spend cap respected.** Set `maxTotalChargeUsd` on the run; once reached, the actor stops emitting and charging further billable results.
- **Free Apify plans** are capped at 10 matches per run. Upgrade for higher `maxMatches`.

### FAQ and troubleshooting

**Why are `statistics`, `lineups` or `incidents` null?**
The source has not published them yet, for example before kickoff, or `withDetails` is off. Missing source values are returned as `null`, never invented.

**How do I scrape a specific league?**
Set `mode` to `tournament-events` and pass its `tournamentId` (for example 17 for the Premier League). Add `includeStandings` for the table.

**Which sports are supported?**
Eleven: football, basketball, tennis, ice hockey, baseball, American football, rugby, cricket, handball, volleyball and MMA. Set `sport` in live matches mode.

**Can I pull one specific match?**
Yes. Set `mode` to `event-detail` and pass the match ids in `eventIds`.

**Is this an official Sofascore tool?**
No. This actor is independent and has no affiliation with Sofascore. It reads only publicly available match data. Use the results in accordance with the source's terms.

### Related scrapers

- [ESPN Soccer Scraper](https://apify.com/scrapers_lat/espn-soccer-scraper): Soccer scores, standings and teams from ESPN.
- [FIFA World Cup Scraper](https://apify.com/scrapers_lat/fifa-worldcup-scraper): World Cup matches, standings and teams.

### More scrapers at scrapers.lat

Built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at [scrapers.lat](https://scrapers.lat).

***

> Independent tool, not affiliated with Sofascore. Accesses only publicly available match data. Use the results in accordance with the source's terms.
>
> </content>

# Actor input Schema

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

Maximum number of matches to collect. Optional.

## `withDetails` (type: `boolean`):

When enabled, the scraper adds full detail to each match: starting lineups, player ratings, team formations, match statistics, venue, referee and attendance. Adds two requests per match.

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

Live matches = every game in play right now. Tournament fixtures = results and upcoming matches for one competition (World Cup by default). Single matches = specific matches by id.

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

Sport to scrape in Live matches mode.

## `tournamentId` (type: `integer`):

Numeric tournament id for Tournament fixtures mode. Defaults to 16 (FIFA World Cup). Other examples: 17 (Premier League), 8 (LaLiga), 35 (Bundesliga), 34 (Ligue 1), 23 (Serie A), 7 (UEFA Champions League), 384 (Copa Libertadores).

## `seasonId` (type: `integer`):

Optional numeric season id. Leave empty to use the most recent season of the chosen tournament automatically.

## `includeStandings` (type: `boolean`):

Also collect the league or group standings table for the tournament and season.

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

Numeric match ids for Single matches mode (one per line).

## Actor input object example

```json
{
  "maxMatches": 10,
  "withDetails": true,
  "mode": "live-matches",
  "sport": "football",
  "tournamentId": 16,
  "includeStandings": 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 = {
    "maxMatches": 10,
    "tournamentId": 16
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/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 = {
    "maxMatches": 10,
    "tournamentId": 16,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/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 '{
  "maxMatches": 10,
  "tournamentId": 16
}' |
apify call scrapers_lat/sofascore-scraper --silent --output-dataset

```

## MCP server setup

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