# Atptour — 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 data from atptour.com.

**Category:** Sports | **Website:** [www.atptour.com/en/players](https://www.atptour.com/en/players) | **Docs:** [parse.bot/marketplace/443710f8-dde1-4b11-aab1-5f5cceadfbf0/atptour-com-api](https://parse.bot/marketplace/443710f8-dde1-4b11-aab1-5f5cceadfbf0/atptour-com-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-atptour-com-api-443710f8/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_player_activity

Retrieve a player's match results for a given year, organized by tournament. Each tournament includes individual match details with opponent, score, and round information.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_type` | string | No | Type of matches to retrieve. |
| `player_id` | string | Yes | ATP player ID (e.g. 's0ag' for Jannik Sinner). |
| `year` | string | No | Year to retrieve activity for (e.g. '2025', '2026'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-atptour-com-api-443710f8/get_player_activity \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_type":"<string>","player_id":"<string>","year":"<string>"}'
```

### get_player_profile

Retrieve a player's biographical details, current ranking, career win-loss record, titles, and prize money. Returns one player per call keyed by their ATP player ID.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | ATP player ID (e.g. 's0ag' for Jannik Sinner, 'a0e2' for Carlos Alcaraz). Found in the player's profile URL on atptour.com. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-atptour-com-api-443710f8/get_player_profile \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>"}'
```

### get_player_rankings

Retrieve a player's current ATP rankings breakdown showing points earned at each tournament contributing to their ranking, along with overall rank, total points, and YTD record.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `match_type` | string | No | Type of ranking to retrieve. |
| `player_id` | string | Yes | ATP player ID (e.g. 's0ag' for Jannik Sinner). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-atptour-com-api-443710f8/get_player_rankings \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"match_type":"<string>","player_id":"<string>"}'
```

### get_player_stats

Retrieve a player's serve and return statistics for a given year (or career) and court surface. Includes aces, double faults, break points, and win percentages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `player_id` | string | Yes | ATP player ID (e.g. 's0ag' for Jannik Sinner). |
| `surface` | string | No | Court surface filter. |
| `year` | string | No | Year to filter stats (e.g. '2025') or 'all' for career stats. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-atptour-com-api-443710f8/get_player_stats \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>","surface":"<string>","year":"<string>"}'
```
