horseracingapi.co.uk
Documentation / Guides

Quick start

A key, your first call and how to read the answer, in two minutes.

The API answers on https://api.horseracingapi.co.uk/v1. Every answer is JSON, every call is a GET, and every call carries your key in a header.

1. Get a key

Sign in with Google on the free key page. Your key appears straight away on the free plan, which reads yesterday's UK racing. It is kept in this browser too, so Run works on every page of these docs.

2. Make a call

Yesterday's results are the first call most people make, and every plan reads them.

curl https://api.horseracingapi.co.uk/v1/results/yesterday \
  -H "X-API-Key: $HRUK_KEY"

3. Read the answer

Every answer has two parts. data is the record, or a list of them. meta says which plan answered, the days it reads, when the data was last brought up to date and, for lists, how many rows came back.

{
  "data": [ { "race_id": "rc_...", "course": "...", "race_time": "13:20" } ],
  "meta": { "request_id": "...", "plan": "free", "window": "yesterday only", "count": 31 }
}

What it is, and is not

Factual racing data for Great Britain and Northern Ireland: courses, cards, results, prices, reports and the people behind every runner. There are no tips, ratings or predictions on any endpoint, no sectional times and no live bookmaker feed.

Ids

Every id is ours: cr_ courses, mt_ meetings, rc_ races, hs_ horses, tr_ trainers, jk_ jockeys and ow_ owners, each with eight characters. They are stable and safe to store. Take them from answers; an id that is not ours is a 404.

Next