UStackUStack
TheStatsAPI icon

TheStatsAPI

TheStatsAPI is a football stats API for developers with match stats, player and team data, fixtures/results, and pre-match & live odds.

TheStatsAPI

What is TheStatsAPI?

TheStatsAPI is a football statistics API for developers that provides programmatic access to match data, player and team statistics, fixtures/results, and betting odds. It’s designed to power applications that need structured football data delivered as clean, paginated JSON from documented endpoints.

The API covers statistics across 80 competitions by default (up to 1,196 competitions available on request) and includes both historical data (listed as 10 years of coverage) and live data where available, such as in-play match odds and match statistics.

Key Features

  • Match schedules and results: Retrieve fixture lists and historical results for covered competitions.
  • Player and team statistics: Access season and career player stats (e.g., goals, assists, appearances, minutes, cards, shots) and team-related stats.
  • Live and finalized match statistics: Use endpoints for match stats including shots, expected goals (xG), possession, passes, and minute-by-minute events.
  • Odds (pre-match and live): Fetch pre-match odds and, for supported fixtures, in-play odds via a live endpoint where live_odds_available is true.
  • Advanced analytics: Pull expected goals metrics and related underlying measures, including xG, non-penalty xG (npxG), xA, plus deeper match analytics.
  • Competition scope and structured data: Query competitions and seasons (with current season selection via matches the competition detail’s current_season_id) and retrieve JSON responses from 19 endpoints across 5 categories (Competitions, Teams, Matches, Players, Odds).

How to Use TheStatsAPI

  1. Start a free trial and test endpoints using the interactive demo (documentation shows example requests and a “Run API Call” workflow).
  2. Get an API key and authenticate requests using an Authorization: Bearer YOUR_API_KEY header.
  3. Use the documented base routes under /api/football/* (for example, competition listings or match stats).
  4. Request the specific resource you need (competitions, seasons, matches, players, odds) and follow pagination parameters returned by endpoints.

Example call shown on the site:

  • GET /api/football/matches/mt_010249745/stats with a Bearer token.

Use Cases

  • Fantasy football apps: Build scoring and player selection features using player season/career statistics and match-by-match scoring inputs.
  • Match day scoreboards: Display real-time odds and live match stats (including status and event-driven updates) for fixtures supported by live data.
  • Betting analytics and backtesting: Use the archived pre-match odds data alongside historical match results and xG metrics to support modeling and analysis.
  • Team and player performance reports: Generate dashboards using season and career aggregates (goals, assists, minutes, cards, shots) plus match and event context.
  • Editorial or sports data products: Enrich articles or feeds with structured fixtures/results and analytics fields such as xG and npxG.

FAQ

Does TheStatsAPI return live data and finalized data?

The API is described as providing live and finalized match stats (shots, xG, possession, passes, cards, goals, and minute-by-minute events), and it also includes a live match odds endpoint for matches where live_odds_available is true.

How many competitions are available?

The site states 80 competitions by default, with up to 1,196 available on request.

What format do the endpoints return?

The documentation notes that endpoints return clean, paginated JSON.

Which kinds of data can I query?

The site lists endpoints and categories for competitions, teams, matches, players, and odds, including fixtures/results, player season statistics, and pre-match/live odds.

How do I authenticate requests?

Requests shown in the demo use an Authorization Bearer token header: Authorization: Bearer YOUR_API_KEY.

Alternatives

  • Sports data aggregators with football APIs: Alternatives in the same category typically offer match stats and player/fixture data as JSON, but may differ in coverage scope and the availability of live odds/in-play feeds.
  • General analytics/data platforms with sports connectors: These may provide easier visualization or pipelines, but can require additional steps to extract the same match-level event and xG fields.
  • Betting-focused odds APIs: If your primary need is odds (pre-match and/or in-play), a betting-odds-first API may simplify odds access, though it may not include as broad match/event and xG analytics.
  • Open football data sources (non-odds): For teams/players/matches without bookmaker odds, open data sources can be a fit, but you’ll likely need separate sources for xG and betting odds.