Symptom:/api/match/{matchId}/statistics returns empty or minimal dataCause: Statistics are only populated during and after a match. Pre-match requests return empty objects. Additionally, stat types with zero values are omitted to reduce response size.Solution: Always check if the data exists before accessing:
const response = await fetch( 'https://v2.football.sportsapipro.com/api/match/12345678/statistics', { headers: { 'x-api-key': 'YOUR_API_KEY' } });const data = await response.json();// Safe way to extract statisticsconst stats = data?.statistics || [];// Check if match has statistics availableif (stats.length === 0) { console.log('Statistics not yet available — match may not have started.');}
Statistics are populated live during matches and finalized post-match. Pre-match requests will return empty data — this is expected behavior.
Symptom:/api/tournaments/{tournamentId}/seasons/{seasonId}/top-players returns empty dataCause: The tournament/season combination doesn’t have player ranking data available. This occurs for leagues outside the Premium and Full coverage tiers, or for cup competitions.Solution:
Use /top-players only for major league competitions
Verify you have the correct tournamentId and seasonId:
// Step 1: Get available seasons for a tournamentconst seasons = await fetch( 'https://v2.football.sportsapipro.com/api/tournaments/7/seasons', { headers: { 'x-api-key': 'YOUR_API_KEY' } }).then(r => r.json());// Step 2: Use the latest season IDconst latestSeason = seasons.seasons[0];// Step 3: Fetch top players with valid IDsconst topPlayers = await fetch( `https://v2.football.sportsapipro.com/api/tournament/7/season/${latestSeason.id}/top-players`, { headers: { 'x-api-key': 'YOUR_API_KEY' } }).then(r => r.json());
Symptom:/api/match/{matchId}/lineups returns fewer stats than expected (e.g., no xG, limited passing data)Cause: Standard coverage leagues only include basic statistics. Detailed metrics like xG, tackles, and interceptions are only available for Premium tier competitions.Solution: For detailed metrics, query matches from Premium Coverage competitions:
// Premium tier competitions have 40+ stat typesconst premiumTournaments = [7, 11, 17, 25, 35, 572, 573];// Check if the match's tournament is premium before expecting detailed dataconst matchDetails = await fetch( 'https://v2.football.sportsapipro.com/api/match/12345678', { headers: { 'x-api-key': 'YOUR_API_KEY' } }).then(r => r.json());const tournamentId = matchDetails?.event?.tournament?.uniqueTournament?.id;const hasDetailedStats = premiumTournaments.includes(tournamentId);if (hasDetailedStats) { // Fetch detailed lineups — will include xG, tackles, interceptions, etc. const lineups = await fetch( 'https://v2.football.sportsapipro.com/api/match/12345678/lineups', { headers: { 'x-api-key': 'YOUR_API_KEY' } } ).then(r => r.json());}
Data completeness varies by competition tier due to upstream data provider coverage:
Tier
Example Competitions
Available Data
Premium
Premier League, La Liga, Champions League
40+ player metrics, xG, shotmaps, AI insights
Full
Eredivisie, Turkish Süper Lig, MLS
20+ metrics, basic xG, top player rankings
Standard
Greek Super League, lower domestic leagues
Basic stats, scores, lineups
Basic
Minor divisions, friendlies
Scores and key events only
Cup vs League Competitions: The /api/tournament/{id}/season/{seasonId}/top-players endpoint returns player rankings only for league competitions (seasonal cumulative stats). Cup competitions like Champions League, FA Cup, Copa del Rey may return empty results — use /api/match/{matchId}/lineups for match-level stats instead.
See our API Reference Overview for a complete breakdown of available endpoints and sports coverage.