# Sofascore Scraper (`gio21/sofascore-scraper`) Actor

Scrape Sofascore by keyword: teams, players, tournaments plus recent and upcoming matches with scores. Football, basketball, tennis and more. Pay per result.

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

## Pricing

$3.00 / 1,000 result scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Sofascore Scraper

Search Sofascore by keyword and get back teams, players, tournaments and matches with live and historical scores. Covers football, basketball, tennis and more, returned as clean JSON ready for analysis.

### What you can do with it

- **Build betting and prediction models:** pull recent and upcoming matches with scores and status to feed your data pipeline.
- **Power stats dashboards:** track a team's form across its last and next fixtures with one keyword.
- **Scout players and tournaments:** resolve a name to its Sofascore entity, id, slug and URL.
- **Monitor fixtures across sports:** football, basketball, tennis and others from a single search.
- **Enrich sports content:** generate match previews and recaps from structured score and tournament data.

### Input

| Field | Type | Description |
|---|---|---|
| `searchTerm` | string | Team, player, tournament or league to search (e.g. "Real Madrid", "Djokovic", "Premier League"). |
| `includeMatches` | boolean | When the top match is a team, also fetch its recent and upcoming matches with scores. Default `true`. |
| `maxItems` | integer | Maximum number of items to return. Default `50`. |

#### Example input

```json
{
  "searchTerm": "Real Madrid",
  "includeMatches": true,
  "maxItems": 50
}
```

### Output

One dataset item per result. Search-entity items (teams, players, tournaments) look like this:

```json
{
  "type": "team",
  "name": "Real Madrid",
  "sport": "Football",
  "country": "Spain",
  "team": null,
  "homeTeam": null,
  "awayTeam": null,
  "score": null,
  "startTime": null,
  "userCount": 4821336,
  "sofascoreId": 2829,
  "slug": "real-madrid",
  "url": "https://www.sofascore.com/team/real-madrid/2829",
  "searchTerm": "Real Madrid",
  "scrapedAt": "2026-06-26T12:00:00.000Z"
}
```

Match items (returned when `includeMatches` is on) look like this:

```json
{
  "type": "match",
  "name": "Real Madrid vs Barcelona",
  "sport": "Football",
  "country": "Spain",
  "tournament": "LaLiga",
  "homeTeam": "Real Madrid",
  "awayTeam": "Barcelona",
  "score": "2-1",
  "statusType": "finished",
  "statusDescription": "Ended",
  "startTime": "2026-05-11T19:00:00.000Z",
  "sofascoreId": 11352507,
  "url": "https://www.sofascore.com/event/11352507",
  "searchTerm": "Real Madrid",
  "scrapedAt": "2026-06-26T12:00:00.000Z"
}
```

### Pricing

**$0.003 per result scraped** (pay per event). You are not charged for failed pages or duplicates.

### Notes and limits

- A run starts from the search keyword. The first matching team is the one whose recent and upcoming matches are fetched, so a precise `searchTerm` gives the most relevant fixtures.
- Match items only appear when `includeMatches` is `true` and the top result is a team; player and tournament searches return entity items only.
- The `score` field is `null` for fixtures that have not been played yet, and for all search-entity items.
- Sofascore sits behind aggressive bot protection. If a run returns no results, the search was likely blocked; retry or try a slightly different keyword.

# Actor input Schema

## `searchTerm` (type: `string`):

Team, player, tournament or league to search (e.g. "Real Madrid", "Djokovic", "Premier League").

## `includeMatches` (type: `boolean`):

When the top match is a team, also fetch its recent and upcoming matches with scores.

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

Maximum number of items to return.

## Actor input object example

```json
{
  "searchTerm": "Real Madrid",
  "includeMatches": true,
  "maxItems": 10
}
```

# Actor output Schema

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

All scraped items.

# 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 = {
    "searchTerm": "Real Madrid",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("gio21/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 = {
    "searchTerm": "Real Madrid",
    "maxItems": 10,
}

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

```

## MCP server setup

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

```

## OpenAPI specification

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