API v1 · Beta
Open text ↗

Copies the developer guides, direct HTTP examples, and complete OpenAPI contract as one plain-text bundle.

Build your first
football data request.

Stats API is a football stats API for fixtures, results, competitions, teams, and match team statistics including corners, shots, possession, cards and expected goals. Statistics are available only for the competitions our sources cover, and every match response states its own coverage rather than failing. Ingestion is scheduled rather than streamed, so this is not a guaranteed live feed. Use one documented v1 contract to power apps, dashboards, research workflows, and AI agents.

Base URLhttps://stats-api.com/api/v1

Authentication

Send the API key in the HTTP Authorization header. Keys are displayed once, stored as SHA-256 hashes, and can be revoked independently.

Keep the key in a server-side environment variable or secret manager. Never put it in a URL, browser bundle, mobile binary, log, source file, or AI prompt.

Direct HTTP client examples

Stats API does not require a language package. These are complete direct HTTP examples, not official SDK packages. Each one reads STATS_API_KEY from the server-side process environment, calls the implemented competition collection, sets a timeout, validates failures, and preserves X-Request-ID for debugging.

Use Node.js 18+, Python 3 with requests, PHP with cURL, Go, Java 11+, or .NET 6+. Browser and mobile code should call your own server route so the bearer key stays private.

test -n "$STATS_API_KEY" || { echo "STATS_API_KEY is required." >&2; exit 1; }
curl --fail-with-body --silent --show-error --max-time 15 \
  "https://stats-api.com/api/v1/football/competitions?limit=10" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $STATS_API_KEY"

Repository users can also copy the standalone files from examples/direct-http/. The OpenAPI document remains authoritative if an example and the contract ever disagree.

Pagination

Collection endpoints accept page and limit. The default limit is 25 and the maximum is 100. Response metadata includes total, has_more, and a nullable next_page, so clients do not need to infer when pagination ends.

ParameterTypeDefault
pageinteger1
limitinteger · 1–10025

Rate limits and quota

Every request admitted through the per-minute limit counts once toward the billing-period quota, including a Redis cache hit and an application-level error produced after authentication. Authentication failures and requests rejected by the per-minute limiter do not consume the billing-period quota. Response headers show both allowances.

X-RateLimit-LimitX-RateLimit-RemainingX-RateLimit-ResetX-Quota-LimitX-Quota-RemainingX-Quota-ResetRetry-After · on 429X-StatsAPI-CacheX-Request-ID

Errors

Errors use a consistent object with a stable machine-readable code. Undocumented query parameters return 422 unknown_parameter instead of being silently ignored.

JSON
{
  "error": {
    "code": "invalid_api_key",
    "message": "Provide an active Stats API key…",
    "details": {}
  }
}

Available endpoints

Loading the OpenAPI contract…

35-operation coverage map

Our roadmap uses the mature football API category as a capability benchmark. Only operations in the OpenAPI contract above are available today.