# 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. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-racingpost-com-api-6be2c53f/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## 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/parse-racingpost-com-api-6be2c53f/get_australian_fields \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_horse_profile \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_race_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_race_results_by_date \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_race_runners \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_racecards_by_date \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -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/parse-racingpost-com-api-6be2c53f/get_todays_racecards \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```
