Python
All you need is requests. Keep the key in an environment variable.
Poll today's results
import os, time, requests S = requests.Session() S.headers["X-API-Key"] = os.environ["KEY"] URL = "https://api.greyhoundracingapi.com/v1/results/today" since = time.strftime("%H:%M", time.gmtime()) while True: r = S.get(URL, params={"since": since}) if r.status_code == 429: time.sleep(int(r.headers.get("Retry-After", 60))); continue since = time.strftime("%H:%M", time.gmtime()) for race in r.json()["data"]: print(race["track_name"], race["no"], race["result"][0]["runner"]) time.sleep(90)
Paging an archive day
See Pagination for the cursor loop.