GUIDE

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.

7 min read

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

ProductWhat users seeAPI data used
MLS dashboardFixtures, live scores, results, team pagesMatches, teams, competitions
Player trackerPlayer search, profiles, season statsPlayers, player stats
Fantasy soccer appMinutes, goals, assists, cards, scoring inputsPlayer stats, match player stats
Betting analytics toolOdds, match context, xG, team formOdds, match stats, team stats
Sports media pageMatch previews, recaps, stat widgetsFixtures, match details, player data
AI-built soccer appNatural-language app generation from docsBuild 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

NeedEndpointNotes
Find competitionsGET /football/competitionsSearch by name, country, or type
Find MLSGET /football/competitions?search=Major League SoccerUse the returned id as competition_id
Get seasonsGET /football/competitions/{competition_id}/seasonsUse is_current to pick the current season
List fixtures/resultsGET /football/matchesFilter by competition_id, season_id, team_id, status, dates
Match detailsGET /football/matches/{match_id}Score, venue, referee, availability flags
Match statsGET /football/matches/{match_id}/statsShots, possession, corners, xG where available
Player searchGET /football/players?search={name}Build player lookup and profile flows
Player season statsGET /football/players/{player_id}/stats?season_id={season_id}Goals, assists, minutes, cards, grouped stats
Team statsGET /football/teams/{team_id}/stats?season_id={season_id}Position, points, form, goal difference
Pre-match oddsGET /football/matches/{match_id}/odds1X2, BTTS, totals, corners, Asian handicap
Live oddsGET /football/matches/{match_id}/odds/liveUse 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

  1. Call GET /football/competitions?search=Major League Soccer.
  2. Store the returned competition ID.
  3. Call GET /football/competitions/{competition_id}/seasons.
  4. Pick the season where is_current is true.
  5. Call GET /football/matches?competition_id={competition_id}&season_id={season_id}.
  6. Render home team, away team, score, status, UTC date, and match ID.

Player tracker

  1. Search players with GET /football/players?search={name}.
  2. Let the user select a player.
  3. Fetch season stats with GET /football/players/{player_id}/stats?season_id={season_id}.
  4. Show appearances, starts, minutes, goals, assists, cards, shots, and grouped stats where available.

Soccer betting dashboard

  1. Fetch upcoming fixtures with GET /football/matches.
  2. Check whether odds are available on the match.
  3. Fetch pre-match odds with GET /football/matches/{match_id}/odds.
  4. Join odds to match stats and team stats for context.
  5. Use live odds only when live_odds_available is 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.

PlanPriceRequests/monthRate limit
Starter$50/mo100,00030/min
Growth$129/mo500,00060/min
Scale$379/mo5,000,000300/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:

  1. Check coverage for MLS and the competitions you need.
  2. Try a request in the API tester.
  3. Generate an implementation prompt with Build with AI.
  4. Give your coding agent API llms.txt.
  5. 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.

Start building today

Ready to Power Your Sports App?

Start your 7-day free trial. All endpoints included on every plan.

Cancel anytime
7-day free trial
Setup in 5 minutes