# Atptour — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.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 for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/atptour/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## 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.beta.paywithlocus.com/api/wrapped/credits/atptour/get-player-activity \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/atptour/get-player-profile \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/atptour/get-player-rankings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -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.beta.paywithlocus.com/api/wrapped/credits/atptour/get-player-stats \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"player_id":"<string>","surface":"<string>","year":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.