Docs› Coverage› Pricing› Status› Support›
  1. Home
  2. Documentation
  3. Pagination

Greyhound racing API: Pagination

Pagination

Paging through greyhound racing API lists by page number or cursor, and polling with since.

Pagination

Every list comes 50 races a page, with the totals in meta.

FieldTypeMeaning
meta.countintegerRaces on this page.
meta.pageintegerThis page number.
meta.per_pageintegerAlways 50.
meta.totalintegerRaces in the whole list.
meta.total_pagesintegerPages in the whole list.
meta.next_cursorstringPass it as cursor for the next page. null on the last page.

By cursor

The simplest loop: call, keep the rows, and call again with cursor set to meta.next_cursor until it is null.

Python
params = {"date": "2024-03-09"}
rows = []
while True:
    j = S.get("https://api.greyhoundracingapi.com/v1/results", params=params).json()
    rows += j["data"]
    if not j["meta"]["next_cursor"]: break
    params["cursor"] = j["meta"]["next_cursor"]

By page number

Pass page=2, page=3 and so on, up to meta.total_pages. Useful when you want one page in the middle.

Polling instead of paging

For today's results, do not page through the day every time. Call with since set to the newest settled_at you hold and you get only the races settled after it. See Today's results.