Quick start
A key, the first call, the answer.
1. Get a key
Sign in with Google on the free key page. Your key is shown once, so copy it somewhere safe. It starts with gra_live_, and it is filled into these pages for you.
2. Make a call
Send the key in the X-API-Key header. This asks for yesterday's UK results, which every plan can read:
curl "https://api.greyhoundracingapi.com/v1/results/yesterday?country=GB" \ -H "X-API-Key: $KEY"
import os, requests r = requests.get( "https://api.greyhoundracingapi.com/v1/results/yesterday", params={"country": "GB"}, headers={"X-API-Key": os.environ["KEY"]}, timeout=30, ) print(r.json()["data"])
const r = await fetch("https://api.greyhoundracingapi.com/v1/results/yesterday?country=GB", { headers: { "X-API-Key": process.env.KEY }, }); console.log((await r.json()).data);
$ch = curl_init("https://api.greyhoundracingapi.com/v1/results/yesterday?country=GB"); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("KEY")], ]); $data = json_decode(curl_exec($ch), true); print_r($data["data"]);
3. Read the answer
Every answer has the same shape: data holds what you asked for and meta says how much there is. When something goes wrong you get error instead, with a code you can act on (see Errors).
{
"data": [ races ],
"meta": { "count": 48, "page": 1, "total_pages": 3, "next_cursor": "cDI", "took_ms": 61 }
}Base address
https://api.greyhoundracingapi.com/v1Every endpoint answers GET. Add .csv to any list path, or format=csv, for a spreadsheet-ready file.
Where next
Authentication, plans and limits, then the endpoint pages in the menu, each with Try it.