Every collection returns the same envelope:
{
"items": [ /* ... */ ],
"next": "lst_eyJjb2xsZWN0aW9uIjoiZXZlbnRzIiwicG9zaXRpb24iOiJldnRfN0tkMm1..." ,
"previous": "lst_eyJjb2xsZWN0aW9uIjoiZXZlbnRzIiwicG9zaXRpb24iOiJldnRfM05iOHhL..."
}next and previous are absent when there is nothing further in that direction. Collection pages do not provide stream continuations. Use /v2/events/snapshot or /v2/events/{id}/snapshot for the stream block needed to follow Streaming.
Walking a collection
Pass next back as after. Keep going until it stops coming.
# First page
curl 'https://api-beta.betwatch.com/v2/events?limit=100' --header 'X-API-Key: YOUR_API_KEY'
# Next page
curl 'https://api-beta.betwatch.com/v2/events?limit=100&after=lst_eyJjb2xsZWN0aW9u...' \
--header 'X-API-Key: YOUR_API_KEY'def all_events(client, **filters):
cursor = None
while True:
page = client.get("/v2/events", params={**filters, "limit": 200, **({"after": cursor} if cursor else {})})
yield from page["items"]
cursor = page.get("next")
if not cursor:
returnbefore walks backwards from a cursor. after and before are mutually exclusive; sending both is 422 invalid_filter.
Cursors encode a position and a filter fingerprint, nothing about you, and are not secret or authorization credentials. Their format is not an API contract: do not decode, build, or edit one. Entitlements are checked independently on every request. List cursors are not cryptographically signed; the fingerprint prevents accidental filter reuse, not malicious forgery.
Page size
limit accepts 1–200 and defaults to 100. Outside that range is 422 invalid_filter.
There is no total count. Counting a collection you are about to page through costs as much as the page itself and is stale by the time you read it; page until next is absent instead.
Sort order
Each collection has a documented order, and cursors follow it:
| Collection | Order |
|---|---|
/v2/events |
Start time, earliest first |
/v2/entrants |
Saddle-cloth number |
/v2/venues |
Venue name |
/v2/meetings |
Local race date, then venue name |
/v2/sources |
Source name |
/v2/odds |
Identifier — arbitrary but stable |
/v2/competitors/{id}/form |
Start time, newest first |
Where the order is by identifier it is stable within a request, but it carries no meaning: do not present it to a user as if it did, and do not infer time or importance from it.
Filters
REST collection filters combine as AND across kinds and OR within a kind. Encode array values as comma-separated values: ?sport=thoroughbred&country=au,nz means thoroughbred racing in Australia or New Zealand. Repeated REST query keys do not combine values. The SSE endpoint uses repeated keys instead. Supported filters depend on the endpoint; snapshot continuation pages accept only their page token.
| Filter | Accepts |
|---|---|
sport |
thoroughbred, greyhound, harness |
country |
ISO 3166-1 alpha-2, any case (au, NZ) |
status |
scheduled, open, in_progress, closed, interim, final, abandoned, cancelled, postponed, unknown |
event, meeting, venue, entrant, competitor |
The matching opaque id. |
key |
win or place |
source |
A source id from /v2/sources |
startFrom, startTo |
RFC 3339 timestamps with Z or an explicit offset, inclusive. Omit startFrom on a discovery read (with no startTo, or a future one) and it starts five minutes ago — see List races. |
include |
Endpoint-specific; unsupported values return 422. See below. |
limit, after, before |
Paging, as above |
At most 50 values per filter. More is 422 invalid_filter.
Unknown query parameters are rejected, so a typo surfaces immediately instead of quietly widening your results. Add include values only for data you use: each one costs a read on our side and quota on yours.
Shared parameter names do not imply every endpoint accepts them. For example, competitor is supported on /entrants, not /events. Use competitor form for date-ordered past runs. A date-time without a timezone is rejected, with an example of the required format; URL-encode a positive offset’s +.
| Read | Accepted include values |
|---|---|
| Events list/detail | coverage, racing |
| Entrants list/detail | racing |
| Odds list | history, coverage |
| Single odds | history |
| Single-event snapshot | coverage, history, racing (history requires full view) |
| Single meeting | events |
Some collections require a filter
/v2/odds and /v2/entrants refuse an unscoped read with 422 filter_required. They exist to answer questions about races you have already found, and serving them unscoped would mean hydrating everything you can see to return one page. Discover with /v2/events first.