# Historical Football Odds & Results: Closing Lines (`scrapemint/historical-football-odds`) Actor

Football results with opening and closing odds for 38 leagues back to 1993: 1X2, over/under 2.5 and Asian handicap from Pinnacle, Bet365, Betfair Exchange, market max and average, plus no-vig probabilities. For backtesting.

- **URL**: https://apify.com/scrapemint/historical-football-odds.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Automation, Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

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

## Historical Football Odds & Results: Closing Lines

Football results with **opening and closing bookmaker odds** for **38 leagues**, back to the 1990s, in one clean format. Built for backtesting betting models.

Each match row has:

- **Result**: full-time and half-time score, result (H/D/A), total goals, over 2.5, both teams scored
- **Match stats**: shots, shots on target, corners, fouls, cards, referee (main European leagues), xG (from 2026/27)
- **1X2 odds**, opening and closing: **Pinnacle, Bet365, Betfair Exchange, market maximum and market average**
- **Over/under 2.5 goals** odds, opening and closing
- **Asian handicap** line and odds, opening and closing
- **No-vig implied probabilities** (home, draw, away and the overround) from the sharpest line available: Pinnacle closing, then Betfair Exchange closing, then market average
- Optional: **every raw bookmaker column** of the season (William Hill, Interwetten, Ladbrokes, BetVictor, 1xBet and more)

Closing odds start in 2019/20; opening odds go back to 2000/01; results to 1993/94. Data from football-data.co.uk, normalised so every season has the same fields. No API key.

### Leagues

| Region | Leagues (code) |
|---|---|
| England | Premier League (E0), Championship (E1), League One (E2), League Two (E3), National League (EC) |
| Scotland | Premiership (SC0), Championship (SC1), League One (SC2), League Two (SC3) |
| Top 5 | Bundesliga (D1), 2. Bundesliga (D2), Serie A (I1), Serie B (I2), La Liga (SP1), Segunda (SP2), Ligue 1 (F1), Ligue 2 (F2) |
| Rest of Europe | Eredivisie (N1), Belgium (B1), Portugal (P1), Turkey (T1), Greece (G1), Austria (AUT), Denmark (DNK), Finland (FIN), Ireland (IRL), Norway (NOR), Poland (POL), Romania (ROU), Russia (RUS), Sweden (SWE), Switzerland (SWZ) |
| Americas and Asia | MLS (USA), Brazil (BRA), Argentina (ARG), Mexico (MEX), Japan (JPN), China (CHN) |

The 16 leagues with three-letter codes (Austria to China) have closing 1X2 odds only, from about 2012. The 22 others have every field.

### Who uses it

- **Betting model builders**: test a model against closing lines, the standard measure of a betting edge
- **Value bettors**: measure closing line value (CLV) on past bets
- **Data scientists and students**: a clean, consistent football dataset with odds, without cleaning 30 different CSV layouts
- **Tipsters**: prove a track record against the closing price

### Example input

The last 5 seasons of the top 5 leagues:

```json
{ "leagues": ["E0", "SP1", "I1", "D1", "F1"], "lastSeasons": 5 }
```

Every Arsenal match since 2010 with all bookmaker columns:

```json
{ "leagues": ["Premier League"], "lastSeasons": 17, "teams": ["Arsenal"], "includeAllBookmakers": true }
```

### Example output

```json
{
  "country": "England",
  "league": "Premier League",
  "division": "E0",
  "season": "2025/2026",
  "date": "2026-05-24",
  "homeTeam": "Brighton",
  "awayTeam": "Man United",
  "homeGoals": 0,
  "awayGoals": 3,
  "result": "A",
  "halfTimeHomeGoals": 0,
  "halfTimeAwayGoals": 2,
  "over2_5": true,
  "bothTeamsScored": false,
  "homeShots": 13,
  "awayShots": 11,
  "odds1x2Opening": {
    "bet365": { "home": 1.85, "draw": 4.2, "away": 3.6 },
    "betfairExchange": { "home": 1.95, "draw": 4.4, "away": 3.8 },
    "avg": { "home": 1.86, "draw": 3.98, "away": 3.58 }
  },
  "odds1x2Closing": {
    "bet365": { "home": 1.85, "draw": 4.33, "away": 3.5 },
    "betfairExchange": { "home": 1.95, "draw": 4.5, "away": 3.7 },
    "avg": { "home": 1.87, "draw": 4.08, "away": 3.49 }
  },
  "overUnder25Closing": { "bet365": { "over": 1.44, "under": 2.75 } },
  "asianHandicapClosing": { "line": -0.5, "bet365": { "home": 1.88, "away": 1.98 } },
  "impliedProbability": { "home": 0.5101, "draw": 0.221, "away": 0.2688, "overround": 0.0053 },
  "impliedProbabilitySource": "betfairExchange closing"
}
```

A bookmaker is left out of an odds block when the source has no price for it that season.

### Pricing

**$0.0005 per match**, no monthly fee. The first row of every run is free. A full Premier League season (380 matches) costs $0.19; ten seasons of the top 5 leagues (about 18,000 matches) cost about $9.

### Related actors

- [Football xG Stats](https://apify.com/scrapemint/football-xg-stats): xG tables, player xG and xA, match xG
- [Flashscore Scraper](https://apify.com/scrapemint/flashscore-scraper): today's fixtures, live scores and odds
- [Pinnacle Odds Scraper](https://apify.com/scrapemint/pinnacle-odds-scraper): live sharp lines
- [Sports Betting Results](https://apify.com/scrapemint/sports-betting-results): US sports closing lines vs final scores

# Actor input Schema

## `leagues` (type: `array`):

Names or codes. Europe (every season since 1993/94): Premier League E0, Championship E1, League One E2, League Two E3, National League EC, Scottish Premiership SC0 (SC1-SC3), Bundesliga D1, 2. Bundesliga D2, Serie A I1, Serie B I2, La Liga SP1, Segunda SP2, Ligue 1 F1, Ligue 2 F2, Eredivisie N1, Belgium B1, Portugal P1, Turkey T1, Greece G1. Closing odds only (since ~2012): MLS USA, Brazil BRA, Argentina ARG, Mexico MEX, Japan JPN, China CHN, Austria AUT, Denmark DNK, Finland FIN, Ireland IRL, Norway NOR, Poland POL, Romania ROU, Russia RUS, Sweden SWE, Switzerland SWZ.

## `seasons` (type: `array`):

e.g. 2025/2026, 2024/2025. Up to 35. Empty = use Last seasons.

## `lastSeasons` (type: `integer`):

When no seasons are given: the current season and the N-1 before it. 1 = current season only.

## `teams` (type: `array`):

Keep only matches with one of these teams (partial match, football-data spelling, e.g. Man United, Nott'm Forest).

## `dateFrom` (type: `string`):

YYYY-MM-DD. Optional.

## `dateTo` (type: `string`):

YYYY-MM-DD. Optional.

## `includeAllBookmakers` (type: `boolean`):

Also add every raw odds column of the source file (William Hill, Bet\&Win, Ladbrokes, BetVictor, Interwetten and more, depending on season).

## `maxRows` (type: `integer`):

Cap on rows returned (newest first). Controls cost.

## Actor input object example

```json
{
  "leagues": [
    "E0",
    "SP1",
    "I1",
    "D1",
    "F1"
  ],
  "lastSeasons": 1,
  "includeAllBookmakers": false,
  "maxRows": 5000
}
```

# Actor output Schema

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

One row per match.

## `summary` (type: `string`):

Leagues, seasons and matches returned.

# 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 = {
    "leagues": [
        "E0",
        "SP1",
        "I1",
        "D1",
        "F1"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/historical-football-odds").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 = { "leagues": [
        "E0",
        "SP1",
        "I1",
        "D1",
        "F1",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/historical-football-odds").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 '{
  "leagues": [
    "E0",
    "SP1",
    "I1",
    "D1",
    "F1"
  ]
}' |
apify call scrapemint/historical-football-odds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapemint/historical-football-odds"
        }
    }
}
```

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/NoMLSvPgdtSCgXMmM/builds/Bnh9mmYyWJgYmtr3T/openapi.json
