# Tennis Player Stats & Match History Scraper (`nitinjha/tennis-player-stats-scraper`) Actor

Scrape full career match history and stats for any ATP/WTA tennis player. No proxy needed, no anti-bot.

- **URL**: https://apify.com/nitinjha/tennis-player-stats-scraper.md
- **Developed by:** [Nitin jha](https://apify.com/nitinjha) (community)
- **Categories:** Developer tools, Automation, Other
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 match scrapeds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Tennis Player Stats & Match History Scraper

Export full career match history and stats for any ATP or WTA tennis player to JSON, CSV, or any downstream tool. No proxy needed, no anti-bot to fight — just clean, structured data straight from tennisabstract.com.

**Last verified working:** August 2026 · **Schema version:** 1.0.0

***

### Why this scraper?

**1. Full career history, not just a "recent form" snapshot.**
Most player-stats tools show you the last few months. This one pulls a player's entire recorded match log — for a top player that's hundreds or even 1,000+ matches, going back to their teenage ITF Futures days. Novak Djokovic alone returns 1,400+ tour-level matches spanning two decades.

**2. Real per-match stats, not just scores.**
Every row includes ace%, double-fault%, first/second serve points won, break points saved, and Dominance Ratio — computed with the same formulas tennisabstract.com itself uses (independently verified match-by-match, not estimated).

**3. Never silently fails.**
If a player name can't be resolved, that player fails loudly in the log — but other valid players in the same run still complete. If a run produces zero matches for every player, the actor exits with a non-zero code and a clear error message instead of a quiet empty dataset.

***

### Input

| Field | Required | Default | Description |
|---|---|---|---|
| `players` | Yes (or `playerUrls`) | — | e.g. `["Carlos Alcaraz", "Iga Swiatek"]` |
| `playerUrls` | Optional | — | Direct tennisabstract.com player URLs |
| `maxMatchesPerPlayer` | No | `0` (all) | Most recent N matches per player. `0` = full career history |
| `matchType` | No | `all` | `all` or `tour-level` (excludes Challengers, Qualifying, Futures, Juniors) |
| `includePlayerProfile` | No | `false` | Also push a player summary row (rank, Elo, DOB, country) |

***

### Output fields

Every match row contains these fields. Missing values are `null` — never silently dropped or fabricated.

| Field | Type | Description |
|---|---|---|
| `matchId` | string | Unique match identifier |
| `playerName` / `playerSlug` | string | The player you requested |
| `playerCountry` | string | null | ISO 3166-1 alpha-3 country code |
| `opponentName` | string | Opponent's name |
| `opponentSlug` | string | null | Best-effort derived slug |
| `opponentCountry` | string | null | ISO 3166-1 alpha-3 country code |
| `opponentRank` / `playerRank` | integer | null | ATP/WTA ranking at the time of the match |
| `matchDate` | ISO 8601 date | Match date |
| `tournament` | string | Tournament name |
| `surface` | string | null | Hard, Clay, Grass, Carpet |
| `round` | string | e.g. `F`, `SF`, `QF`, `R16` |
| `playerWon` | boolean | Whether the requested player won |
| `score` | string | Set score, e.g. `6-4 7-6(3)` |
| `dominanceRatio` | float | null | % return points won ÷ % serve points lost |
| `acePct` / `doubleFaultPct` | float | null | Serve stats, as a percentage of service points |
| `firstServeInPct` / `firstServeWonPct` / `secondServeWonPct` | float | null | Serve performance breakdown |
| `breakPointsSaved` | string | null | e.g. `"5/6"` |
| `matchDurationMinutes` | integer | null | Match length |
| `sourcePage` | string | URL this match was scraped from |
| `scrapedAt` | ISO 8601 datetime | When this row was extracted |
| `schemaVersion` | string | `1.0.0` — for pipeline compatibility |

When `includePlayerProfile` is enabled, one additional row per player is pushed with `recordType: "profile"` containing current rank, peak rank, Elo rating, Elo rank, date of birth, height, plays (hand), and country.

***

### Pricing

Charged per match successfully pushed — you only pay for results, never for retries or failures.

| Volume | Cost |
|---|---|
| 100 matches | ~$0.10 |
| 1,000 matches | ~$1.00 |
| 10,000 matches | ~$10.00 |

Player profile rows are charged separately and only when `includePlayerProfile` is enabled.

***

### How to export a player's full match history to CSV

1. Run the actor with the player name(s) you want.
2. In the Apify Console, open the **Dataset** tab and click **Export → CSV**.
3. Or hit the API directly: `GET https://api.apify.com/v2/datasets/{datasetId}/items?format=csv`

### How to get a tennis player's entire career match log

Leave `maxMatchesPerPlayer` at `0`. The actor returns the player's complete recorded history in one run — for long-career players that's their full ATP/WTA tour record plus lower-level Challenger, Qualifying, and Futures matches going back to their earliest recorded results.

### How to get only tour-level matches (exclude Challengers/Qualifiers)

Set `matchType` to `tour-level`. This keeps Grand Slams, Masters, regular ATP/WTA tour events, Tour Finals, Olympics, and Davis/Fed Cup — and excludes Challengers, Qualifying, Futures, and Juniors matches.

### Tennis stats API alternative

This actor delivers ATP/WTA match history and stats without an official paid tennis data API. It reads publicly available match records — the same data any visitor to tennisabstract.com sees.

### How to build a tennis betting or analytics model with match data

Feed the `score`, `surface`, `dominanceRatio`, and serve-stat fields into a model to study surface-specific performance, head-to-head trends, or serve/return efficiency over a player's career. Combine with `matchDate` to track form over time.

***

### Integrations

Works out of the box with:

- **Apify API** — fetch results as JSON, CSV, XLSX, XML
- **Make (formerly Integromat)** — Apify module available
- **Zapier** — Apify Zap available
- **n8n** — Apify node available
- **Google Sheets** — via Apify's native Google Sheets integration

***

### Legal & ethics

This actor scrapes only **public match data** visible to any web visitor without authentication. Users are responsible for compliance with tennisabstract.com's terms of use and any applicable local regulations.

***

### Changelog

| Date | Version | Notes |
|---|---|---|
| 2026-08-22 | 0.1 | Initial release — full career match history, verified stat formulas, tour-level filter, PPE charging |

# Actor input Schema

## `players` (type: `array`):

List of player full names. Example: \["Carlos Alcaraz", "Iga Swiatek"]. Resolved against tennisabstract.com's player index.

## `playerUrls` (type: `array`):

Direct tennisabstract.com player URLs. Use this as an alternative to players. Example: \["https://www.tennisabstract.com/cgi-bin/player.cgi?p=CarlosAlcaraz"]

## `maxMatchesPerPlayer` (type: `integer`):

Maximum number of matches to extract per player, most recent first. Set to 0 for full career history.

## `matchType` (type: `string`):

Filter by competition level.

## `includePlayerProfile` (type: `boolean`):

When enabled, also push one player-level summary row per player (current rank, peak rank, Elo, DOB, country).

## Actor input object example

```json
{
  "players": [
    "Carlos Alcaraz"
  ],
  "maxMatchesPerPlayer": 100,
  "matchType": "all",
  "includePlayerProfile": false
}
```

# Actor output Schema

## `matches` (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 = {
    "players": [
        "Carlos Alcaraz"
    ],
    "maxMatchesPerPlayer": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("nitinjha/tennis-player-stats-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 = {
    "players": ["Carlos Alcaraz"],
    "maxMatchesPerPlayer": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("nitinjha/tennis-player-stats-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 '{
  "players": [
    "Carlos Alcaraz"
  ],
  "maxMatchesPerPlayer": 100
}' |
apify call nitinjha/tennis-player-stats-scraper --silent --output-dataset

```

## MCP server setup

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