Python quickstart — KickoffAPI v2
Standard-library-plus-requests patterns for live scores, fixtures, pagination and error handling against https://api.kickoffapi.com/api/v2.
1. Your first call
import requests
API = "https://api.kickoffapi.com/api/v2"
KEY = "your_key" # free at https://kickoffapi.com/pricing.html
r = requests.get(f"{API}/fixtures", headers={"x-api-key": KEY},
params={"limit": 3})
r.raise_for_status()
payload = r.json()
for fx in payload["data"]:
print(fx["homeTeam"]["name"], "vs", fx["awayTeam"]["name"], "-", fx["date"])
# Every response uses one envelope: {"data": [...], "meta": {...}}
2. Pagination (cursor)
def all_fixtures(status="FT", max_pages=5):
out, cursor = [], None
for _ in range(max_pages):
params = {"limit": 100, "status": status}
if cursor:
params["cursor"] = cursor
r = requests.get(f"{API}/fixtures", headers={"x-api-key": KEY}, params=params)
r.raise_for_status()
body = r.json()
out.extend(body["data"])
cursor = body["meta"].get("cursor")
if not cursor:
break
return out
3. Two error responses worth handling
{"error":"Missing x-api-key header for path: /api/v2/fixtures","code":"MISSING_API_KEY"}
{"error":"Invalid API key","code":"INVALID_API_KEY"}
if r.status_code == 401 and r.json().get("code") == "INVALID_API_KEY":
pass # refresh the key; do not retry in a loop
4. Respect the two rate-limit windows
print(r.headers["X-RateLimit-Remaining"]) # per-minute window
print(r.headers["X-RateLimit-Daily-Remaining"]) # per-day window
On the free tier that is 30/minute and 100/day. Cache responses for 5 minutes and one key covers a small app comfortably.
5. Next steps
Full endpoint list: v2 reference. A complete working bot built on these patterns: Telegram score bot tutorial. Prefer an MCP client? See the MCP server page.
Verified: the two error responses below were captured from the live API. Request and response shapes follow the v2 reference; run the examples yourself with a free key — Hobby plan, 100 requests/day, no card.