Soccer Stats API - MLS, Player Data, Odds & Global Coverage
Soccer stats API for US developers building MLS dashboards, player trackers, betting tools, and AI-built soccer apps. REST JSON, 7-day trial, full docs for AI tools.
Build soccer products with the same football data API used for global coverage. TheStatsAPI gives US developers REST JSON endpoints for MLS fixtures, match results, player stats, team data, odds, xG where available, and historical records.
If your users say "soccer" and your data provider says "football", that is fine. The endpoint paths use /football/..., but the product you build can be fully US-facing: MLS dashboards, fantasy soccer tools, betting analytics, player trackers, sports media pages, and AI-generated apps.
Start with Build with AI, test endpoints in the API tester, or give your coding agent the API llms.txt so it builds against the real API contract.
What You Can Build
| Product | What users see | API data used |
|---|---|---|
| MLS dashboard | Fixtures, live scores, results, team pages | Matches, teams, competitions |
| Player tracker | Player search, profiles, season stats | Players, player stats |
| Fantasy soccer app | Minutes, goals, assists, cards, scoring inputs | Player stats, match player stats |
| Betting analytics tool | Odds, match context, xG, team form | Odds, match stats, team stats |
| Sports media page | Match previews, recaps, stat widgets | Fixtures, match details, player data |
| AI-built soccer app | Natural-language app generation from docs | Build with AI, llms.txt |
This page is a starting point for product builders. If you want exact endpoint parameters, use API llms.txt or the API tester.
Fast Path: Build a Soccer App with AI
The quickest route is not to wire every endpoint manually. Give your AI coding tool the live API reference and a clear product brief.
Read this API reference before coding: https://api.thestatsapi.com/llms.txt
Build a US-facing soccer stats dashboard using TheStatsAPI.
Requirements:
- Use "soccer" in the app UI, even though API paths use /football.
- Keep THESTATSAPI_KEY server-side.
- Add league selection with MLS as the default.
- Show fixtures, recent results, player search, team stats, and an optional odds panel.
- Use only endpoint paths and fields listed in llms.txt.
- Add loading, empty, and error states.
- If odds, xG, or player stats are unavailable for a fixture, show a neutral empty state.
For a more guided prompt, use Build with AI. It creates a prompt for Claude Code, Cursor, Lovable, Bolt, Replit, Windsurf, or any other AI coding tool.
Why US Teams Use "Soccer" but the API Uses "Football"
TheStatsAPI uses football terminology because the sport is called football globally. The endpoint paths look like this:
GET /football/competitions
GET /football/matches
GET /football/players
GET /football/teams/{team_id}/stats
GET /football/matches/{match_id}/odds
That does not affect your product. Your navigation, page titles, filters, and copy can say "soccer", while your backend calls /football/... endpoints.
MLS and Global Soccer Coverage
Major League Soccer is included in the default competition set. You can use TheStatsAPI for MLS fixtures, teams, players, match results, and supported match statistics.
Most US soccer products do not stop at MLS. Fans often want MLS plus the Premier League, Champions League, La Liga, Serie A, Bundesliga, Liga MX, international tournaments, or other global competitions. TheStatsAPI includes 80 competitions by default, with up to 1,196 available on request.
Use the coverage page to check the competitions you care about before you build.
Core Soccer API Endpoints
| Need | Endpoint | Notes |
|---|---|---|
| Find competitions | GET /football/competitions | Search by name, country, or type |
| Find MLS | GET /football/competitions?search=Major League Soccer | Use the returned id as competition_id |
| Get seasons | GET /football/competitions/{competition_id}/seasons | Use is_current to pick the current season |
| List fixtures/results | GET /football/matches | Filter by competition_id, season_id, team_id, status, dates |
| Match details | GET /football/matches/{match_id} | Score, venue, referee, availability flags |
| Match stats | GET /football/matches/{match_id}/stats | Shots, possession, corners, xG where available |
| Player search | GET /football/players?search={name} | Build player lookup and profile flows |
| Player season stats | GET /football/players/{player_id}/stats?season_id={season_id} | Goals, assists, minutes, cards, grouped stats |
| Team stats | GET /football/teams/{team_id}/stats?season_id={season_id} | Position, points, form, goal difference |
| Pre-match odds | GET /football/matches/{match_id}/odds | 1X2, BTTS, totals, corners, Asian handicap |
| Live odds | GET /football/matches/{match_id}/odds/live | Use when live_odds_available is true |
The two important implementation rules are simple: keep your API key server-side, and check availability flags before showing optional data such as xG or live odds.
Product Recipes
MLS fixtures page
- Call
GET /football/competitions?search=Major League Soccer. - Store the returned competition ID.
- Call
GET /football/competitions/{competition_id}/seasons. - Pick the season where
is_currentis true. - Call
GET /football/matches?competition_id={competition_id}&season_id={season_id}. - Render home team, away team, score, status, UTC date, and match ID.
Player tracker
- Search players with
GET /football/players?search={name}. - Let the user select a player.
- Fetch season stats with
GET /football/players/{player_id}/stats?season_id={season_id}. - Show appearances, starts, minutes, goals, assists, cards, shots, and grouped stats where available.
Soccer betting dashboard
- Fetch upcoming fixtures with
GET /football/matches. - Check whether odds are available on the match.
- Fetch pre-match odds with
GET /football/matches/{match_id}/odds. - Join odds to match stats and team stats for context.
- Use live odds only when
live_odds_availableis true.
Python Example: Fetch MLS Fixtures
import os
import requests
API_KEY = os.environ["THESTATSAPI_KEY"]
BASE_URL = "https://api.thestatsapi.com/api"
headers = {"Authorization": f"Bearer {API_KEY}"}
competitions = requests.get(
f"{BASE_URL}/football/competitions",
headers=headers,
params={"search": "Major League Soccer"},
timeout=20,
)
competitions.raise_for_status()
mls = competitions.json()["data"][0]
competition_id = mls["id"]
seasons = requests.get(
f"{BASE_URL}/football/competitions/{competition_id}/seasons",
headers=headers,
timeout=20,
)
seasons.raise_for_status()
current_season = next(
season for season in seasons.json()["data"] if season["is_current"]
)
matches = requests.get(
f"{BASE_URL}/football/matches",
headers=headers,
params={
"competition_id": competition_id,
"season_id": current_season["id"],
"per_page": 10,
},
timeout=20,
)
matches.raise_for_status()
for match in matches.json()["data"]:
home = match["home_team"]["name"]
away = match["away_team"]["name"]
score = match.get("score") or {}
print(
f"{match['utc_date']}: {home} {score.get('home', '-')} - "
f"{score.get('away', '-')} {away} ({match['status']})"
)
Pricing
Every plan includes every endpoint. Plans differ by request volume.
| 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 |
Start with the 7-day trial, build against the real endpoints, then pick the request volume that matches your app.
Best Next Step
If you are evaluating the API, use this order:
- Check coverage for MLS and the competitions you need.
- Try a request in the API tester.
- Generate an implementation prompt with Build with AI.
- Give your coding agent API llms.txt.
- Build a small app with fixtures, player search, and one match detail view.
FAQ
Is there a free soccer stats API?
Some providers have free soccer data tiers, but they usually limit requests, competitions, data freshness, or player stats. TheStatsAPI offers a 7-day free trial with full endpoint access, then paid plans from $50/month.
Does TheStatsAPI cover MLS?
Yes. Major League Soccer is included in the default competition set.
Does the API use soccer or football endpoints?
The endpoint paths use football, because that is the global sport name. US-facing products can still label the sport as soccer in their UI.
Can I build a soccer app with AI?
Yes. Use Build with AI, then tell your coding agent to read API llms.txt before coding. The prompt above gives it the product shape and endpoint guardrails.
What soccer leagues are available?
The default set includes 80 competitions, including MLS and major global leagues and tournaments. Coverage can expand up to 1,196 competitions on request. Check coverage for the current list.
Ready to Power Your Sports App?
Start your 7-day free trial. All endpoints included on every plan.