Fantasy Football API - Player Stats, Match Data & Season History
The fantasy football API developers use for scoring engines, player trackers, and multi-league platforms. Goals, assists, cards, minutes, xG across 80 competitions. 7-day free trial.
Fantasy football apps live and die by data. If your player stats are incomplete, your scoring engine is unreliable. If your coverage stops at the top five leagues, you are leaving users behind. TheStatsAPI gives you the foundation to build a fantasy football platform that actually works - 84,000+ players, 80 competitions (with up to 1,196 available on request), 10 years of history, and every endpoint available on every plan.
What Data Do Fantasy Apps Need?
Every fantasy football platform relies on the same core data points to calculate player scores and rankings:
- Goals and assists - the backbone of any scoring system
- Appearances and minutes played - for eligibility rules and consistency metrics
- Yellow and red cards - negative scoring events most platforms track
- Shots and shots on target - used in advanced scoring models
- Clean sheets - essential for defender and goalkeeper scoring
- Team squad data - to map players to clubs and handle transfers
TheStatsAPI delivers all of these through a clean REST API with consistent JSON responses. No feature gating, no hidden tiers. You get every data point on every plan.
Key Endpoints for Fantasy
Three endpoints do the heavy lifting for most fantasy football apps.
Player Season Stats
GET https://api.thestatsapi.com/api/football/players/{id}/stats?season_id={season_id}
Returns a player's aggregated statistics for a season. The season_id parameter is required (e.g. sn_7598). Stats are organized into categories. This is your primary endpoint for scoring calculations and player rankings.
Sample response:
{
"data": {
"player_id": "pl_61928103",
"season_id": "sn_6125938",
"team_id": "tm_3039",
"position": "ST",
"rating": 7.02,
"appearances": 29,
"starts": 21,
"minutes_played": 2418,
"scoring": {
"goals": 22,
"assists": 7,
"goal_conversion_percentage": 21.6
},
"shooting": {
"total_shots": 102,
"shots_on_target": 49
},
"discipline": {
"yellow_cards": 1,
"red_cards": 0
}
}
}
Match Player Stats
GET https://api.thestatsapi.com/api/football/matches/{id}/player-stats
Returns individual player statistics for a specific match. Use this to award points per match and build scoring updates after each fixture.
Team Players
GET https://api.thestatsapi.com/api/football/teams/{team_id}/players
Returns the full squad for a team, with extended profile fields per player. Use this to populate your player pool, assign positions, and track squad changes throughout the season.
Why TheStatsAPI for Fantasy
- 84,000+ players across 80 competitions (with up to 1,196 available on request). Your fantasy platform can cover far more than the Premier League. Liga MX, the A-League, K League - the data is there.
- 10 years of historical data. Build pre-season projections and trend analysis using a decade of player and match statistics, not just last season.
- 80 competitions worldwide, expandable to 1,196 on request. Support niche leagues that other fantasy apps ignore. That is a differentiation opportunity, not a footnote.
- Clean REST JSON with flat pricing. Every endpoint is available on every plan. You will never discover mid-build that the data you need is locked behind a higher tier.
Code Example: Fetch Player Stats in Python
import requests
API_KEY = "your_api_key"
BASE_URL = "https://api.thestatsapi.com/api"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Fetch stats for a specific player
# Find player_id via /football/players?search=Haaland
# Find season_id via /football/competitions/{competition_id}/seasons
player_id = "pl_61928103" # Haaland
season_id = "sn_6125938" # 2024-25 season
response = requests.get(
f"{BASE_URL}/football/players/{player_id}/stats",
headers=headers,
params={"season_id": season_id}
)
stats = response.json()["data"]
scoring = stats["scoring"]
print(f"Goals: {scoring['goals']}, Assists: {scoring['assists']}")
print(f"Appearances: {stats['appearances']}, Minutes: {stats['minutes_played']}")
That is all it takes. No SDK required, no complex authentication flow. A single Bearer token and standard HTTP requests.
Pricing
Most fantasy football apps fit comfortably on the Starter plan at $50/month - 100,000 requests with 30 requests per minute. That is enough to sync player stats daily across dozens of leagues.
| 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. No feature gating.
If your fantasy app grows beyond 100k requests, the Growth plan at $129/month gives you 5x the volume. The Scale plan is there for platforms serving thousands of active users with frequent polling.
FAQ
Does the API include the player stats I need for fantasy scoring?
Yes. The /football/players/{id}/stats endpoint returns stats organized into categories: scoring (goals, assists), shooting (shots, shots on target), passing, defending, duels, and discipline (yellow cards, red cards). Top-level fields include appearances, starts, and minutes played. These cover the scoring categories used by virtually every fantasy football platform.
Does the API include second-yellow red cards?
The player stats response includes yellow card and red card totals. If your scoring rules need to distinguish a straight red from a second-yellow red card, use the match event feed alongside player stats so your scoring engine can inspect the card sequence before finalizing points.
How often is the data updated?
TheStatsAPI provides realtime odds and match stats for supported live fixtures. Fantasy scoring and player season aggregates should use the finalized data, which is verified after full time and typically settles within 1-2 hours of the final whistle.
Which leagues and competitions are covered?
80 competitions across 100+ countries by default, with access to up to 1,196 competitions available on request. That includes every major European league (Premier League, La Liga, Bundesliga, Serie A, Ligue 1), continental tournaments (Champions League, Europa League, Copa Libertadores), and hundreds of second-tier and regional leagues worldwide.
Can I use the data commercially in my fantasy app?
Yes. All plans support commercial use. There are no separate licensing fees or usage restrictions beyond your plan's request limits. Build your product and ship it.
Ready to Power Your Sports App?
Start your 7-day free trial. All endpoints included on every plan.