Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Danielsl4/TFG_DAM_2526_Consulta/llms.txt

Use this file to discover all available pages before exploring further.

The standings and statistics endpoints expose all competition data derived from finished matches: group-stage tables, season-wide totals, individual and team rankings, and the match-prediction leaderboard.

GET /standings

Returns the group-stage standings table for a season. Results are cached in Redis for one hour and invalidated automatically when a match is finished. The response includes:
  • A groups map keyed by group name, each containing an array of teams sorted by the tiebreaker rules (head-to-head points → head-to-head goal difference → overall goal difference → goals scored → goals conceded).
  • A fourthPlacesRanking array that compares the best fourth-placed teams across groups using equalised statistics (the result against the last-placed team in the group is excluded where groups have unequal sizes).
  • bestFourthId — the identifier of the best fourth-placed team overall.
season_id
number
Season to fetch standings for. Defaults to the currently active season when omitted.
cURL
curl "http://localhost:3000/standings?season_id=3"

Response fields

groups
object
Map of group name → ordered array of team standing rows.
bestFourthId
number | null
Identifier of the best fourth-placed team, used to highlight the playoff qualifier. null when fewer than four groups exist.
fourthPlacesRanking
object[]
Ranked array of fourth-placed teams with equalised statistics for cross-group comparison.

GET /statistics

Returns global season statistics, team rankings, and individual player rankings. Defaults to the active season when season_id is omitted.
season_id
number
Season to compute statistics for. Defaults to the active season.
cURL
curl "http://localhost:3000/statistics?season_id=3"

Response fields

global
object
Aggregated stats across all finished matches in the season.
teamRankings
object
Each property is an array of up to 5 teams sorted by the respective criterion.Each team entry contains id, name, logo_url, won, lost, drawn, goals_for, and goals_against.
individualRankings
object
Each property is an array of up to 5 players.Each player entry contains id, name, photo_url, team_name, and value (the counted stat).

GET /statistics/user-ranking

Returns the top 10 users ranked by prediction points for a season. Only accounts with the user role are included.
season_id
number
Season identifier. Defaults to the active season.
cURL
curl "http://localhost:3000/statistics/user-ranking?season_id=3"
id
number
User identifier.
username
string
Username.
points
number
Prediction points earned in the season. 0 if the user has not voted on any finished matches.

GET /statistics/user-stats

Returns the authenticated user’s prediction summary for a season: their total points, global rank, and a history of their last 20 votes. Requires authentication.
season_id
number
Season identifier. Defaults to the active season.
cURL
curl "http://localhost:3000/statistics/user-stats?season_id=3" \
  -H "Authorization: Bearer <token>"
totalPoints
number
Total prediction points earned by the user in the season.
globalRank
number
User’s rank among all users with points in the season. 0 if the user has no points record.
history
object[]
Up to 20 most recent votes in the season, ordered by match date descending.

Build docs developers (and LLMs) love