APIHorseRacing

Documentation / Reference & coverage

Filter values

GET /v1/reference

Valid goings, classes and run types, counted from the data.

Available on

Free key 24h – 7d
Live today + 3 days
Archive back to 2017
Complete 2017 → upcoming
Complete + Analyst 2017 → upcoming

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.

Parameters

None. This endpoint takes nothing beyond your key.

Request

curl https://api.apihorseracing.com/v1/reference \
  -H "X-API-Key: $AHR_KEY"

Response

No sample has been captured for this endpoint yet. Use the console below against your own key.

Errors this endpoint returns

CodeStatusWhen
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.

Run it live

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.

What this is for

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.

Common uses

Populating a filter UI

The counts let you order options by how common they are and hide the ones with two races behind them.

Validating input before you spend a request

Reject a going your user typed that does not appear here, rather than returning them an empty result set and no explanation.

Notes

Values are as published, including their capitalisation. Match on them exactly.

Related in Reference & coverage