A race page
One request renders the card and the result. There is no second call for runners unless you specifically want them without the conditions.
Documentation / Races & markets
/v1/races/{race_id}
Conditions, the market, and every runner with its price and position.
Send your key in the X-API-Key header, or as
?key= if your tool cannot set one. A date outside your plan's window returns
403 outside_window naming the window, never an empty array.
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| race_id | path | string | yes | Opaque race identifier, as returned anywhere a race appears. |
curl https://api.apihorseracing.com/v1/races/rc_1P005G7 \ -H "X-API-Key: $AHR_KEY"
$ch = curl_init('https://api.apihorseracing.com/v1/races/rc_1P005G7'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['X-API-Key: ' . getenv('AHR_KEY')], ]); $data = json_decode(curl_exec($ch), true)['data'];
const res = await fetch( 'https://api.apihorseracing.com/v1/races/rc_1P005G7', { headers: { 'X-API-Key': process.env.AHR_KEY } } ); const { meta, data } = await res.json();
import os, requests r = requests.get( "https://api.apihorseracing.com/v1/races/rc_1P005G7", headers={"X-API-Key": os.environ["AHR_KEY"]}, ).json()
curl https://api.apihorseracing.com/v1/races/rc_1P005G7?key=$AHR_KEY
$url = 'https://api.apihorseracing.com/v1/races/rc_1P005G7' . '?key=$AHR_KEY'; $data = json_decode(file_get_contents($url), true)['data'];
const res = await fetch( 'https://api.apihorseracing.com/v1/races/rc_1P005G7?key=$AHR_KEY' ); const { meta, data } = await res.json();
import os, requests r = requests.get( "https://api.apihorseracing.com/v1/races/rc_1P005G7?key=$AHR_KEY", ).json()
{ "meta": { "request_id": "920735f5ff5ae2a9", "data_as_of": "2026-09-12T05:10:27+00:00", "plan": "analyst", "window": "2017 → upcoming" }, "data": { "race_id": "rc_1P005G7", "meeting_id": "mt_3NKDYYE", "course_id": "cr_JSRC8Z", "course": "Fontwell", "country": "ENG", "region": "GB", "date": "2021-02-28", "time": "16:40", "off_time": "16:40:58", "name": "Taste Champagne At champagnepiaff.com Open Hunters' Chase", "run_type": null, "class": "6", "age": "5YO plus", "distance": "3m 1f 210y", "going": "Soft (Good to Soft in places)", "surface": "TURF", "handicap": false, "winning_time": "7m 10.95s", "book_percentage": 127.62, "runners": [ { "cloth": 13, "draw": null, "horse_id": "hs_V8JGH6", "horse": "The Galloping Bear", "age": 8, "weight": "11-2", "official_rating": null, "form": "5/2111-2", "headgear": "Tongue strap", "owner": "Mr Adrian Paterson", "trainer_id": "tr_2QVAXT3", "trainer": "Ben Clarke", "jockey_id": "jk_1ABH146", "jockey": "Millie Wonnacott", "silk": null, "sp": "10/3", "sp_decimal": 4.3333, "price_path": { "opening": "6/1", "opening_decimal": 7, "touched": null, "sp": "10/3", "sp_decimal": 4.3333, "drift": -0.381, "source": "movements", "direction": "shortened" }, "favourite": false, "market_position": 2, "position": 1, "beaten_distance": null, "casualty": null, "last_run_days": 119 }, { "cloth": 4, "draw": null, "horse_id": "hs_SJX1WR", "horse": "Sametegal", "age": 12, "weight": "11-6", "official_rating": 139, "form": "3-33641", "headgear": "Cheek pieces, Tongue strap", "owner": "Mr and Mrs J D Cotton", "trainer_id": "tr_14HQ75P", "trainer": "P F Nicholls", "jockey_id": "jk_VY5K52", "jockey": "H Cobden", "silk": null, "sp": "2/5", "sp_decimal": 1.4, "price_path": { "opening": "4/11", "opening_decimal": 1.3636, "touched": [ "1/3" ], "sp": "2/5", "sp_decimal": 1.4, "drift": 0.0267, "source": "movements", "direction": "drifted" }, "favourite": true, "market_position": 1, "position": 2, "beaten_distance": null, "casualty": null, "last_run_days": 24 }, "… 14 more" ], "placed": 3, "stage": "WEIGHEDIN", "result_available": true } }
A real response from /v1/races/rc_1P005G7,
captured by calling the live API rather than written by hand.
Each field is described once and rendered on every endpoint that returns it, so the wording cannot drift between pages.
| Field | Type | What it is |
|---|---|---|
| race_id | string | Opaque race identifier. Stable, and safe to store. |
| meeting_id | string | Opaque meeting identifier. A meeting is one course on one day. |
| course_id | string | Opaque course identifier. |
| course | string | Course name. |
| country | string | Country code as the source publishes it. |
| region | string | Jurisdiction, normalised. Welsh and Scottish racing is GB. |
| date | date | Race date, YYYY-MM-DD. |
| time | string | Scheduled off time, local to the course. |
| off_time | string | Actual off time where recorded. |
| name | string | Race title as published, sponsor and all. |
| run_type | string | Flat, Hurdle, Chase or NH Flat. |
| class | string | Race class. |
| age | string | Age restriction, e.g. "4YO plus". |
| distance | string | Official distance as published, e.g. "3m 3f 119y". |
| going | string | Ground description at the off. |
| surface | string | Turf, Dirt, Polytrack and so on. |
| handicap | boolean | Whether the race was run off official ratings. |
| winning_time | string | Winning time as published. |
| book_percentage | number | The field's implied probabilities added up. 100 would be a fair book; the excess is the margin. Ours average 117 in small fields and 133 in sixteen or more. |
| runners | integer | Runners who took part. |
| cloth | integer | Cloth number. |
| draw | integer | Stall. Null in jumps racing, which is correct rather than missing. |
| horse_id | string | Opaque horse identifier. |
| horse | string | Horse name. |
| weight | string | Weight carried, stones and pounds. |
| official_rating | integer | Handicap mark. Values outside 0 to 200 are dropped as source errors. |
| form | string | Recent finishing positions, most recent last. |
| headgear | string | Blinkers, cheekpieces, tongue tie and so on. |
| owner | string | Registered owner as published. |
| trainer_id | string | Opaque trainer identifier. |
| trainer | string | Trainer name. |
| jockey_id | string | Opaque jockey identifier. |
| jockey | string | Rider name. |
| silk | string | Colours described in words. We do not serve the source's silk images. |
| sp | string | Starting price, fractional, as returned. |
| sp_decimal | number | Starting price as a decimal, computed once at load so you are not parsing fractions per row. |
| price_path | object | What the price did before the off. See its own fields below. |
| opening | string | The price the runner opened at, where published. |
| touched | array | Prices touched between opening and starting price. |
| drift | number | Starting price against opening, as a ratio. Positive drifted, negative shortened. |
| source | string | full_history where a complete price series exists, movements where only an opening price does, starting_price_only where neither. |
| direction | string | drifted, shortened or unchanged. |
| favourite | boolean | Shortest price in the race. Joint favourites are all flagged. |
| market_position | integer | Rank by price, one being shortest. Ties share a rank. |
| position | integer | Finishing position. Null means the runner did not complete or was not published below the placings. |
| beaten_distance | string | Distance behind the horse in front. |
| casualty | string | Why a runner did not complete: PulledUp, Fell, UnseatedRider, BroughtDown, RefusedToRace, RanOut. |
| last_run_days | integer | Days since this horse last ran. Null on a first run. |
| placed | integer | How many places the race paid. |
| stage | string | Where the race had got to: scheduled, off, weighed in. |
| result_available | boolean | Whether a result has been published. |
The code a race was run under lives on the horse profile rather than the race, so it arrives on a later pass. A null run_type means not yet fetched, not unclassified.
Class is published in Britain and reliably absent elsewhere. Do not treat a null class as an ungraded race.
Where a time exists it is as published. /v1/courses/{id}/standard-times reports the median per distance and counts the implausible ones rather than quietly serving them.
A null draw in a hurdle or a chase is correct, not missing. Filter on run_type before drawing conclusions from stall data.
Britain, Ireland and America carry a rating on roughly three quarters of runners. France and Germany carry one on about three percent. Values outside 0 to 200 are dropped, because the source returns sentinels there rather than ratings.
The source publishes no odds history on a settled race, only an opening price and any prices touched. About one runner in five carries one. price_path.source tells you which kind you have on every runner, so you never have to infer it.
America publishes the placings and nothing below them, so position is null for most of the field. Britain, Ireland, France and South Africa carry a position for the great majority of runners. /v1/countries returns the current figure for each.
They are published on the horse profile rather than the result page, so they fill in behind the main crawl.
| Code | Status | When |
|---|---|---|
| unauthorized | 401 | No key, or one we do not recognise. Check the header name and that the key has not been rotated from your account page. |
| outside_window | 403 | You asked for a date your plan cannot see. The body names the window and the date you asked for. Search endpoints clamp instead of refusing, and report what they actually searched in meta. |
| not_found | 404 | The identifier is well formed but nothing has it. Distinct from invalid_id, which means the identifier itself is wrong. |
| invalid_id | 422 | The prefix does not match the kind of thing the path expects, or the identifier is malformed. A horse id passed where a race is wanted lands here rather than returning the wrong race. |
| rate_limited | 429 | Past your per-minute rate. Retry-After is set, and X-RateLimit-Remaining tells you where you stand on every successful response too. |
| server_error | 500 | Ours, not yours. Every response carries a request_id; quote it and we can find the exact request. |
A real request from your browser straight to
api.apihorseracing.com with
your own key. Nothing is proxied and nothing is logged by this page.
Remembered in this browser so you do not paste it on every page. Forget it
One race with everything on it: the conditions, the market summary, and every runner with its weight, rating, form, connections, price and finishing position. If you are going to make one call about a race, make this one.
Runners come back ordered by finishing position where a result exists, with non-completers after the placed horses rather than sorted to the top by a null. Before the off they are in cloth order.
The four fields worth knowing about are here: book_percentage on the race, and price_path, casualty and beaten_distance on each runner. What each one contains depends on where the race was run, and the field table below says which.
One request renders the card and the result. There is no second call for runners unless you specifically want them without the conditions.
This is the shape worth persisting. Everything else in this group is a projection of it, so if you keep this you can rebuild the others locally.
result_available tells you, and position on the runners confirms it. A race can be run and not yet settled, which is a real state rather than a failure.
position is null both for a runner that did not complete and for one whose jurisdiction publishes only the placings. casualty distinguishes them: a value there means it did not finish, absent means it was not published.