Skip to main content
GET
/
athletes
/
trophies
/
stats
Athlete Season Stats
curl --request GET \
  --url https://v1.football.sportsapipro.com/athletes/trophies/stats \
  --header 'x-api-key: <api-key>'
{
  "stats": {
    "columns": [
      {
        "id": "<string>",
        "name": "<string>",
        "type": "<string>"
      }
    ],
    "rows": [
      {
        "season": "<string>",
        "seasonNum": 123,
        "competitionId": 123,
        "competitionName": "<string>",
        "appearances": 123,
        "goals": 123,
        "assists": 123,
        "yellowCards": 123,
        "redCards": 123,
        "minutesPlayed": 123,
        "avgRating": 123
      }
    ]
  },
  "athletes": "<array>",
  "competitions": "<array>"
}

Endpoint

GET https://v1.football.sportsapipro.com/athletes/trophies/stats

Description

Retrieves comprehensive season-by-season statistics for a specific athlete, optionally filtered by competition. This endpoint provides historical performance data essential for career analysis, season comparisons, and statistical breakdowns.
Built-in TTL: 300 seconds (5 minutes). Season statistics are cached longer as they change less frequently.

Parameters

ParameterTypeRequiredDefaultDescription
athleteIdnumberYes-The unique identifier of the athlete
competitionIdnumberYes*-The competition to retrieve stats for
competitionId is effectively required. While technically optional, omitting it will return empty data ("No data available") for most athletes. Always provide a competitionId to get results.
Common competition IDs: Premier League (7), La Liga (104), Serie A (17), Bundesliga (199), Ligue 1 (176), Champions League (572).

Request Examples

# Get stats for athlete in a specific competition
curl -X GET "https://v1.football.sportsapipro.com/athletes/trophies/stats?athleteId=874&competitionId=104" \
  -H "x-api-key: YOUR_API_KEY"

# Get all competition stats for an athlete
curl -X GET "https://v1.football.sportsapipro.com/athletes/trophies/stats?athleteId=874" \
  -H "x-api-key: YOUR_API_KEY"

Response

{
  "lastUpdateId": 5494796687,
  "requestedUpdateId": -1,
  "ttl": 300,
  "stats": {
    "columns": [
      { "id": "season", "name": "Season", "type": "string" },
      { "id": "appearances", "name": "Apps", "type": "number" },
      { "id": "goals", "name": "Goals", "type": "number" },
      { "id": "assists", "name": "Assists", "type": "number" },
      { "id": "yellowCards", "name": "YC", "type": "number" },
      { "id": "redCards", "name": "RC", "type": "number" },
      { "id": "minutesPlayed", "name": "Mins", "type": "number" },
      { "id": "avgRating", "name": "Avg Rating", "type": "number" }
    ],
    "rows": [
      {
        "season": "2024/25",
        "seasonNum": 25,
        "competitionId": 104,
        "competitionName": "La Liga",
        "appearances": 28,
        "goals": 22,
        "assists": 14,
        "yellowCards": 3,
        "redCards": 0,
        "minutesPlayed": 2340,
        "avgRating": 8.2
      },
      {
        "season": "2023/24",
        "seasonNum": 24,
        "competitionId": 104,
        "competitionName": "La Liga",
        "appearances": 35,
        "goals": 26,
        "assists": 16,
        "yellowCards": 5,
        "redCards": 0,
        "minutesPlayed": 2980,
        "avgRating": 8.4
      }
    ]
  },
  "athletes": [...],
  "competitions": [...],
  "sports": [...]
}

Response Fields

Root Object

FieldTypeDescription
lastUpdateIdnumberInternal versioning ID for incremental updates
requestedUpdateIdnumberRequested update ID (-1 = latest)
ttlnumberCache TTL in seconds (300 for this endpoint)
statsobjectStatistics container with columns and rows
athletesarrayAthlete information
competitionsarrayCompetition definitions
sportsarraySport definitions

Stats Object

FieldTypeDescription
columnsarrayColumn definitions for interpreting row data
rowsarraySeason-by-season statistical data

Column Object

FieldTypeDescription
idstringColumn identifier
namestringHuman-readable column name
typestringData type: β€œstring”, β€œnumber”

Row Object (Season Stats)

FieldTypeDescription
seasonstringSeason display name (e.g., β€œ2024/25”)
seasonNumnumberNumeric season identifier
competitionIdnumberCompetition ID
competitionNamestringCompetition name
appearancesnumberTotal appearances
goalsnumberGoals scored
assistsnumberAssists provided
yellowCardsnumberYellow cards received
redCardsnumberRed cards received
minutesPlayednumberTotal minutes played
avgRatingnumberAverage match rating (1.0-10.0)

Use Cases

Career Statistics Table

// Fetch all-time stats across competitions
const response = await fetch(
  `https://v1.football.sportsapipro.com/athletes/trophies/stats?athleteId=874`,
  { headers: { "x-api-key": "YOUR_API_KEY" } }
);

const { stats } = await response.json();

// Render a data table using columns for headers
const headers = stats.columns.map(col => col.name);
const rows = stats.rows.map(row => 
  stats.columns.map(col => row[col.id])
);

Season Comparison Chart

// Compare goal output across seasons
const goalsBySeasonData = stats.rows.map(row => ({
  season: row.season,
  goals: row.goals,
  assists: row.assists
}));

// Use with charting library
<BarChart data={goalsBySeasonData} />

Multi-Competition Career Summary

// Fetch stats for multiple competitions concurrently
const competitionIds = [104, 572, 596]; // La Liga, UCL, Copa del Rey

const statsPromises = competitionIds.map(compId =>
  fetch(`https://v1.football.sportsapipro.com/athletes/trophies/stats?athleteId=874&competitionId=${compId}`, 
    { headers: { "x-api-key": "YOUR_API_KEY" } }
  ).then(r => r.json())
);

const allStats = await Promise.all(statsPromises);

Error Responses

StatusDescription
400Missing required athleteId parameter
401Invalid or missing API key
429Rate limit exceeded
500Internal server error
{
  "error": "Missing required parameter: athleteId"
}

Authorizations

x-api-key
string
header
required

Your SportsAPI Pro API key

Query Parameters

athleteId
integer
required

The unique identifier of the athlete

Example:

874

competitionId
integer

Filter stats to a specific competition

Example:

104

Response

Athlete season statistics retrieved successfully

stats
object
athletes
array
competitions
array