The Football Statistics API for Betting Analytics & Prediction Models
Access 20+ years of football match data, team stats, and player metrics for building betting models and analytics tools. 1,196 competitions, clean JSON, from $50/month.
Prediction models are only as good as the data feeding them. If you are building betting analytics tools, ELO ratings, or expected goals models, you need historical match data that is deep, consistent, and structured for programmatic consumption. TheStatsAPI provides 20+ years of football statistics across 1,196 competitions - the kind of dataset that makes the difference between a model that works and one that guesses.
Why Data Quality Matters for Betting Models
Garbage in, garbage out. It is the oldest rule in data science and it applies directly to football prediction models.
If your match data has missing fixtures, inconsistent team IDs across seasons, or gaps in player statistics, your model inherits those flaws. Every missing data point introduces noise. Every inconsistency creates a feature your model learns incorrectly.
TheStatsAPI provides verified, structured data with consistent identifiers across seasons and competitions. Teams, players, and competitions maintain stable IDs whether you are querying the 2005-2006 season or yesterday's results. That consistency is the foundation reliable models require.
Available Data for Analytics
TheStatsAPI gives you multiple layers of data to build on:
- Match results - final scores, dates, home/away designation, competition context, and season identifiers for every fixture across 1,196 competitions
- Team stats per match - shots, shots on target, possession, fouls, corners, and other match-level team metrics. This is the raw material for expected goals models and team strength ratings
- Player-level statistics - goals, assists, appearances, minutes, cards, and shooting data for 84,000+ players. Essential for player-based prediction features
- 20+ years of history - enough depth to train models on long-term trends, not just recent form. Most competing APIs cap history at 5-10 seasons unless you pay enterprise rates
Endpoint Walkthrough
Two endpoints handle the bulk of data collection for betting analytics.
Bulk Match Retrieval by Season
GET https://api.thestatsapi.com/api/football/matches?competition_id=1&season=2024
Returns all matches for a given competition and season. Use this to backfill your database with historical results. Iterate over seasons and competitions to build a comprehensive dataset.
This is how you populate your training data. Loop through seasons 2004 to 2025, pull every match, and you have two decades of structured results ready for analysis.
Per-Match Statistics
GET https://api.thestatsapi.com/api/football/matches/{id}/stats
Returns detailed team-level statistics for a specific match - shots, possession, corners, fouls, and more. Use this to enrich your match records with the features your model needs beyond raw scores.
Sample response:
{
"data": {
"match_id": 56789,
"home_team": {
"shots": 15,
"shots_on_target": 7,
"possession": 58.3,
"corners": 8,
"fouls": 11
},
"away_team": {
"shots": 9,
"shots_on_target": 3,
"possession": 41.7,
"corners": 3,
"fouls": 14
}
}
}
A Note on Live Odds and In-Play Data
Transparency matters more than a sales pitch. TheStatsAPI does not currently provide live odds or real-time in-play data. Live data is on the roadmap, but it is not available today.
For post-match prediction models - the kind that forecast outcomes before kickoff using historical patterns - this is not a limitation. Your model trains on historical data and generates predictions before matches start. TheStatsAPI is built for exactly this workflow.
If you are building live in-play betting tools that react to match events in real time, you will need to combine TheStatsAPI's historical depth with a live odds or in-play data provider. Use TheStatsAPI for the model training dataset and backfill, and a streaming provider for the real-time signal.
Code Example: Build a Dataset with Python and pandas
import requests
import pandas as pd
API_KEY = "your_api_key"
BASE_URL = "https://api.thestatsapi.com/api"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Fetch 3 seasons of Premier League matches
COMPETITION_ID = 1 # Premier League
seasons = [2023, 2024, 2025]
all_matches = []
for season in seasons:
response = requests.get(
f"{BASE_URL}/football/matches",
headers=headers,
params={"competition_id": COMPETITION_ID, "season": season}
)
matches = response.json()["data"]
all_matches.extend(matches)
# Load into a DataFrame for analysis
df = pd.DataFrame(all_matches)
print(f"Total matches loaded: {len(df)}")
print(df[["date", "home_team", "away_team", "score"]].head(10))
Three seasons of Premier League data in 15 lines of Python. From here, enrich each match with per-match stats, build features, and train your model.
Pricing
The Starter plan at $50/month gives you 100,000 requests - enough to backfill several leagues of historical data and maintain ongoing updates. For large-scale data collection across dozens of leagues and seasons, the Growth plan at $129/month provides 500,000 requests with a higher rate limit of 60 requests per minute.
| Plan | Price | Requests/month | Rate Limit |
|---|---|---|---|
| Starter | $50/mo | 100,000 | 30/min |
| Growth | $129/mo | 500,000 | 60/min |
| Scale | $379/mo | 5,000,000 | 300/min |
Every plan includes a 7-day free trial and access to every endpoint. Start building your dataset today.
FAQ
How far back does the historical data go?
Over 20 years. You can access match results, team statistics, and player data going back to the early 2000s across major competitions. This depth is critical for training robust prediction models that capture long-term trends, not just recent form.
Does the API include odds data?
No. TheStatsAPI provides match statistics, player data, and competition results - not bookmaker odds. If your model requires odds as an input feature, you will need to source those separately. Many analytics teams pair TheStatsAPI's statistical depth with a dedicated odds feed.
What about rate limits when doing bulk historical data collection?
The Starter plan allows 30 requests per minute, which is sufficient for methodical backfilling. The Growth plan increases this to 60/min, and the Scale plan provides 300/min for heavy data collection. For a one-time historical backfill, even the Starter rate limit lets you pull thousands of matches per hour.
Can I use this data in a commercial betting analytics product?
Yes. All plans support commercial use. There are no separate licensing fees for using the data in analytics tools, prediction platforms, or tipster services. Your plan's request limits are the only constraint.
Ready to Power Your Sports App?
Start your 7-day free trial. All endpoints included on every plan.