Populating a filter UI
The counts let you order options by how common they are and hide the ones with two races behind them.
Documentation / Reference & coverage
/v1/reference
Valid goings, classes and run types, counted from the data.
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.
None. This endpoint takes nothing beyond your key.
curl https://api.apihorseracing.com/v1/reference \ -H "X-API-Key: $AHR_KEY"
$ch = curl_init('https://api.apihorseracing.com/v1/reference'); 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/reference', { 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/reference", headers={"X-API-Key": os.environ["AHR_KEY"]}, ).json()
curl https://api.apihorseracing.com/v1/reference?key=$AHR_KEY
$url = 'https://api.apihorseracing.com/v1/reference' . '?key=$AHR_KEY'; $data = json_decode(file_get_contents($url), true)['data'];
const res = await fetch( 'https://api.apihorseracing.com/v1/reference?key=$AHR_KEY' ); const { meta, data } = await res.json();
import os, requests r = requests.get( "https://api.apihorseracing.com/v1/reference?key=$AHR_KEY", ).json()
No sample has been captured for this endpoint yet. Use the console below against your own key.
| 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. |
| 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
The valid values for every filter, counted from the data. Goings, classes, run types, surfaces, regions and casualty reasons, each with how many races or runners carry it.
This exists because a filter written against a guessed string silently matches nothing. "Good to Soft" and "Good To Soft" are different values to a database and identical to a person, and a hardcoded list in your code goes stale the first time the source changes its wording.
The counts let you order options by how common they are and hide the ones with two races behind them.
Reject a going your user typed that does not appear here, rather than returning them an empty result set and no explanation.
Values are as published, including their capitalisation. Match on them exactly.