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/v1

WebSocket endpoint:

wss://stream.sportapi.io/v1

Request headers

HeaderRequiredDescription
AuthorizationYesBearer token, e.g. Bearer sk_live_…
AcceptNoDefaults to application/json. CSV available on bulk endpoints.
Accept-EncodingNoWe support gzip and br. Enable in your client for ~70% size reduction.
X-Sportapi-VersionNoPin to a dated API version, e.g. 2025-09-01. Defaults to your account's pinned version.
X-Request-IdNoPass-through ID for tracing. Echoed back in the response.
X-Idempotency-KeyNoFor 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 response
  • meta.request_id — unique ID, include in support requests
  • meta.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 everywhere
  • text/csv — available on GET /v1/exports/* bulk endpoints
  • application/x-ndjson — streamed bulk export with one JSON record per line