# ATG — 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 comprehensive horse racing data from ATG.se, including race calendars, detailed race information, horse profiles, starting lineups, and results. Retrieve up-to-date information on races, horses, drivers, betting pools, and outcomes.

**Category:** Sports | **Website:** [atg.se/](https://atg.se/) | **Docs:** [parse.bot/marketplace/64c13ec3-dcb6-431b-a42c-2993f9e69cd2/atg-se-api](https://parse.bot/marketplace/64c13ec3-dcb6-431b-a42c-2993f9e69cd2/atg-se-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/atg/`
**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 game results

Retrieve recent completed game results for a game type. Returns an array of recent game results with payouts, winners, track names, turnover, and race details. Results availability depends on when the last game of that type was played.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `game_type` | string | Yes | Game type identifier. Accepted values: V64, V75, V86. |

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

### Get horse profile

Fetch a horse's profile by its ATG horse ID. Returns name, age, sex, pedigree (father, mother, grandfather), lifetime and yearly statistics including starts, earnings, placement counts, and records. Also includes owner, breeder, and home track information.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `horse_id` | string | Yes | ATG horse ID (numeric string, e.g. 801482). Discoverable from get_race_details data.starts[*].horse.id. |

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

### Get race calendar

Fetch the full race calendar for a specific date. Returns all tracks racing that day with their scheduled races, start times, statuses, and available betting games. Each track entry includes an id, name, sport, and list of races; the games object groups available betting pools by type.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | Date in YYYY-MM-DD format. |

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

### Get race details

Fetch detailed information for a single race by its race ID. Returns the full starter list with horse profiles, driver info, results (if completed), track condition, and pool data. Race IDs follow the format YYYY-MM-DD_trackId_raceNumber and are discoverable via get_race_calendar.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `race_id` | string | Yes | Race ID in format YYYY-MM-DD_trackId_raceNumber (e.g. 2026-06-11_28_1). Discoverable via get_race_calendar tracks[*].races[*].id. |

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

### Get startlist

Retrieve the startlist and game details for a specific game ID. Returns pool information (turnover, payouts), race starters with betting odds, and game status. Game IDs follow the format GameType_YYYY-MM-DD_trackId_raceNumber and are discoverable via get_race_calendar games object.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `game_id` | string | Yes | Game ID in format GameType_YYYY-MM-DD_trackId_raceNumber (e.g. V64_2026-06-11_28_4). Discoverable via get_race_calendar data.games.<type>[*].id. |

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