Documentation / Races

Race precedents

GET/v1/races/{race_id}/precedents

Available on Live Plus only

A Live key reaches the other 42 endpoints and receives 403 upgrade_required here. Compare plans

Races from the archive that ran under matching conditions at this track and distance, with what actually happened in them — and an explicit list of what each one matched on and where it differs.

Authenticate with your key in the X-API-Key header, or ?key= if your tool cannot set one — see Authentication. Works with sandbox keys inside the sandbox data window.

Parameters

NameInTypeRequiredDescription
race_id path integer yes The race identifier.
limit query integer no How many precedents to return, 1 to 50. Defaults to 20.

Request

curl "https://api.greyhoundapi.com/v1/races/3959843903/precedents" \
  -H "X-API-Key: $GAPI_KEY"
<?php
$ch = curl_init('https://api.greyhoundapi.com/v1/races/3959843903/precedents');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => ['X-API-Key: ' . getenv('GAPI_KEY')],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($response['data']);
const res = await fetch('https://api.greyhoundapi.com/v1/races/3959843903/precedents', {
  headers: { 'X-API-Key': process.env.GAPI_KEY }
});
if (!res.ok) throw new Error(`GreyhoundAPI ${res.status}`);
const { meta, data } = await res.json();
console.log(meta.data_as_of, data);
import { useEffect, useState } from 'react';

export default function Example() {
  const [data, setData] = useState(null);

  useEffect(() => {
    fetch('https://api.greyhoundapi.com/v1/races/3959843903/precedents', {
      headers: { 'X-API-Key': import.meta.env.VITE_GAPI_KEY }
    })
      .then((r) => r.json())
      .then((body) => setData(body.data));
  }, []);

  if (!data) return <p>Loading…</p>;
  return <pre>{JSON.stringify(data, null, 2)}</pre>;
}

Browser code exposes whatever key it ships with — use a sandbox key for prototypes and proxy live keys through your own server in production.

import os
import requests

r = requests.get(
    "https://api.greyhoundapi.com/v1/races/3959843903/precedents",
    headers={"X-API-Key": os.environ["GAPI_KEY"]},
    timeout=10,
)
r.raise_for_status()
body = r.json()
print(body["meta"]["data_as_of"], body["data"])

Response

200 OKapplication/json
{
    "meta": {
        "request_id": "req_8f2ac1",
        "data_as_of": "2026-07-08T13:05:12Z"
    },
    "data": {
        "race_id": 1229082445,
        "track": {
            "track_id": 1400000014,
            "name": "Romford",
            "region": "GB",
            "timezone": "Europe/London"
        },
        "distance_m": 400,
        "grade": "A3",
        "field_size": 6,
        "going": 0,
        "matching": {
            "axes": [
                "track",
                "distance",
                "grade",
                "field_size"
            ],
            "relaxed": [],
            "window": "last 24 months",
            "found": 112,
            "returned": 20,
            "note": null
        },
        "precedents": [
            {
                "race_id": 1229081338,
                "date": "2026-05-14",
                "grade": "A3",
                "field_size": 6,
                "matched_on": [
                    "track",
                    "distance",
                    "grade",
                    "field_size"
                ],
                "differs_on": [
                    {
                        "field": "going",
                        "this": 0,
                        "that": -20
                    }
                ],
                "result": {
                    "winner_trap": 3,
                    "winning_time_s": 24.08,
                    "vs_par_s": -0.53,
                    "winner_sp_decimal": 3.5
                }
            }
        ],
        "note": "Races that ran under matching conditions at this track and distance, with their actual results. Track and distance are never relaxed. Going is reported rather than matched, as a signed hundredths-of-a-second track adjustment where negative is slower. This is history: the frequency of any outcome here is not a probability, and nothing in it forecasts this race."
    }
}

Run it live

A real request from your browser straight to api.greyhoundapi.com with your own key — nothing is proxied or logged by this page.

GET/v1/races/{race_id}/precedents

Held in this tab only, sent only to the API host. No key yet? Create a free sandbox key — it runs every endpoint against the sandbox data window.