# Flashscore Tennis Matches Scraper - Stats & Odds (`s-r/tennis-scraper`) Actor

Flashscore tennis scraper: collect ATP, WTA, Challenger and ITF matches with set scores, tiebreaks, durations, per-set statistics, head-to-head results and bookmaker opening and current odds, or pull a player's history.

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

## Pricing

Pay per event

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 Scraper — Flashscore Matches, Statistics and Odds

This tennis scraper collects Flashscore match results, schedules, set scores, tiebreaks, match statistics, head-to-head meetings and bookmaker odds. Use it for sports datasets, fantasy research, editorial coverage and your own analytical models. Choose ATP, WTA, Challenger or ITF tennis, including singles and doubles, and add only the detail sections you need.

### Tennis scraper input

Start with an empty input to collect today's matches. Dates use UTC and the `YYYY-MM-DD` format. `date_from` and `date_to` select an inclusive range. The daily schedule supports dates from seven days before today to seven days after today. Future dates can return an empty schedule when the source has not published matches yet. Exact UTC filtering uses the match start time; a delayed match listed in another day's schedule may therefore fall outside your requested day.

Use `tours` to select `atp`, `wta`, `challenger`, `itf`, `teams` or `other`. Leaving it unset includes every category. The `match_type` filter accepts `singles`, `doubles` or `all`; mixed doubles belong to doubles. Set `gender` to `men`, `women` or `all`. The `status` filter accepts `scheduled`, `live`, `finished` or `all`. Matches with a retirement or walkover are finished matches, with the specific reason retained in `status_detail`.

For known matches, provide `match_ids`, a list of eight-character Flashscore identifiers. This replaces the date and category filters. For historical results, provide a `player` name instead. Player history can extend beyond the daily date window. Optional dates then filter that player's results. The selected player's identifier and name are reported; when several names match, refine your query to avoid collecting another player's history. Do not combine `player` with `match_ids`.

The `max_matches` setting limits matches across the entire collection, with a default of 100 and a maximum of 5,000. Statistics and odds add rows to those matches. For example, one match with four statistics periods produces five rows before any head-to-head or odds data is added. This setting therefore does not limit the total number of dataset rows.

### Output and row types

Every dataset row contains `source`, `fetched_at`, `sport`, `match_id`, `row_type`, `_type` and `row_id`. The source is `tennis-scraper`; the sport is `tennis`. The stable `row_id` identifies the particular match, statistics period, head-to-head record or bookmaker market group. Join related rows using `source` and `match_id`, and use `row_type` to select the table you need.

A `match` row contains the two sides as `home` and `away`, competition, start time, status and available scores. These side labels follow the source's ordering and do not imply a home-court advantage. The `home_score` and `away_score` fields count sets won. Individual set scores, tiebreak points and available set durations are in `sets`. Player identifiers, names and countries are retained in `home_players` and `away_players`; doubles contain two players per side. Match duration, surface and indoor information are included when available. Enable `include_round` to request the tournament round.

Enable `include_statistics` for `match_statistics` rows, one per available period such as `match`, `set_1` or `set_2`. Supported values include aces, double faults, first-serve percentage, service points won and break points saved or converted. Percentages are numeric percentage points, so 72 means 72 percent. A source value such as `71% (57/80)` becomes separate percentage, won and total fields. Missing statistics are absent, never manufactured as zeros. ITF coverage often lacks serve statistics and match duration; warnings explain those gaps.

Enable `include_head_to_head` for the two sides' previous meetings and recent matches. The top-level meetings cover all surfaces, while `by_surface` preserves the source's surface sections. Win counts cover the meetings actually returned. Historical meeting winners are expressed relative to the current row's home and away sides.

### Odds and bookmaker selection

Enable `include_odds` to retrieve decimal opening and current prices. `odds_country`, default `GB`, selects the source's bookmaker list. Each `odds` row represents a bookmaker, market and period, with its selections in `outcomes`. Handicap or total lines are numeric. The default `odds_markets` selection is `home_away`. Other choices include `over_under`, `asian_handicap`, `correct_score`, `odd_even` and `all`. Available bookmakers and markets vary by match and country. Opening and current prices are snapshots; a full price movement history is not supplied.

### Example input

This identifier comes from the captured Flashscore Basel match between Shelton and Kym:

```json
{
  "match_ids": ["f38KxM0M"],
  "include_statistics": true,
  "include_head_to_head": true,
  "include_odds": true,
  "include_round": true,
  "odds_markets": ["all"]
}
```

The captured match finished 1–2 in sets, with a total duration of `2:23`. Its set scores were 3–6, 7–6 and 6–7, with the final two tiebreaks recorded separately. This example describes the captured source response; current availability can change.

### Pagination and incomplete results

The Actor collects cursor pages automatically. Direct API users receive `next_cursor` when more matches remain and should submit it with the same input. Do not change the filters while continuing a cursor. Keep collecting until the cursor is null. Daily cursors must be resumed while their dates remain inside the source's daily window.

Warnings describe missing details, ambiguous player names and incomplete collection. Inspect them before treating a dataset as complete. A match can still be returned when one optional detail source is unavailable. An unknown identifier is reported while valid identifiers continue; a selection with no matches produces no dataset rows. Invalid dates and unsupported filter values are reported as input errors.

### Pricing

The current Apify pricing panel shows the applicable prices. Match rows, statistics rows, head-to-head rows and odds rows are counted separately under their corresponding events. Only rows actually delivered to the dataset are counted, after the delivery cap. Empty results generate no row events. Enabling statistics or several odds markets can substantially increase the number of delivered rows. Accounts subject to the free-plan delivery limit receive at most ten rows; this limit covers all row types together.

### FAQ

#### Can I retrieve matches older than seven days?

Yes, use the player-history mode. Date-only collection uses the limited daily schedule window. Historical availability depends on the player's source record and can require multiple collection pages.

#### Why are there several rows for one match?

The dataset includes separate statistics periods, head-to-head records and bookmaker market groups when requested. Filter by `row_type` and join using `match_id`. Use `row_id` when deduplicating complete datasets.

#### Why are ITF service statistics missing?

The source does not provide the same detail for every tournament. Available point statistics may still be returned, and warnings identify missing serve coverage. Missing values do not imply a zero performance.

#### Are odds guaranteed to be available?

No. Availability depends on the match, selected markets and bookmaker country. A match without odds can still produce its match row and other available details. The output preserves the prices published by the source at retrieval time.

# Actor input Schema

## `date_from` (type: `string`):

First UTC date (YYYY-MM-DD). Defaults to today; daily feeds cover today minus 7 through today plus 7. Player history can use older dates.

## `date_to` (type: `string`):

Last UTC date, inclusive. Defaults to date_from.

## `tours` (type: `array`):

Tours to collect. Omit to collect all tours.

## `match_type` (type: `string`):

Singles, doubles (including mixed), or all matches.

## `gender` (type: `string`):

Filter by men or women when the source identifies the category.

## `status` (type: `string`):

Filter by normalized match status.

## `match_ids` (type: `array`):

Explicit Flashscore match IDs; replaces date and category filters. Cannot be combined with player.

## `player` (type: `string`):

Player name for historical results. The selected player is reported; refine ambiguous names. Cannot be combined with match_ids.

## `max_matches` (type: `integer`):

Maximum number of matches across all cursor pages. Detail rows are additional and do not consume this match limit.

## `include_statistics` (type: `boolean`):

Add one statistics row per available period. Missing serve statistics are reported in warnings.

## `include_head_to_head` (type: `boolean`):

Add head-to-head meetings and recent results for both sides.

## `include_odds` (type: `boolean`):

Add bookmaker odds rows for the selected markets, with opening and current decimal prices.

## `include_round` (type: `boolean`):

Retrieve the tournament round when the source provides it.

## `odds_country` (type: `string`):

Bookmaker selection country: uppercase ISO-2 or default. This selects the source bookmaker list.

## `odds_markets` (type: `array`):

Markets to collect; all enables every available market.

## `cursor` (type: `string`):

Opaque next_cursor from the previous response. Resubmit the same input to continue.

## Actor input object example

```json
{
  "match_type": "all",
  "gender": "all",
  "status": "all",
  "match_ids": [
    "f38KxM0M"
  ],
  "max_matches": 100,
  "include_statistics": false,
  "include_head_to_head": false,
  "include_odds": false,
  "include_round": false,
  "odds_country": "GB",
  "odds_markets": [
    "home_away"
  ]
}
```

# Actor output Schema

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

No description

## `output` (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 = {
    "match_ids": [
        "f38KxM0M"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("s-r/tennis-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 = { "match_ids": ["f38KxM0M"] }

# Run the Actor and wait for it to finish
run = client.actor("s-r/tennis-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 '{
  "match_ids": [
    "f38KxM0M"
  ]
}' |
apify call s-r/tennis-scraper --silent --output-dataset

```

## MCP server setup

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