# Global Football Intelligence & Poisson H2H Predictor ⚽📊 (`khnaami/global-football-intelligence-poisson-h2h-predictor`) Actor

A football analytics Actor covering top global leagues (Premier League, La Liga, Serie A, Bundesliga, Indian Super League - ISL, Saudi Pro League, MLS), continental club cups (UEFA Champions League, CAF, AFC Elite), the FIFA World Cup 2026, and bivariate Poisson xG match prediction models.

- **URL**: https://apify.com/khnaami/global-football-intelligence-poisson-h2h-predictor.md
- **Developed by:** [khalid naami](https://apify.com/khnaami) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 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

## Apify Actor: Global Football Intelligence & Poisson H2H Predictor ⚽📊

A football analytics Actor covering top global leagues (Premier League, La Liga, Serie A, Bundesliga, Indian Super League - ISL, Saudi Pro League, Botola Pro, MLS), continental club cups (UEFA Champions League, CAF, AFC Elite), the FIFA World Cup 2026, and bivariate Poisson xG match prediction models.

***

### 🌟 Key Features

1. **Top 20 Global Competitions**: Detailed telemetry and standings for Premier League, La Liga, Indian Super League (ISL), Bundesliga, Ligue 1, Serie A, SPL, Botola Pro, MLS, UEFA Champions League, CAF Champions League, AFC Champions League Elite, and World Cup 2026.
2. **Real-Time Match Center & Fixtures**: Scores, minutes, expected goals ($xG$), possession percentages, shots on target, and match events.
3. **Player Statistics & Golden Boot Leaderboards**: Top scorers, assists leaders, key passes created, penalty conversions, and mins-per-goal ratios.
4. **Bivariate Poisson H2H Predictor**: Uses attacking/defending efficiency indices and home advantage coefficients to compute exact Win/Draw/Loss probabilities, Over/Under 2.5 goals, BTTS, and most likely scorelines (e.g. 2-1, 1-1, 3-1).

***

### 📥 Input Schema

| Field | Type | Default | Description |
|---|---|---|---|
| `selectedLeagues` | Array | 13 competitions | Filter specific leagues or fetch all supported competitions. |
| `includeStandings` | Boolean | `true` | Include league table points, GD, and form guide. |
| `includeFixturesAndLiveScores` | Boolean | `true` | Include live match events and upcoming fixtures. |
| `includeTopScorers` | Boolean | `true` | Include top goalscorer and assist leaderboards. |
| `simulateH2H` | Boolean | `true` | Calculate bivariate Poisson match probability simulation. |
| `simulateH2HHomeTeam` | String | `"Manchester City"` | Home club for H2H simulation. |
| `simulateH2HAwayTeam` | String | `"Arsenal"` | Away club for H2H simulation. |

***

### 📤 Output Dataset Format

```json
{
  "record_type": "h2h_poisson_prediction",
  "home_team": "Manchester City",
  "away_team": "Arsenal",
  "home_expected_goals_xg": 2.24,
  "away_expected_goals_xg": 1.52,
  "win_probability_home_pct": 52.8,
  "draw_probability_pct": 23.4,
  "win_probability_away_pct": 23.8,
  "over_2_5_goals_probability_pct": 68.2,
  "both_teams_to_score_btts_pct": 61.5,
  "most_likely_scorelines": [
    { "score": "2 - 1", "probability_pct": 11.4 },
    { "score": "2 - 2", "probability_pct": 8.7 },
    { "score": "1 - 1", "probability_pct": 8.1 }
  ]
}
```

***

### 🚀 How to Run Locally

```bash
cd actor-football-intelligence
pip install -r requirements.txt
python -m src.main
```

# Actor input Schema

## `selectedLeagues` (type: `array`):

Select football competitions to harvest data for (leave empty for all supported).

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

Include points, goal difference, win/draw/loss records, and recent form guide.

## `includeFixturesAndLiveScores` (type: `boolean`):

Include real-time match events, minutes, live scores, and venue metadata.

## `includeTopScorers` (type: `boolean`):

Include top goalscorers, assists leaders, xG metrics, and player attributes.

## `simulateH2H` (type: `boolean`):

Calculate bivariate Poisson match probability distribution and expected goals.

## `simulateH2HHomeTeam` (type: `string`):

Home club name for probability simulation.

## `simulateH2HAwayTeam` (type: `string`):

Away club name for probability simulation.

## `apiKey` (type: `string`):

Optional Apify API token or custom authentication key for MCP and programmatic triggers.

## Actor input object example

```json
{
  "selectedLeagues": [
    "English Premier League 🏴󠁧󠁢󠁥󠁮󠁧󠁿",
    "Indian Super League (ISL) 🇮🇳",
    "Spanish La Liga 🇪🇸",
    "German Bundesliga 🇩🇪",
    "Italian Serie A 🇮🇹",
    "French Ligue 1 🇫🇷",
    "Saudi Pro League 🇸🇦",
    "Moroccan Botola Pro 🇲🇦",
    "Major League Soccer (MLS) 🇺🇸",
    "UEFA Champions League 🇪🇺",
    "CAF Champions League 🌍",
    "AFC Champions League Elite 🌏",
    "FIFA World Cup 2026 🏆"
  ],
  "includeStandings": true,
  "includeFixturesAndLiveScores": true,
  "includeTopScorers": true,
  "simulateH2H": true,
  "simulateH2HHomeTeam": "Manchester City",
  "simulateH2HAwayTeam": "Arsenal"
}
```

# Actor output Schema

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

Full league tables, fixtures, player leaderboards, and Poisson H2H predictions

## `overview` (type: `string`):

Summary report stored in Key-Value store

# 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("khnaami/global-football-intelligence-poisson-h2h-predictor").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("khnaami/global-football-intelligence-poisson-h2h-predictor").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 khnaami/global-football-intelligence-poisson-h2h-predictor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khnaami/global-football-intelligence-poisson-h2h-predictor"
        }
    }
}
```

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/579D4dG7rV7FseNQk/builds/85wT1FRa20ZxhFAGC/openapi.json
