A jockey's bookings
/v1/jockeys/{id}All live plansA jockey's bookings in the selected daily feed, with horse-specific connection rows.
Take {id} from runner.jockey.id on a racecard. The response has id, name, scope and bookings[]. Each booking has horseId, horseName, raceId, name and connections[], which are the form rows in the connections section that match this jockey for that horse.
async function connection(kind /* "jockeys" | "trainers" */, id, date) {
const url = new URL("/v1/" + kind + "/" + encodeURIComponent(id), "https://racingapi.net");
url.searchParams.set("region", "uk");
if (date) url.searchParams.set("date", date);
const res = await fetch(url, { headers: { "X-API-Key": process.env.RACINGAPI_KEY } });
const body = await res.json();
if (!res.ok) throw new Error(body.code + " " + body.requestId);
return body.data;
}
const jockey = await connection("jockeys", process.env.JOCKEY_ID);
for (const b of jockey.bookings) console.log(jockey.name, "rides", b.horseName, "in race", b.raceId);A trainer's runners
/v1/trainers/{id}All live plansA trainer's declared runners in the selected daily feed, with horse-specific connection rows.
Take {id} from runner.trainer.id. The shape matches the jockey endpoint, so one helper serves both. A trainer page that lists 'runners today' is a natural use: group bookings by raceId, then look the race time and course up from your cached racecards rather than calling the race endpoint for each booking.
import os, requests
def trainer(trainer_id, date=None):
params = {"region": "uk"}
if date: params["date"] = date
res = requests.get(f"https://racingapi.net/v1/trainers/{trainer_id}", params=params,
headers={"X-API-Key": os.environ["RACINGAPI_KEY"]}, timeout=15)
if res.status_code == 404:
return None # no runners in this feed
res.raise_for_status()
return res.json()["data"]
t = trainer(os.environ["TRAINER_ID"])
if t:
for b in t["bookings"]:
print(b["raceId"], b["horseName"])Daily connections, not career statistics
Connection rows describe how this jockey or trainer has done with this particular horse, as supplied. They are horse-specific. Adding them up across a day's bookings would count the same historic runs more than once and produce a number that looks like a career strike rate but is not one. RacingAPI.net does not offer jockey or trainer career-statistics endpoints, so present these rows per horse.
- 1Racecard runner. Read runner.jockey.id and runner.trainer.id.
- 2Connection endpoint. One request lists every booking for that person on that day.
- 3Join by raceId. Look up time and course in your cached racecards.
- 4Show per horse. Display each booking's connection rows separately.
See the API reference for the booking schema.
Reference material
Exact schemas: API reference. First call: Quickstart. Copy-ready helpers: Code examples. Plans: Pricing.