APIHorseRacing

Documentation / Reference & coverage

Course profile

GET /v1/courses/{course_id}

Run types, surfaces and distances actually raced there.

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
course_id path string yes Opaque course identifier, as returned by /v1/courses or anywhere a course appears.

Request

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

Response

200 OK application/json harvested 8 days ago
{
    "meta": {
        "request_id": "e06219a616116b7b",
        "data_as_of": "2026-09-12T05:10:27+00:00",
        "plan": "analyst",
        "window": "2017 → upcoming"
    },
    "data": {
        "course_id": "cr_JSRC8Z",
        "name": "Fontwell",
        "shortcode": "FON",
        "country": "ENG",
        "region": "GB",
        "races": 1413,
        "meetings": 208,
        "first_meeting": "2017-01-08",
        "last_meeting": "2026-09-06",
        "run_types": [
            {
                "run_type": null,
                "surface": "TURF",
                "races": 1028,
                "first": "2018-02-15",
                "last": "2026-09-06"
            },
            {
                "run_type": "Hurdle",
                "surface": "TURF",
                "races": 205,
                "first": "2017-01-08",
                "last": "2020-03-14"
            },
            "… 2 more"
        ],
        "distances": [
            {
                "distance": "2m 1f 162y",
                "races": 354
            },
            {
                "distance": "2m 3f 49y",
                "races": 169
            },
            "… 19 more"
        ]
    }
}

A real response from /v1/courses/cr_JSRC8Z, 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
course_id string Opaque course identifier.
name string Race title as published, sponsor and all.
country string Country code as the source publishes it.
region string Jurisdiction, normalised. Welsh and Scottish racing is GB.
run_type string Flat, Hurdle, Chase or NH Flat.
surface string Turf, Dirt, Polytrack and so on.
first integer Wins.
distance string Official distance as published, e.g. "3m 3f 119y".

What varies by jurisdiction

Run type is filled in behind the results crawl

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.

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

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 course, with the shape of racing that actually happens there rather than what it is supposed to stage. Run types and surfaces are grouped with their own counts and date spans, and the distances are the ones really raced, most used first.

That distinction matters. A track described as all-weather flat may carry a handful of turf meetings in its history, and a query written against the description would silently include them.

Common uses

Choosing a distance to study

Draw bias only survives at a single distance. The distances array tells you which ones have enough races to be worth the query.

Sanity checking a filter

If run_types comes back with a code you did not expect, your filter is about to exclude races you wanted.

Related in Reference & coverage