# Football Matches, Odds & Pre-Match Analytics (`rishideva/football-matches-odds-h2h`) Actor

Football fixtures for any date with pre-match analytics: 1X2 odds, head-to-head with draws, team form and league position. Premier League, Champions League, LaLiga, Serie A and 700+ competitions. Data from SofaScore.

- **URL**: https://apify.com/rishideva/football-matches-odds-h2h.md
- **Developed by:** [Rishi Deva](https://apify.com/rishideva) (community)
- **Categories:** Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 60.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 matches

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 Matches, Odds & Pre-Match Analytics

Get **football matches for any date** with **pre-match analytics in one run**: 1X2 betting odds, head-to-head record with draws, team form, current league position and team rating. The most popular competitions come first: Premier League, Champions League, LaLiga, Serie A, Bundesliga, Ligue 1 and hundreds more. Data comes from SofaScore.

No coding, no API keys, no browser automation. Pick a date, optionally your leagues, and get a clean dataset.

### Why this Actor

Most football scrapers give you either fixtures or odds. This Actor combines the data you need to analyze a match:

- 📅 **Daily fixtures** for any date, sorted by competition popularity
- 💰 **1X2 odds** (decimal): home win, draw, away win
- ⚔️ **Head-to-head**: home wins, draws, away wins, optional list of the last 5 meetings with scores
- 📈 **Team form** (e.g. `WWDLW`) and **current league position** of both teams
- 🏆 Country, league, round, status, final score and result for finished matches
- 📊 **Match statistics** (possession, shots, xG and more) for finished matches, optional
- 🔁 **Reliable**: automatic retries and proxy rotation

### Use cases

- **Betting research** and value-bet models
- **Football analytics** and machine learning datasets
- **Daily previews** for websites, Telegram channels and newsletters
- **AI agents** that need structured football data
- Scheduled daily runs to build your own **historical database**

### Input

| Field | Description | Default |
|---|---|---|
| `date` | Match date `YYYY-MM-DD` (UTC). Empty = today | today |
| `leagues` | Filter by league or country, e.g. `England`, `LaLiga`, `Champions League`. Empty = all | all |
| `maxMatches` | Maximum number of matches | 50 |
| `includeOdds` | Add 1X2 odds | true |
| `includeH2H` | Add head-to-head record | true |
| `includeForm` | Add team form and league position | true |
| `includeLastMeetings` | Add last 5 meetings with scores | false |
| `includeStatistics` | Add statistics for finished matches | false |

Example input:

```json
{
    "leagues": ["England", "Champions League"],
    "maxMatches": 30
}
```

### Output

One item per match. Example (shortened):

```json
{
    "startTimeUtc": "2026-11-03T20:00:00+00:00",
    "country": "England",
    "league": "Premier League",
    "round": 11,
    "homeTeam": "Newcastle United",
    "awayTeam": "Everton",
    "odds": { "home": 2.1, "draw": 3.4, "away": 3.4 },
    "h2hHomeWins": 2,
    "h2hDraws": 2,
    "h2hAwayWins": 6,
    "formHome": { "last": "LWLLW", "wins": 2, "draws": 0, "losses": 3, "leaguePosition": 12 },
    "formAway": { "last": "WDWLW", "wins": 3, "draws": 1, "losses": 1, "leaguePosition": 9 },
    "status": "notstarted",
    "url": "https://www.sofascore.com/football/match/..."
}
```

Export to **JSON, CSV, Excel** or connect via **API**, Make, Zapier, n8n or any AI agent.

### Pricing

You pay only for matches you receive (**pay per result**). Use `maxMatches` and `leagues` to control the cost.

### Tips

- Run it every morning with **Schedules** to get the day's previews automatically.
- `leagues` matches by name, so `England` returns all English competitions on that date.
- Leave `leagues` empty to get the most popular matches of the day first.

### FAQ

**Is it legal?** The Actor collects publicly available sports data. You are responsible for using it in line with applicable laws and the source's terms.

**Is this an official SofaScore API?** No. This Actor is not affiliated with SofaScore.

**Something broke?** Open an issue on the Issues tab and it will be fixed quickly.

# Actor input Schema

## `date` (type: `string`):

Match date in YYYY-MM-DD format (UTC). Leave empty for today.

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

Filter by league or country name, e.g. Premier League, England, LaLiga, Champions League. Leave empty for all - the most popular competitions come first.

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

Maximum number of matches to return.

## `includeOdds` (type: `boolean`):

Add pre-match odds (decimal) for home win, draw and away win.

## `includeH2H` (type: `boolean`):

Add H2H wins and draws between the two teams.

## `includeForm` (type: `boolean`):

Add recent form (W/D/L) and current league position of both teams.

## `includeLastMeetings` (type: `boolean`):

Add the last 5 meetings between the teams with scores. Slower.

## `includeStatistics` (type: `boolean`):

For finished matches, add statistics (possession, shots, xG and more).

## Actor input object example

```json
{
  "maxMatches": 50,
  "includeOdds": true,
  "includeH2H": true,
  "includeForm": true,
  "includeLastMeetings": false,
  "includeStatistics": 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("rishideva/football-matches-odds-h2h").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("rishideva/football-matches-odds-h2h").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 '{}' |
apify call rishideva/football-matches-odds-h2h --silent --output-dataset

```

## MCP server setup

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

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/eWr65kPhsyqP7S33o/builds/QYYtFfLDGsROoUGH9/openapi.json
