# Transfermarkt (Italy) — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access team market values and detailed player career statistics from Transfermarkt. Retrieve historical valuations across seasons, browse squad rosters, and pull per-season performance metrics — including goals, assists, cards, and minutes played — for any player.

**Category:** Sports | **Website:** [transfermarkt.it/](https://transfermarkt.it/) | **Docs:** [parse.bot/marketplace/479bb33d-e5d1-48b1-a6b5-0ed57a47c694/transfermarkt-it-api](https://parse.bot/marketplace/479bb33d-e5d1-48b1-a6b5-0ed57a47c694/transfermarkt-it-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-transfermarkt-it-api-479bb33d/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_player_career_stats

Retrieve detailed career statistics for a player, aggregated by season and competition. Includes matches played, goals, assists, cards, and minutes. Uses the Transfermarkt performance API and groups per-game data into season/competition/club buckets.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | Transfermarkt numeric player ID (e.g. '406625' for Lautaro Martínez). Discoverable via the get_serie_a_players endpoint or from a Transfermarkt profile URL. |
| `player_slug` | string | No | Player name slug from the Transfermarkt URL (e.g. 'lautaro-martinez'). Not used in current implementation; accepted for backward compatibility. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transfermarkt-it-api-479bb33d/get_player_career_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>","player_slug":"<string>"}'
```

### get_serie_a_players

List all players in Serie A for a given season by scraping team rosters. Returns player IDs, slugs, names, and URLs. Iterates through team pages so responses are slow for many teams; use max_teams to limit.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `max_teams` | integer | No | Maximum number of teams to process. Use a small value (e.g. 1-3) for faster partial results. |
| `season` | string | No | Season year as string (e.g. '2025' for 2025/26) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transfermarkt-it-api-479bb33d/get_serie_a_players \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_teams":"<integer>","season":"<string>"}'
```

### get_team_market_values

Retrieve market values for all teams in Serie A for a specified season range. Returns team names, IDs, and market values as formatted on Transfermarkt (e.g., '741,85 mln €'). Each season year in the range produces one page fetch, so wide ranges are slow.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `end_year` | integer | No | Ending season year (e.g., 2025 for 2025/26 season) |
| `start_year` | integer | No | Starting season year (e.g., 2024 for 2024/25 season) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-transfermarkt-it-api-479bb33d/get_team_market_values \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"end_year":"<integer>","start_year":"<integer>"}'
```
