Skip to main content
This page explains what football data TheStatsAPI has and how its requests and responses work. The API is read-only: you send HTTPS GET requests with your API key and get JSON back.
Fastest way to build: give your AI coding tool https://api.thestatsapi.com/llms.txt and a starter prompt. See Build with AI.

What data you can get

Not every competition has every data type, and how far back the data goes varies by competition. Check Coverage before you build a feature. Competitions and matches also carry flags such as xg_available and odds_available, so you can tell before you call an endpoint.

Base URL and authentication

Every endpoint lives under this base URL:
Send your API key in the Authorization header on every request:
Get a key on the API keys page. See Authentication for details.

Requests

  • Filters are query parameters. For example, /football/matches?team_id=tm_9145&status=finished.
  • Only documented parameters are accepted. A misspelled or unknown parameter returns 400 UNKNOWN_PARAMETER. The message suggests the closest name and lists the parameters the endpoint accepts.
  • IDs are prefixed strings. Use them exactly as the API returns them.
  • Dates are YYYY-MM-DD in date_from and date_to. There is no date parameter. Kickoff times in responses are UTC.

Responses

List endpoints return a data array and a meta object for paging. For example, GET /football/teams?search=Arsenal&is_mens_team=true&per_page=1 returns:
Single-item endpoints return one object in data. For example, GET /football/competitions/comp_3039 returns (trimmed):
Errors always use the same shape. Branch on code:
Learn more in Pagination, Errors and Rate limits.
Data is pull-only. There are no webhooks or streaming connections. For live matches, poll the live endpoints. See Live matches.

Versioning and changes

  • We add new endpoints, parameters and response fields over time. Write code that ignores fields it doesn’t recognise.
  • Deprecated endpoints are labelled in the API reference. For example, player-prop odds moved to /v2/football/matches/{match_id}/odds/players, and the old v1 path is marked deprecated.