# Betfair Odds Scraper (`mrdoe/betfair-odds-scraper`) Actor

Real-time back and lay prices from the Betfair Exchange: match winner, over/under, both teams to score and more, with full order-book depth per selection.

- **URL**: https://apify.com/mrdoe/betfair-odds-scraper.md
- **Developed by:** [MrDoe](https://apify.com/mrdoe) (community)
- **Categories:** Sports
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 results

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

![Betfair Odds Scraper - real-time back and lay prices with full order-book depth for football matches.](https://api.apify.com/v2/key-value-stores/kE36venAoVchGsE6b/records/betfair-odds-scraper--1-exchange.png)

### What does Betfair Odds Scraper do?

Betfair Odds Scraper collects real-time back and lay prices from the official [Betfair Exchange](https://www.betfair.com/exchange/plus/) for football matches. Unlike a traditional sportsbook feed that gives you a single number per outcome, this Actor returns full order-book depth: the best available price to back and to lay each selection, with multiple price/size levels, for Match Odds plus every other market offered on a fixture (over/under goals, both teams to score, correct score, Asian handicap, double chance and more).

### Why use Betfair Odds Scraper?

- Real back AND lay prices, not just a single quoted odds figure - see what the market actually thinks an outcome is worth.
- Multiple price levels per selection (how much is available at each price), useful for understanding real liquidity, not just the headline number.
- Covers every market type offered on a fixture, not just the 1X2 headline market.
- Clean, stable schema - one row per market selection, ready for spreadsheets, databases, or your own trading/analysis tools.

### Who can use this Actor and how?

- **Bettors and traders:** compare the depth and movement of real exchange prices against sportsbook odds.
- **Quant teams:** build historical order-book datasets for modelling liquidity and price discovery.
- **Arbitrage and value-bet builders:** feed real back/lay prices into your own detection logic.
- **Researchers:** study how exchange markets price football outcomes compared to fixed-odds bookmakers.

### How to use Betfair Odds Scraper

1. Find a fixture you want on the Betfair Exchange website and copy its numeric event ID from the page URL (for example, the `36205839` in `.../event/36205839`).
2. Paste one or more event IDs into the **Event IDs** input.
3. Optionally filter by **Market types** (for example just `MATCH_ODDS`) or leave it to collect every market type found on that fixture.
4. Run the Actor and download your results as JSON, CSV or Excel.

### Input

| Field | Type | Description |
| --- | --- | --- |
| `eventIds` | array | Real Betfair Exchange event IDs to collect. |
| `marketTypes` | array | Filter by market type (e.g. `MATCH_ODDS`, `OVER_UNDER_25`, `BOTH_TEAMS_TO_SCORE`). Leave empty for every market type found per event. |
| `maxEvents` | integer | Maximum number of events to collect per run. Default 10. |
| `maxResults` | integer | Maximum number of selection rows written to the dataset. Default 200. |
| `proxyConfiguration` | object | A UK-targeted residential proxy is used by default for reliable access. |

### Output

Each row is one selection within one market on one real fixture:

```json
{
  "bookmaker": "Betfair",
  "sport": "Football",
  "eventName": "Liverpool v Arsenal",
  "home": "Liverpool",
  "away": "Arsenal",
  "startTime": "2026-11-01T16:30:00.000Z",
  "marketName": "Match Odds",
  "marketType": "MATCH_ODDS",
  "runnerName": "Liverpool",
  "lastPriceTraded": 3.0,
  "bestBackPrice": 2.98,
  "bestBackSize": 690.12,
  "bestLayPrice": 3.0,
  "bestLaySize": 1408.97,
  "availableToBack": [{ "price": 2.98, "size": 690.12 }, { "price": 2.96, "size": 2111.13 }],
  "availableToLay": [{ "price": 3.0, "size": 1408.97 }, { "price": 3.05, "size": 4672.57 }],
  "scrapedAt": "2026-11-01T16:00:00.000Z"
}
```

You can download results in JSON, CSV, Excel, HTML or XML from the Apify Console, or pull them via the API.

### Data fields

| Field | Description |
| --- | --- |
| `eventName`, `home`, `away`, `startTime` | The real fixture and kickoff time. |
| `marketName`, `marketType`, `marketStatus` | Which market this row belongs to, and whether it's open, suspended or closed. |
| `totalMatched`, `totalAvailable` | Real total money matched and currently available on this market. |
| `runnerName`, `lastPriceTraded` | The selection and the last real price it traded at. |
| `bestBackPrice` / `bestBackSize` | The best real price currently available to back this selection, and how much. |
| `bestLayPrice` / `bestLaySize` | The best real price currently available to lay this selection, and how much. |
| `availableToBack` / `availableToLay` | The full real price ladder (multiple price/size levels), not just the best one. |

### Reliability and limitations

- Football is the sport verified in depth for this build. Other sports on the Exchange may work with the same approach but have not been verified.
- You currently provide the fixtures you want by event ID rather than by competition or league name - browsing-by-competition is not yet supported in this version.
- Markets that are closed or suspended are still returned, with `marketStatus` reflecting their real state - no fabricated prices are ever produced for a market with no live price.
- Exchange prices move continuously; a run only reflects the real prices at the exact moment it ran.

### Frequently Asked Questions

**Where does the data come from?** Real, publicly viewable prices from the Betfair Exchange website - the same data any visitor sees.

**Do I need a Betfair account?** No. This Actor reads public price data only; it never logs in, places bets or needs any account credentials.

**Can I run this on a schedule?** Yes - schedule it from the Apify platform to track price movement over time.

**Why do some rows have null best prices?** That selection currently has no real liquidity on that side of the book - shown honestly as `null`, not invented.

### Responsible use

This Actor reads publicly accessible exchange data only. Use the collected data in line with Betfair's own terms of service and your local laws, particularly around gambling-related data.

# Actor input Schema

## `eventIds` (type: `array`):

Real Betfair Exchange event IDs to collect. Find an event's ID in its Exchange page URL, for example the "36205839" in .../event/36205839 - current fixtures only, event IDs expire once the event finishes.

## `marketTypes` (type: `array`):

Filter by market type (e.g. "MATCH_ODDS", "OVER_UNDER_25", "BOTH_TEAMS_TO_SCORE"). Leave empty for every market type found per event.

## `maxEvents` (type: `integer`):

Maximum number of events to collect across all competitions. Each one costs one or two real API calls.

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

Maximum number of selection rows written to the dataset.

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

A UK-targeted residential proxy is required for reliable access on the Apify platform.

## Actor input object example

```json
{
  "eventIds": [
    "36205839",
    "36206268"
  ],
  "marketTypes": [
    "MATCH_ODDS"
  ],
  "maxEvents": 10,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "GB"
  }
}
```

# 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 = {
    "eventIds": [
        "36205839",
        "36206268"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mrdoe/betfair-odds-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 = { "eventIds": [
        "36205839",
        "36206268",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mrdoe/betfair-odds-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 '{
  "eventIds": [
    "36205839",
    "36206268"
  ]
}' |
apify call mrdoe/betfair-odds-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,mrdoe/betfair-odds-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/k2CTSN17Gm6LW02Ka/builds/VwxwahnYvREkTTcCd/openapi.json
