APIHorseRacing

Documentation / Reference & coverage

Search everything

GET /v1/search

One lookup across horses, trainers, jockeys and courses.

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

NameInTypeRequiredDescription
q query string yes At least two characters. Matched against names; a prefix match sorts above a match in the middle.
type query string no Restrict to one of horse, trainer, jockey or course.
limit query integer no Per type, 1 to 25. Defaults to 10.

Request

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

Response

200 OK application/json harvested 8 days ago
{
    "meta": {
        "request_id": "8b19eca4187e3ed3",
        "data_as_of": "2026-09-12T05:10:27+00:00",
        "plan": "analyst",
        "window": "2017 → upcoming",
        "query": "Well",
        "count": 32
    },
    "data": [
        {
            "type": "horse",
            "horse_id": "hs_1VBHGS3",
            "name": "Well Above Par"
        },
        {
            "type": "horse",
            "horse_id": "hs_1RN0YGN",
            "name": "Well Accustomed"
        },
        "… 30 more"
    ]
}

A real response from /v1/search?q=Well, captured by calling the live API rather than written by hand.

Response fields

Each field is described once and rendered on every endpoint that returns it, so the wording cannot drift between pages.

FieldTypeWhat it is
horse_id string Opaque horse identifier.
name string Race title as published, sponsor and all.
trainer_id string Opaque trainer identifier.
jockey_id string Opaque jockey identifier.
course_id string Opaque course identifier.

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.
invalid_param 422 A date that is not YYYY-MM-DD, a by= dimension we do not have, or a cursor that did not come from us. The message names the parameter.
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

One lookup across horses, trainers, jockeys and courses, for the very common case of having a name and needing an identifier. Making somebody guess which of four endpoints holds the thing they typed is a poor first experience.

Results are ordered so that a prefix match beats a match in the middle, which is why searching Frank puts Frankel above Hurricane Frank.

Common uses

A single search box

Type-ahead over one endpoint rather than four, with the type on every row so you can group the dropdown.

Resolving a name from a spreadsheet

Pass type= when you know what you are looking for, and you will not have a trainer named after a horse come back first.

Notes

Horse names repeat across jurisdictions and generations. More than one result for a name is normal, and the career figures are how you tell them apart.

Related in Reference & coverage