# Tennis Matches, Odds & H2H Analytics (`rishideva/tennis-matches-odds-h2h`) Actor

All tennis matches for any date with pre-match analytics: betting odds, head-to-head, last meetings, player form, surface record, rankings and seeds. ATP, WTA, Challenger, ITF. Data from SofaScore.

- **URL**: https://apify.com/rishideva/tennis-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, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.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

## 🎾 Tennis Matches, Odds & H2H Analytics

Get **all tennis matches for any date** with **pre-match analytics in one run**: betting odds, head-to-head record, last meetings, player form, results on the same surface, rankings and seeds. Data comes from SofaScore and covers ATP, WTA, Challenger, ITF, UTR and more.

No coding, no API keys, no browser automation. Pick a date and get a clean, ready-to-use dataset.

### Why this Actor

Most tennis scrapers give you only a list of matches. To analyze a match you then need several more tools. This Actor does it in one step:

- 📅 **Daily schedule** for any date, sorted by importance (Grand Slams and Masters first)
- 💰 **Pre-match odds** (decimal) for both players
- ⚔️ **Head-to-head**: wins of each player and the last 10 meetings with date, tournament and surface
- 📈 **Player form**: last N results (e.g. `WWLWW`) and wins/losses on the match surface
- 🏆 **Rankings, seeds, round, surface**, score and winner for finished matches
- 📊 **Match statistics** (aces, double faults, serve %) for finished matches, optional
- 🔁 **Reliable**: automatic retries and proxy rotation

### Use cases

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

### Input

| Field | Description | Default |
|---|---|---|
| `date` | Match date `YYYY-MM-DD` (UTC). Empty = today | today |
| `categories` | Filter, e.g. `ATP`, `WTA`, `Challenger`, `ITF`. Empty = all | `ATP`, `WTA` |
| `maxMatches` | Maximum number of matches | 50 |
| `includeDoubles` | Also return doubles matches | false |
| `includeOdds` | Add betting odds | true |
| `includeH2H` | Add head-to-head data | true |
| `includeForm` | Add recent form of both players | true |
| `formMatches` | How many recent matches to use for form | 10 |
| `includeStatistics` | Add statistics for finished matches | false |

Example input:

```json
{
    "date": "2026-11-03",
    "categories": ["ATP", "WTA"],
    "maxMatches": 50
}
```

### Output

One item per match. Real example from a run:

```json
{
    "startTimeUtc": "2026-11-03T10:00:00+00:00",
    "category": "ATP",
    "tournament": "Paris, France",
    "round": "Round of 64",
    "surface": "Hardcourt indoor",
    "status": "notstarted",
    "player1": "Andrey Rublev",
    "player1Ranking": 22,
    "player2": "Tomas Martin Etcheverry",
    "player2Ranking": 31,
    "odds": {
        "player1": 1.4,
        "player2": 3
    },
    "h2hPlayer1Wins": 1,
    "h2hPlayer2Wins": 1,
    "h2hMatches": [
        {
            "date": "2025-06-19",
            "tournament": "Halle, Germany",
            "surface": "Grass",
            "winner": "player2"
        },
        {
            "date": "2024-08-08",
            "tournament": "Montreal, Canada",
            "surface": "Hardcourt outdoor",
            "winner": "player1"
        }
    ],
    "formPlayer1": {
        "last": "LLLLWWWLWW",
        "wins": 5,
        "losses": 5,
        "surfaceWins": 0,
        "surfaceLosses": 2
    },
    "formPlayer2": {
        "last": "LWWLLLWWLW",
        "wins": 5,
        "losses": 5,
        "surfaceWins": 3,
        "surfaceLosses": 4
    },
    "url": "https://www.sofascore.com/tennis/match/tomas-martin-etcheverry-andrey-rublev/fKRsWOrb#id:17449521"
}
```

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 `categories` to control the cost.

### Tips

- Run it every morning with **Schedules** to get the day's previews automatically.
- For upcoming matches the form and H2H show the situation before the match. For finished matches, the current match is excluded from H2H.
- `formPlayer.last` starts with the most recent match.

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

## `categories` (type: `array`):

Filter by category, e.g. ATP, WTA, Challenger, ITF. Leave empty for all.

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

Maximum number of matches to return.

## `includeDoubles` (type: `boolean`):

Also return doubles matches. By default only singles are returned.

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

Add pre-match odds (decimal) for both players.

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

Add H2H record and the last 10 meetings between the players.

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

Add recent form (W/L) and results on the same surface for both players.

## `formMatches` (type: `integer`):

How many recent matches to use for the form string.

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

For finished matches, add statistics (aces, double faults, serve %).

## Actor input object example

```json
{
  "categories": [
    "ATP",
    "WTA"
  ],
  "maxMatches": 50,
  "includeDoubles": false,
  "includeOdds": true,
  "includeH2H": true,
  "includeForm": true,
  "formMatches": 10,
  "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 = {
    "categories": [
        "ATP",
        "WTA"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rishideva/tennis-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 = { "categories": [
        "ATP",
        "WTA",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rishideva/tennis-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 '{
  "categories": [
    "ATP",
    "WTA"
  ]
}' |
apify call rishideva/tennis-matches-odds-h2h --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rishideva/tennis-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/KJPFSoLZAAedt9wgl/builds/s87YLIt3JR061Szb2/openapi.json
