# ⚽ Transfermarkt Scraper (`scraper-engine/transfermarkt-scraper`) Actor

Scrape players, competition tables and injured-player lists from Transfermarkt with automatic page-type detection and smart proxy escalation.

- **URL**: https://apify.com/scraper-engine/transfermarkt-scraper.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Automation, Developer tools, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## ⚽ Transfermarkt Scraper

Extract structured football data from [Transfermarkt](https://www.transfermarkt.com) — **player profiles**, **competition tables**, and **injured-player lists** — from nothing but a page URL. The Actor **auto-detects the page type** and returns clean, normalized JSON, complete with full **transfer history** and **season-by-season career statistics** for players.

> Just paste a URL. The scraper figures out the rest.

---

### 💡 Why choose this Actor?

- **Zero configuration** — only a start URL is required; page type is detected automatically.
- **Smart proxy escalation** — starts with a direct connection and only escalates (datacenter → residential, sticky) when Transfermarkt pushes back, so you stay fast *and* unblocked.
- **Rich, normalized output** — dates as `DD/MM/YYYY`, structured transfer objects (clubs, IDs, market value, fee, contract), and aggregated career stats per competition & season.
- **Live results** — every row is saved the moment it's scraped, so partial runs never lose data.
- **Polished dataset views** — separate, labeled views for Players, Competitions and Injured Players.

---

### ✨ Key features

- 👤 **Player profiles** — bio, citizenship, position, foot, agent, club, contract dates, outfitter, social media.
- 🔁 **Transfer history** — every move with season, date, clubs (+ IDs), market value, fee, contract end, age and status.
- 📊 **Career statistics** — appearances, goals, assists, cards and minutes, bucketed by competition and season.
- 🏆 **Competition tables** — full standings (rank, club, matches, W/D/L, goals, goal difference, points).
- 🚑 **Injured players** — player, position, club, injury, expected return date and market value.
- 🕸️ **Crawl & pagination depth** — optionally follow links and paginated pages from each start URL.

---

### 🚀 How to use the Actor (via Apify Console)

1. Log in at [console.apify.com](https://console.apify.com) → **Actors**.
2. Open **Transfermarkt Scraper**.
3. Paste one or more Transfermarkt **URLs** into the input.
4. (Optional) Adjust **proxy**, **crawl depth**, and **pagination depth**.
5. Click **Start** and watch results stream into the **Output** tab in real time.
6. Export to **JSON / CSV / Excel / XML**.

---

### 📥 Input

| Field | Type | Description |
|---|---|---|
| `urls` *(required)* | array | Transfermarkt page URLs (player / competition / injured). Page type is detected automatically. |
| `proxyConfiguration` | object | Proxy settings (datacenter tier of the escalation chain). Apify Proxy recommended. |
| `crawlDepth` | integer | How deep to follow links discovered on each page. `0` = provided URLs only. Default `1`. |
| `pageDepth` | integer | How many pagination pages to follow from each page. `0` = first page only. Default `1`. |

```json
{
  "urls": [
    { "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003" },
    { "url": "https://www.transfermarkt.com/premier-league/tabelle/wettbewerb/GB1/saison_id/2023" }
  ],
  "proxyConfiguration": { "useApifyProxy": true },
  "crawlDepth": 1,
  "pageDepth": 1
}
````

> 💡 The legacy field names `startUrls` and `proxyConfig` are also accepted for backwards compatibility.

***

### 📤 Output

Each scraped page yields one or more dataset rows. Field names and structure match the canonical output schema.

**Player**

```json
{
  "givenUrl": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003",
  "id": "28003",
  "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003",
  "type": "player",
  "Name in home country": "Lionel Andrés Messi Cuccitini",
  "Date of birth/Age": "24/06/1987 (38)",
  "Place of birth": "Rosario",
  "Height": "1,70 m",
  "Citizenship": ["Argentina", "Spain"],
  "Position": "Attack - Right Winger",
  "Foot": "left",
  "Player agent": "Relatives",
  "Current club": "Inter Miami CF",
  "Joined": "15/07/2023",
  "Contract expires": "31/12/2028",
  "Last contract extension": "23/10/2025",
  "Outfitter": "adidas",
  "Social-Media": "http://www.facebook.com/LeoMessi, http://instagram.com/leomessi",
  "transfers": [
    {
      "id": "4418847", "season": "23/24", "date": "15/07/2023",
      "clubFrom": "Paris Saint-Germain", "clubFromId": "583",
      "clubTo": "Inter Miami CF", "clubToId": "69261",
      "marketValue": "€35.00M", "fee": "Free Transfer",
      "contractUntil": "31/12/2028", "age": 36, "status": "completed"
    }
  ],
  "careerStats": [
    {
      "competitionDescription": "Major League Soccer", "competitionId": "MLS1",
      "nameSeason": "25/26", "gamesPlayed": 14, "goalsScored": 12, "assists": 7,
      "yellowCards": 2, "secondYellowCards": 0, "redCards": 0, "minutesPlayed": 1243
    }
  ]
}
```

**Competition** — `{ "type": "competition", "id": "2023", "url": "...", "clubs": [ { "#": "1", "Club_0": "Manchester City", "Club_1": "Man City", "Matches": "38", "W": "28", "D": "7", "L": "3", "Goals": "96:34", "+/-": "62", "Pts": "91" } ] }`

**Injured player** — `{ "id": "...", "url": "...", "Player/Position": ["Name", "Position"], "Club": "...", "Injury": "...", "until": "...", "Market Value": "..." }`

***

### 🛡️ Proxy & anti-blocking strategy

The Actor uses **browser impersonation** (TLS + HTTP fingerprinting) and a tiered proxy escalation chain for every request:

1. 📡 **Direct** connection (no proxy) — fastest, used by default.
2. ⚠️ **Datacenter** proxy — used automatically if a request is blocked.
3. 🔁 **Residential** proxy — used if datacenter is blocked, retried up to 3×.
4. 🔒 **Sticky residential** — once residential succeeds, all remaining requests reuse it.

This keeps runs cheap when the site is permissive and resilient when it isn't.

***

### 🎯 Best use cases

- Building football/soccer analytics and prediction datasets.
- Monitoring squad values, transfers, and contract timelines.
- Tracking injuries across competitions.
- Aggregating league standings season over season.

***

### ❓ Frequently asked questions

**Which URLs are supported?** Player profiles, competition tables, and injured-player pages. Other pages (e.g. club squads) are crawled for links but produce no rows themselves.

**Do I need a proxy?** No, but it's recommended. Without one the Actor runs direct-only; with Apify Proxy it can escalate to residential when blocked.

**Will one bad URL stop the run?** No. Each page is handled independently and rows are saved as they are scraped.

***

### 💬 Support & feedback

Found a bug or want a new field? Open an issue on the Actor's **Issues** tab in the Apify Console.

***

### ⚖️ Legal note

Only publicly available data is collected. You are responsible for complying with Transfermarkt's Terms of Service and applicable data-protection laws (GDPR/CCPA).

# Actor input Schema

## `urls` (type: `array`):

🎯 The pages to scrape. Drop in player profiles (…/profil/spieler/ID), competition tables (…/tabelle/wettbewerb/…) or injured-player pages (…/verletztespieler/…). Page type is detected automatically.

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

🌐 Proxy settings used as the datacenter tier of the escalation chain. The scraper starts direct (no proxy), falls back to datacenter, then to residential (sticky) if Transfermarkt blocks the request. Apify Proxy recommended.

## `crawlDepth` (type: `integer`):

🔭 How deep to follow links discovered on each page (players, clubs, competitions, injured lists). 0 = only the URLs you provide. Default 1.

## `pageDepth` (type: `integer`):

➡️ How many pagination pages (?page=N / next-page links) to follow from each page. 0 = first page only. Default 1.

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003"
    },
    {
      "url": "https://www.transfermarkt.com/premier-league/tabelle/wettbewerb/GB1/saison_id/2023"
    },
    {
      "url": "https://www.transfermarkt.com/premier-league/verletztespieler/wettbewerb/GB1"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "crawlDepth": 1,
  "pageDepth": 1
}
```

# 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 = {
    "urls": [
        {
            "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003"
        },
        {
            "url": "https://www.transfermarkt.com/premier-league/tabelle/wettbewerb/GB1/saison_id/2023"
        },
        {
            "url": "https://www.transfermarkt.com/premier-league/verletztespieler/wettbewerb/GB1"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    },
    "crawlDepth": 1,
    "pageDepth": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/transfermarkt-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 = {
    "urls": [
        { "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003" },
        { "url": "https://www.transfermarkt.com/premier-league/tabelle/wettbewerb/GB1/saison_id/2023" },
        { "url": "https://www.transfermarkt.com/premier-league/verletztespieler/wettbewerb/GB1" },
    ],
    "proxyConfiguration": { "useApifyProxy": True },
    "crawlDepth": 1,
    "pageDepth": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("scraper-engine/transfermarkt-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    {
      "url": "https://www.transfermarkt.com/lionel-messi/profil/spieler/28003"
    },
    {
      "url": "https://www.transfermarkt.com/premier-league/tabelle/wettbewerb/GB1/saison_id/2023"
    },
    {
      "url": "https://www.transfermarkt.com/premier-league/verletztespieler/wettbewerb/GB1"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  },
  "crawlDepth": 1,
  "pageDepth": 1
}' |
apify call scraper-engine/transfermarkt-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scraper-engine/transfermarkt-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "⚽ Transfermarkt Scraper",
        "description": "Scrape players, competition tables and injured-player lists from Transfermarkt with automatic page-type detection and smart proxy escalation.",
        "version": "0.1",
        "x-build-id": "HgXTc2erUus07qY6N"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scraper-engine~transfermarkt-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scraper-engine-transfermarkt-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scraper-engine~transfermarkt-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scraper-engine-transfermarkt-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scraper-engine~transfermarkt-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scraper-engine-transfermarkt-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "🔗 Transfermarkt URLs",
                        "type": "array",
                        "description": "🎯 The pages to scrape. Drop in player profiles (…/profil/spieler/ID), competition tables (…/tabelle/wettbewerb/…) or injured-player pages (…/verletztespieler/…). Page type is detected automatically.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "proxyConfiguration": {
                        "title": "🛡️ Proxy Configuration",
                        "type": "object",
                        "description": "🌐 Proxy settings used as the datacenter tier of the escalation chain. The scraper starts direct (no proxy), falls back to datacenter, then to residential (sticky) if Transfermarkt blocks the request. Apify Proxy recommended.",
                        "default": {
                            "useApifyProxy": true
                        }
                    },
                    "crawlDepth": {
                        "title": "🕸️ Maximum Crawl Depth",
                        "minimum": 0,
                        "maximum": 5,
                        "type": "integer",
                        "description": "🔭 How deep to follow links discovered on each page (players, clubs, competitions, injured lists). 0 = only the URLs you provide. Default 1.",
                        "default": 1
                    },
                    "pageDepth": {
                        "title": "📄 Maximum Pagination Depth",
                        "minimum": 0,
                        "maximum": 50,
                        "type": "integer",
                        "description": "➡️ How many pagination pages (?page=N / next-page links) to follow from each page. 0 = first page only. Default 1.",
                        "default": 1
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
