Build your first
football data request.
Stats API is a JSON REST API. Create a key in the dashboard, add it as a Bearer token, and call an available v1 endpoint.
https://stats-api.com/api/v1Authentication
Send the API key in the HTTP Authorization header. Keys are displayed once, stored as SHA-256 hashes, and can be revoked independently.
curl "https://stats-api.com/api/v1/football/competitions?limit=10" \
-H "Authorization: Bearer $STATSAPI_KEY"
const response = await fetch(
"https://stats-api.com/api/v1/football/competitions?limit=10",
{ headers: { Authorization: `Bearer ${process.env.STATS_API_KEY}` } }
);
if (!response.ok) throw new Error(`Stats API ${response.status}`);
const payload = await response.json();
<?php
$handle = curl_init(
"https://stats-api.com/api/v1/football/competitions?limit=10"
);
curl_setopt_array($handle, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("STATS_API_KEY"),
],
]);
$payload = json_decode((string) curl_exec($handle), true);
import os
import requests
response = requests.get(
"https://stats-api.com/api/v1/football/competitions",
params={"limit": 10},
headers={"Authorization": f"Bearer {os.environ['STATS_API_KEY']}"},
timeout=15,
)
response.raise_for_status()
payload = response.json()
Pagination
Collection endpoints accept page and limit. The default limit is 25 and the maximum is 100.
| Parameter | Type | Default |
|---|---|---|
page | integer | 1 |
limit | integer · 1–100 | 25 |
Rate limits and quota
Every request counts toward monthly usage, including cache hits and non-2xx application responses after authentication. Response headers show both the per-minute allowance and billing-period quota.
X-RateLimit-LimitX-RateLimit-RemainingX-Quota-LimitX-Quota-RemainingX-Quota-ResetX-StatsAPI-CacheX-Request-IDErrors
Errors use a consistent object with a stable machine-readable code.
{
"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.