# Betting Odds — Fixtures & Closing Odds (`xtracto/oddsportal-odds`) Actor

Average 1X2 betting odds from OddsPortal: upcoming fixtures with UTC kickoff and venue, or recent matches with their closing odds, plus the bookmaker overround. HTTP-only, no login, no browser.

- **URL**: https://apify.com/xtracto/oddsportal-odds.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Other
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## OddsPortal Odds Scraper

Average 1X2 betting odds from [OddsPortal](https://www.oddsportal.com): upcoming fixtures with kickoff time and venue, or recent matches with their closing odds, for any sport and league the site covers.

### Why use this actor

- **No login and no API key.** Just list the leagues you want.
- **Home, draw and away prices on one row**, with the bookmaker margin (`overround`) already calculated.
- **Home and away are always correct.** Teams are taken from the fixture itself, not guessed from the page layout, so odds are never flipped.
- **Knows which sports have no draw.** Basketball and other two-way markets are labelled `1-2` and leave `drawOdds` empty instead of filling it with the wrong price.
- **Clear errors instead of wrong rows.** A league that cannot be read comes back with an `_error` explaining why.
- **Stable JSON output** you can export to JSON, CSV or Excel, or schedule on Apify to build an odds history.

### How it works

1. Enter one or more leagues as OddsPortal paths, such as `football/england/premier-league` or `basketball/usa/nba` (a full league link also works).
2. Pick **Upcoming fixtures + odds** or **Recent results + closing odds**.
3. The actor reads each league page and saves one row per match, up to your limit.
4. Download the dataset or connect it to your sheet, database or model.

You do not need to manage scrapers, browsers or blocks.

### Input

```json
{
  "leaguePaths": ["football/england/premier-league"],
  "mode": "fixtures",
  "maxMatches": 100,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "apifyProxyCountry": "GB" }
}
```

| Field | Type | Description |
|---|---|---|
| `leaguePaths` | array of strings | Leagues to read, as OddsPortal paths (`football/england/premier-league`) or full league links. |
| `mode` | string | `fixtures` = upcoming matches with average odds, UTC kickoff and venue. `results` = most recent finished matches with closing odds. |
| `maxMatches` | integer | Stop after this many matches per league (1-500, default 100). Results reach at most the 50 most recent matches per league. |
| `proxyConfiguration` | object | Residential proxy pinned to one country (GB by default). Required, see Notes. |

### Output

A real `results` row (`football/england/premier-league`):

```json
{
  "_input": "football/england/premier-league",
  "_source": "S1-oddsportal-dom-only",
  "_scrapedAt": "2026-11-11T13:17:53Z",
  "matchId": "Me9aWSp3",
  "matchUrl": "https://www.oddsportal.com/football/h2h/aston-villa-W00wmLO0/manchester-united-ppjDR086/#Me9aWSp3",
  "league": "football/england/premier-league",
  "surface": "results",
  "homeTeam": "Manchester Utd",
  "awayTeam": "Aston Villa",
  "matchName": "Manchester Utd - Aston Villa",
  "startsAt": null,
  "localTime": null,
  "status": null,
  "venue": null,
  "city": null,
  "country": null,
  "homeWinOdds": 2.15,
  "drawOdds": 4.21,
  "awayWinOdds": 3.54,
  "oddsComplete": true,
  "market": "1X2",
  "oddsType": "average",
  "overround": -0.0149
}
```

A real `fixtures` row from the same league. This sample was captured from a home connection without the GB proxy, where the site hides the prices, so the odds fields are empty; with the default GB proxy they are filled the same way as above.

```json
{
  "_input": "football/england/premier-league",
  "_source": "S1-oddsportal-ldjson+dom",
  "_scrapedAt": "2026-11-11T13:16:57Z",
  "matchId": "MuVKeqEE",
  "matchUrl": "https://www.oddsportal.com/football/h2h/fulham-69ZiU2Om/manchester-city-Wtn9Stg0/#MuVKeqEE",
  "league": "football/england/premier-league",
  "surface": "fixtures",
  "homeTeam": "Manchester City",
  "awayTeam": "Fulham",
  "matchName": "Manchester City - Fulham",
  "startsAt": "2026-11-21T12:30:00.000Z",
  "localTime": null,
  "status": "EventScheduled",
  "venue": "Etihad Stadium",
  "city": "Manchester",
  "country": "England",
  "homeWinOdds": null,
  "drawOdds": null,
  "awayWinOdds": null,
  "oddsComplete": false,
  "market": "1X2",
  "oddsType": "average",
  "overround": null
}
```

| Field | Type | Description |
|---|---|---|
| `_input`, `_source`, `_scrapedAt` | string | Which league input produced the row, how it was read, and when. |
| `matchId`, `matchUrl` | string | OddsPortal match ID and link to the match page. |
| `league`, `surface` | string | League path, and `fixtures` or `results`. |
| `homeTeam`, `awayTeam`, `matchName` | string | Teams in true home/away order. |
| `startsAt` | string or null | Kickoff in UTC (fixtures only). |
| `localTime` | string or null | Kickoff time as shown on the page, when available. |
| `status` | string or null | Match status, for example `EventScheduled` (fixtures). |
| `venue`, `city`, `country` | string or null | Where the match is played (fixtures). |
| `homeWinOdds`, `drawOdds`, `awayWinOdds` | number or null | Average decimal odds. `drawOdds` is null on a two-way market. |
| `oddsComplete` | boolean | `true` when every price of this market is present. |
| `market` | string | `1X2` (with draw) or `1-2` (no draw, for example basketball). |
| `oddsType` | string | `average` – the site's average across bookmakers. |
| `overround` | number or null | Implied probabilities summed minus one: the bookmaker margin (0.064 = 6.4%). |
| `_error` | string | Only on a failed league: `not_found`, `regional_mirror`, `no_matches`, `network_error` or `refused`. |

### Notes and limits

- **Pin the proxy to one country.** OddsPortal changes brand and language depending on where the visitor is. The default GB residential proxy gives the English site with prices. A mismatched location returns a clear `regional_mirror` error instead of rows in another language.
- **Results reach the 50 most recent matches per league.** The actor warns if you ask for more.
- **Prices are the site's average across bookmakers**, not a per-bookmaker breakdown.
- **Scores are not collected**, only odds. Results rows have no UTC kickoff or venue.
- Typical football margins on average 1X2 prices are around 5-8%; basketball margins are lower.

# Actor input Schema

## `leaguePaths` (type: `array`):

Leagues to read, as OddsPortal paths such as 'football/england/premier-league' or 'basketball/usa/nba'. A full OddsPortal league URL also works, with or without a trailing /results/ — the surface is chosen by the Mode field instead.

## `mode` (type: `string`):

'fixtures' reads upcoming matches with their average 1X2 odds, kickoff time in UTC and venue. 'results' reads the most recent finished matches with their closing odds; that page carries no structured data, so it has no UTC kickoff, and scores are not collected (see the README for why).

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

Stop after this many matches for each league. The results surface reaches at most the 50 most recent matches per league, because the site pages results with a URL fragment that is never sent to the server.

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

Residential proxy pinned to one country is required. The site picks a brand and language from the exit IP: unpinned requests returned OddsAgora in Portuguese and CentroQuote in Italian instead of OddsPortal, and this actor refuses those rather than parsing them.

## Actor input object example

```json
{
  "leaguePaths": [
    "football/england/premier-league"
  ],
  "mode": "fixtures",
  "maxMatches": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "GB"
  }
}
```

# Actor output Schema

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

One row per scraped record, stored in the run's default dataset.

# 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 = {
    "leaguePaths": [
        "football/england/premier-league"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xtracto/oddsportal-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 = { "leaguePaths": ["football/england/premier-league"] }

# Run the Actor and wait for it to finish
run = client.actor("xtracto/oddsportal-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 '{
  "leaguePaths": [
    "football/england/premier-league"
  ]
}' |
apify call xtracto/oddsportal-odds --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,xtracto/oddsportal-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/9oTtjRu288JWRUySF/builds/YPeO2rlQczl37EOdG/openapi.json
