# Worldsurfleague — 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 World Surf League competition data including event schedules, heat-by-heat results, athlete profiles, and tour rankings. Retrieve detailed statistics and standings across all WSL tours.

**Category:** Sports | **Website:** [worldsurfleague.com/](https://worldsurfleague.com/) | **Docs:** [parse.bot/marketplace/78839bb0-be93-4b35-a89d-db38c3867e4c/worldsurfleague-com-api](https://parse.bot/marketplace/78839bb0-be93-4b35-a89d-db38c3867e4c/worldsurfleague-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/worldsurfleague/`
**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 athlete profile

Get full profile of an athlete including personal details and career event results. Returns hometown, stance, age, height, and a list of competition results with placements and points. Requires athlete_id and slug obtainable from get_athletes.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `athlete_id` | string | Yes | Athlete ID from get_athletes results |
| `slug` | string | Yes | Athlete slug from get_athletes results |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-athlete-profile \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"athlete_id":"<string>","slug":"<string>"}'
```

### Get athletes

Search for athletes by name or filter by tour. Returns a list of matching athletes with their IDs, slugs, names, and profile URLs. Without parameters, returns athletes visible on the default athletes page.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | No | Athlete name to search for |
| `tour` | string | No | Tour code to filter athletes (e.g. mct, wct, mcs, wcs) |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-athletes \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>","tour":"<string>"}'
```

### Get event results

Get results for a specific event including rounds and heats with athlete scores. Each heat includes athlete names, scores, score breakdowns, and winner status. Requires event identifiers obtainable from get_event_schedule.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `event_id` | string | Yes | Event ID from get_event_schedule results |
| `slug` | string | Yes | Event slug from get_event_schedule results |
| `tour` | string | Yes | Tour code from get_event_schedule results (e.g. ct, qs) |
| `year` | string | Yes | Year of the event from get_event_schedule results |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-event-results \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"event_id":"<string>","slug":"<string>","tour":"<string>","year":"<string>"}'
```

### Get event schedule

Get event schedule for a specific year and optional tour. Returns a list of events with IDs, tour codes, slugs, names, dates, locations, and status. Events include all information needed to call get_event_results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `tour_code` | string | No | Tour code to filter events (e.g. ct, qs, lt, bwt) |
| `year` | string | No | Year to fetch schedule for |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-event-schedule \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"tour_code":"<string>","year":"<string>"}'
```

### Get heat details

Get detailed wave-by-wave scores for a specific heat. Returns individual wave scores for each athlete and optional fantasy statistics. Requires heat_id from get_event_results and the same event identifiers.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `event_id` | string | Yes | Event ID from get_event_schedule results |
| `heat_id` | string | Yes | Heat ID from get_event_results heats[*].id |
| `slug` | string | Yes | Event slug from get_event_schedule results |
| `tour` | string | Yes | Tour code (e.g. ct) |
| `year` | string | Yes | Year of the event |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-heat-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"event_id":"<string>","heat_id":"<string>","slug":"<string>","tour":"<string>","year":"<string>"}'
```

### Get tour rankings

Get tour rankings for a specific year and tour. Returns ranked list of athletes with their points, ordered by ranking position. Covers all WSL tour types including Championship Tour and Challenger Series for both men and women.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `tour` | string | No | Tour code (mct, wct, mcs, wcs, mqs, wqs) |
| `year` | string | No | Year for rankings |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/worldsurfleague/get-tour-rankings \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"tour":"<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.