Making requests
Every endpoint is HTTPS, returns JSON, and uses a consistent envelope so client code can be written once and shared across resources.
Base URL
https://api.sportapi.io/v1WebSocket endpoint:
wss://stream.sportapi.io/v1Request headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token, e.g. Bearer sk_live_… |
Accept | No | Defaults to application/json. CSV available on bulk endpoints. |
Accept-Encoding | No | We support gzip and br. Enable in your client for ~70% size reduction. |
X-Sportapi-Version | No | Pin to a dated API version, e.g. 2025-09-01. Defaults to your account's pinned version. |
X-Request-Id | No | Pass-through ID for tracing. Echoed back in the response. |
X-Idempotency-Key | No | For idempotent retries on POST endpoints (e.g. webhook creation). |
Response envelope
Every successful response uses the same shape:
{
"<resource>": [ ... ] | { ... },
"meta": {
"count": 12,
"request_id": "req_8f3a2b1c",
"page": { "cursor": "eyJpZCI6IjAwMjI1MDA0MTIifQ==", "has_more": true }
}
}The top-level key is named after the resource (games, players, news, …) — never data. This avoids the "data.data.data" nesting that happens with generic envelopes.
The meta object
meta.count— number of items in this responsemeta.request_id— unique ID, include in support requestsmeta.page— pagination state (when applicable)meta.timing.ms— server processing time
Versioning
We use dated versions: 2025-09-01, 2026-01-15, etc. Your account is pinned to one version. Breaking changes never affect your traffic unless you opt in by upgrading.
Want to test an unreleased version? Pass
X-Sportapi-Version: preview. Preview versions are not SLA-covered.Content types
application/json— default, used everywheretext/csv— available onGET /v1/exports/*bulk endpointsapplication/x-ndjson— streamed bulk export with one JSON record per line