Skip to content

Authentication

Authenticate to the Betwatch Racing API with an API key in the X-API-Key header.

Every request carries an API key in the X-API-Key header. There is nothing to negotiate, no token to refresh, and no handshake — a key works from a one-line script.

curl 'https://api-beta.betwatch.com/v2/events?limit=5' \
  --header 'X-API-Key: YOUR_API_KEY'

Getting a key

Create an account

Sign in at Account → API. Any signed-in account can mint a key.

Generate a key

Choose Generate API key. The full value is shown once — copy it and store it somewhere safe. We cannot show it again.

Send it on every request

Set the X-API-Key header. That is the whole integration.

Keys never travel in the URL

The header is the only way to authenticate. A request with a credential-shaped query parameter — apikey, api_key, key, token, access_token — is refused with 401 and authentication_required, even if the header is also present.

That is deliberate rather than pedantic. By the time a URL reaches us, it has been through your logs, your proxy, our edge, and our access logs, and a key in the path is now in all of them. Refusing the request is the only response that gets the key rotated instead of quietly leaked.

Scopes

A key’s plan grants scopes, and the API tells you when one is missing rather than pretending the data does not exist.

Scope Grants Without it
rest Every /v2 read 403 scope_required
stream GET /v2/stream 403 scope_required

stream always includes rest: a stream client must be able to bootstrap over REST after a resync or an expired cursor.

REST-only plans can read and page through snapshots without streaming access. If the plan has no replay window, snapshot cursors last 15 minutes; they do not grant access to /v2/stream.

What your plan can see

Beyond scopes, your plan defines the data in view: which sports, which countries, and how far back history goes. Races outside that scope are not in your responses at all — not as empty rows, not as partial records.

If your plan grants no sports or countries, reads fail with 403 entitlement_empty rather than returning an empty page. An empty page would be indistinguishable from a quiet Tuesday, and would send you debugging your filters instead of your subscription.

Revoking and rotating

Revoke a key at Account → API; it stops working immediately. To rotate without downtime, generate the new key, deploy it, then revoke the old one — keys are independent, so both work during the overlap.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close