# Football Results & Odds Scraper (`bovi/football-scraper`) Actor

Collect season match results, scores, match statistics, and available bookmaker odds from football-data.co.uk public CSV files. Choose a season and league codes, limit output with maxResults, and optionally supply a proxy configuration.

- **URL**: https://apify.com/bovi/football-scraper.md
- **Developed by:** [Vitalii Bondarev](https://apify.com/bovi) (community)
- **Categories:** Other, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.40 / 1,000 football results & odds scrapers

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/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

## Football Results & Odds Scraper

You can scrape and extract football match rows from football-data.co.uk’s public season CSV archive, including scores, statistics, and available odds; the default `maxResults` is 50 records per run. On the Free plan, pricing is $0.0024 per saved match plus $0.00005 per Actor Start event.

- Select a four-digit season and one or more division codes, with prefilled values `2627` and `E0`
- Extract full-time and half-time scores, result codes, referees, expected goals, and available match statistics
- Keep numeric odds and handicap values under their original CSV column names in the `odds` object
- Analyze football scores, match statistics, and odds from computer-ready CSV data
- Run without a source login or buyer API key, and optionally supply Apify proxy settings

### What you get

Each saved record represents a non-empty match row from a selected football-data.co.uk CSV file. Optional fields are omitted when the source CSV does not supply a usable value; a numeric column that cannot be parsed as its declared type is omitted too. The required fields `season`, `leagueCode`, `date`, `homeTeam`, `awayTeam`, and `sourceUrl` are always present, and `odds` is omitted when it has no usable entries. Missing values are not represented as `null` or empty strings.

| Field family | Fields | Type | What it contains |
|---|---|---|---|
| Season and source | `season`, `leagueCode`, `date`, `sourceUrl` | string | Season code, CSV `Div` value or selected code when `Div` is absent, source-written match date, and source CSV URL |
| Fixture | `time`, `homeTeam`, `awayTeam` | string | Kick-off time when present and the two teams |
| Full-time result | `fullTimeHomeGoals`, `fullTimeAwayGoals`, `fullTimeResult` | integer, string | Full-time goals and the source result code, such as `H`, `D`, or `A` |
| Half-time result | `halfTimeHomeGoals`, `halfTimeAwayGoals`, `halfTimeResult` | integer, string | Half-time goals and result code when supplied |
| Match context | `referee` | string | Referee name when supplied |
| Expected goals | `homeExpectedGoals`, `awayExpectedGoals` | number | Home and away expected-goals values from the CSV |
| Shots | `homeShots`, `awayShots`, `homeShotsOnTarget`, `awayShotsOnTarget` | integer | Total shots and shots on target |
| Match statistics | `homeFouls`, `awayFouls`, `homeCorners`, `awayCorners` | integer | Fouls and corners for each team |
| Cards | `homeYellowCards`, `awayYellowCards`, `homeRedCards`, `awayRedCards` | integer | Yellow and red cards for each team |
| Attendance | `attendance` | integer | Attendance when supplied by the source |
| Odds and handicaps | `odds` | object with number values | Numeric odds and handicap-line columns under their original CSV column names |

Match events, scorers, and a stable source match ID are not present in these CSV rows and are not included.

### Sample output

The sample is shortened to the main result and statistics fields plus three actual `odds` entries from one saved record. Other odds entries from the same record are omitted only to keep the example compact.

```json
{
  "season": "2627", "leagueCode": "E0",
  "date": "21/08/2026", "time": "20:00",
  "homeTeam": "Arsenal", "awayTeam": "Coventry",
  "sourceUrl": "https://football-data.co.uk/mmz4281/2627/E0.csv",
  "fullTimeHomeGoals": 3, "fullTimeAwayGoals": 0,
  "fullTimeResult": "H",
  "halfTimeHomeGoals": 2, "halfTimeAwayGoals": 0,
  "halfTimeResult": "H",
  "referee": "T Bramall",
  "homeExpectedGoals": 1.88, "awayExpectedGoals": 0.2,
  "homeShots": 20, "awayShots": 4,
  "homeShotsOnTarget": 6, "awayShotsOnTarget": 1,
  "homeFouls": 10, "awayFouls": 13,
  "homeCorners": 8, "awayCorners": 2,
  "homeYellowCards": 1, "awayYellowCards": 1,
  "homeRedCards": 0, "awayRedCards": 0,
  "odds": {"B365H": 1.2, "B365D": 7, "B365A": 13}
}
```

### Pricing

This Actor uses pay-per-event billing. The listed prices are Free-plan prices:

| Charge event | Billing unit | Free-plan price |
|---|---|---:|
| `apify-actor-start` | Actor Start event | $0.00005 per event on the Free plan |
| `apify-default-dataset-item` | One saved match result with all fields | $0.0024 per event on the Free plan |

On the Free plan, 1,000 Actor Start events cost $0.05 and 10,000 cost $0.50; 1,000 saved match results cost $2.40 and 10,000 cost $24.00.

An Actor Start event is charged once per GB of run memory, with a minimum of one event. With the default 512 MB run memory, each run uses 1 Actor Start event.

The Apify Free plan includes a $5 per month platform usage credit. With 1 Actor Start event, that $5 credit covers 2,083 saved match results for a total of $4.99925 on the Free plan.

You pay only for the events listed below. This Actor does not use the Pay per event + usage option, so the platform usage of your runs (compute, proxy traffic and storage) is not billed to you separately.

### How to use

1. **Choose** a four-digit football-data.co.uk season folder such as `2627`, which represents the 2026/27 season.
2. **Enter** at least one division code in `leagueCodes`, such as `E0`, `E1`, `D1`, `I1`, or `SP1`. Each selected code identifies one season CSV.
3. **Set** `maxResults` to the run-wide maximum number of records to save. The default is 50.
4. **Review** `proxyConfiguration`: the schema default is `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}`. Setting `useApifyProxy` to `false` makes a direct request.
5. **Start** the run and inspect the dataset. The Actor processes selected league files sequentially and pushes records until `maxResults` is reached.
6. **Repeat** the run through Apify Schedules; monthly is a suitable starting point for a season-archive extraction, then adjust it to your workflow.

Export the dataset as JSON or CSV, or read it through the Apify dataset API.

Example input:

```json
{
  "season": "2627",
  "leagueCodes": ["E0"],
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### Input parameters

| Parameter | What it does | Default |
|---|---|---|
| `season` | Four-digit season folder used to build the source path, for example `2627`. | `"2627"` |
| `leagueCodes` | One or more unique 1–4 character alphanumeric division codes. The Actor normalizes supplied codes to uppercase. | `["E0"]` |
| `maxResults` | Run-wide maximum number of match records saved from the selected league files. | `50` |
| `proxyConfiguration` | Optional proxy settings passed to Apify proxy configuration when the value is an object. Setting `useApifyProxy` to `false` makes a direct request. | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` |

### Limits and edge cases

| Condition | What the buyer sees | What to do |
|---|---|---|
| `season` is not exactly four digits | Input validation raises an error stating that the season must be a four-digit season code. | Use a value such as `2526` or `2627`. |
| `leagueCodes` is empty or contains a value outside 1–4 alphanumeric characters | Input validation rejects the league selection. Duplicate normalized codes are reduced to one selection. | Provide at least one valid football-data.co.uk division code. |
| `maxResults` is positive | The Actor saves no more than that number of records from the selected league files combined, not that number per league. | Increase `maxResults` if you need more records. |
| A CSV row has an empty `Date`, `HomeTeam`, or `AwayTeam` value | That row is skipped and does not become a dataset record. | Check the selected season and division in the source archive if the result count is lower than expected. |
| An optional source column is empty or absent | The corresponding output field is omitted. A numeric column that cannot be parsed as its declared type is omitted too. | Treat omitted fields as unavailable in the selected CSV. |
| A selected file cannot be fetched or parsed | The Actor logs a warning for that league and skips the file while other selected leagues continue. If another league was read, the run ends as Succeeded with fewer rows. The reason for a skipped file is in the run log. If no file can be read, the run raises an error and fails. | Check the season, division code, generated source URL, optional proxy configuration, and run log. |
| A request encounters a general fetch error or the source returns HTML instead of CSV data | The request is retried up to three attempts with waits of 1.5 seconds and 3 seconds. HTTP 403, 404, and 406 responses are not retried. Other HTTP errors and an HTML response are retried. Each request has a 40-second timeout. | Verify that the source CSV exists and review the run log. |
| A CSV is readable but contains no valid non-empty match rows | The run ends as Succeeded with 0 records from that file. | Select another season or division code, or check the source archive. |
| The source provides public data with stated use limits | The Actor reads football-data.co.uk’s public data archive. The archive page says the CSVs are free for private individuals and not for commercial or data-training products using automated bots, scrapers, or AI. | Review the source terms and applicable law for your use case before running the Actor. |

The dataset is filled during the run: each fetched and parsed file's rows are pushed one by one. Rows already pushed remain in the dataset if the run is later aborted, times out, or fails; a file whose fetch or parse fails adds no rows.

### FAQ

#### How much does it cost to scrape football match results?

On the Free plan, saved matches cost $0.0024 each and Actor Start events cost $0.00005 each; see Pricing for the worked example.

#### How is `maxResults` applied across league files?

`maxResults` is shared by the selected league files, so it limits the total records saved in a run rather than the records from each league.

#### What happens to missing source fields?

Optional fields are omitted when source values are empty, absent, or unusable. The required fields remain present in each valid saved match record.

#### Is it legal or allowed to use this public data?

The Actor reads football-data.co.uk’s public data archive. Whether your use is allowed depends on the source terms and applicable law for your use case; review them before running the Actor.

### Usage statistics

This Actor creates a small, content-free summary at the end of each run, used only to monitor reliability and improve this Actor. No input values, credentials or scraped data are sent.

A copy of the exact record for your run is saved as `USAGE_STATS` in your own Apify key-value store.

To opt out, set `disableUsageStats` to `true` in the input. Nothing is sent then.

[Full list of collected fields](https://api.apify.com/v2/key-value-stores/v9rgHjMKLDGtHf8tD/records/index.html)

# Actor input Schema

## `season` (type: `string`):

Four-digit season folder used by football-data.co.uk, for example 2526 or 2627.

## `leagueCodes` (type: `array`):

Division codes from football-data.co.uk, such as E0 (England Premier League), E1, D1, I1, or SP1. Each selected code reads one season CSV.

## `maxResults` (type: `integer`):

Maximum number of match records to save across all selected leagues.

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

Optional Apify proxy settings. The Actor makes a direct request when useApifyProxy is false or this field is omitted.

## Actor input object example

```json
{
  "season": "2627",
  "leagueCodes": [
    "E0"
  ],
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset containing football match results, statistics, and source odds.

# 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 = {
    "season": "2627",
    "leagueCodes": [
        "E0"
    ],
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("bovi/football-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 = {
    "season": "2627",
    "leagueCodes": ["E0"],
    "maxResults": 50,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("bovi/football-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 '{
  "season": "2627",
  "leagueCodes": [
    "E0"
  ],
  "maxResults": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call bovi/football-scraper --silent --output-dataset

```

## MCP server setup

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