# Racing Post — 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 comprehensive horse racing data from Racing Post, including daily racecards, meeting schedules, race results, and detailed horse profiles with form history, stats, and pedigree.

**Category:** Sports | **Website:** [racingpost.com/](https://racingpost.com/) | **Docs:** [parse.bot/marketplace/6be2c53f-3e34-4172-a3dc-41b64722affb/racingpost-com-api](https://parse.bot/marketplace/6be2c53f-3e34-4172-a3dc-41b64722affb/racingpost-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/racing-post/`
**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 australian fields

Retrieve Australian thoroughbred racing fields for a specific date. Returns meetings at Australian venues with detailed runner information including horse name, trainer, jockey, and race metadata. For upcoming/declared races, runner data comes from the full racecard (includes start number, draw, age, weight). For resulted races, basic runner data (horse name, trainer, jockey) is extracted from the results page. Australian racing is seasonal and not all dates have Australian meetings; an empty meetings array is returned when no Australian racing is scheduled.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | The date to fetch Australian fields for, in ISO format YYYY-MM-DD. Defaults to today's date (UTC) if omitted. |

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

### Get horse profile

Retrieve detailed horse profile data. Returns form history, stats breakdowns, pedigree information, or progeny statistics depending on the tab parameter. The 'form' tab returns a form array of past race entries and a raceRecords object with lifetime records and placings. The 'stats' tab returns statsFlat and statsJumps arrays. The 'pedigree' tab returns pedigree tree data. The 'progeny' tab returns offspring performance data including win records, earnings, race statistics, aggregate progeny performance statistics broken down by race type, distance, and going, and course-by-course sire progeny stats for UK venues aggregated across all available flat seasons (primarily useful for stallions/broodmares). Horse IDs and slugs are obtained from race data (e.g. from get_race_detail predictor.runners[*].id/horseName).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `horse_id` | string | Yes | The unique numeric ID of the horse (from race data, e.g. get_race_detail predictor.runners[*].id). |
| `horse_slug` | string | Yes | The URL slug for the horse name (lowercase, hyphen-separated, e.g. 'quadrillion'). Can be derived from the horse name by lowercasing and replacing spaces with hyphens. |
| `tab` | string | No | The data tab to retrieve: 'form', 'stats', 'pedigree', or 'progeny'. |

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

### Get race detail

Retrieve race details including verdict (expert pick and commentary), tips (newspaper selections per horse), and predictor scores for runners. The race_id is obtained from meetings/racecards data (races[*].raceId). Only works for races with declared or upcoming status; past races may return 404.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `race_id` | string | Yes | The unique numeric ID of the race (from meetings/racecards data races[*].raceId). |

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

### Get race results by date

Retrieve enriched race results for a specific date. For every completed race, returns runner details (horseName, finishingPosition, startingPrice, isFavourite, jockey, trainer), numberOfRunners, betting returns, and derived each-way terms (placesPaid from tote dividends, placeFraction and eachWayTerms from standard UK rules based on runner count and handicap status). Only races with currentRaceStatus of 'result' are included. Each race requires one additional HTML page fetch for runner data, so response time scales with the number of resulted races on the date. Future dates or dates where races have not yet completed will return an empty results array.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | The date to fetch results for, in ISO format YYYY-MM-DD. Must be a past date for results to be available. |

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

### Get race runners

Retrieve the full list of declared runners for a race from the Racing Post racecard page. Returns detailed runner information including horse name, jockey, trainer, weight, draw, official rating, forecast odds, spotlight commentary, and breeding. Non-runners are excluded. The race must be within the next 7 days (upcoming/declared racecards). Each call searches the meetings API to locate the race, then fetches and parses the racecard page. The race_id is obtained from meetings/racecards data (races[*].raceId via get_racecards_by_date or get_todays_racecards).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `race_id` | string | Yes | The unique numeric ID of the race (from meetings/racecards data races[*].raceId). |

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

### Get racecards by date

Retrieve racecards for a specific date. Returns all meetings and their races scheduled for the given date, including race details, going, weather, and betting returns for completed races. Structure is identical to get_todays_racecards but for any specified date.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | Yes | The date for which to fetch racecards, in ISO format YYYY-MM-DD. |

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

### Get todays racecards

Retrieve today's racecards and meeting schedules. Returns all meetings scheduled for the current UTC date, including race details, going, weather, and betting returns for completed races. Each meeting contains a races array with individual race metadata (raceId, raceTitle, startScheduledDatetime, numberOfRunners, going, distance, bettingReturns). Pagination is not applicable; the entire day's schedule is returned in a single response.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/racing-post/get-todays-racecards \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Next steps

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