Skip to main content

Documentation Index

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

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

The Standings API provides the group-stage classification table for any season. Results are sorted using the official tie-breaking sequence: head-to-head points → overall goal difference → goals scored → goals conceded → disciplinary points. When groups have unequal sizes, fourth-placed teams are ranked across groups using adjusted statistics (the result against the last-placed team is excluded) to determine which fourth place advances to the knockout bracket.

Get standings

GET /standings Returns the sorted group tables, the ID of the best fourth-placed team (used to seed the knockout draw), and the full ranking of all fourth-placed teams.
season_id
number
Season to retrieve. Defaults to the currently active season when omitted.
Response
groups
object
Keys are group names (e.g. "Grupo A"). Each value is an array of team standing objects sorted by classification position.
bestFourthId
number | null
ID of the top-ranked fourth-placed team across all groups. null if no group has reached four teams.
fourthPlacesRanking
array
Ranked list of all fourth-placed teams, using adjusted statistics for cross-group comparison.
Standings are cached in Redis for 1 hour. The cache is invalidated automatically when a match is finalized via PUT /matches/:id/finish.
Example curl
curl "https://api.example.com/standings?season_id=2"
Example response
{
  "groups": {
    "Grupo A": [
      {
        "id": 3,
        "group_id": 1,
        "group_name": "Grupo A",
        "team_name": "FC Rayo",
        "team_logo": "https://res.cloudinary.com/example/rayo.webp",
        "points": 12,
        "played": 4,
        "won": 4,
        "drawn": 0,
        "lost": 0,
        "goals_for": 18,
        "goals_against": 5,
        "goal_difference": 13,
        "yellow_cards": 2,
        "red_cards": 0
      },
      {
        "id": 7,
        "group_id": 1,
        "group_name": "Grupo A",
        "team_name": "Atlético Sur",
        "team_logo": "https://res.cloudinary.com/example/atletico.webp",
        "points": 9,
        "played": 4,
        "won": 3,
        "drawn": 0,
        "lost": 1,
        "goals_for": 12,
        "goals_against": 8,
        "goal_difference": 4,
        "yellow_cards": 5,
        "red_cards": 1
      }
    ],
    "Grupo B": [
      {
        "id": 11,
        "group_id": 2,
        "group_name": "Grupo B",
        "team_name": "Deportivo Norte",
        "team_logo": null,
        "points": 10,
        "played": 4,
        "won": 3,
        "drawn": 1,
        "lost": 0,
        "goals_for": 15,
        "goals_against": 6,
        "goal_difference": 9,
        "yellow_cards": 1,
        "red_cards": 0
      }
    ]
  },
  "bestFourthId": 22,
  "fourthPlacesRanking": [
    {
      "id": 22,
      "group_name": "Grupo B",
      "team_name": "Velocidad FC",
      "points": 4,
      "played": 3,
      "won": 1,
      "drawn": 1,
      "lost": 1,
      "goals_for": 5,
      "goals_against": 6,
      "goal_difference": -1,
      "yellow_cards": 3,
      "red_cards": 0
    }
  ]
}

Tie-breaking rules

When two or more teams are level on points, the API applies the following sequence:
  1. Head-to-head points between the tied teams.
  2. Overall goal difference (when more than two teams are tied, head-to-head goal difference is used instead).
  3. Goals scored.
  4. Goals conceded (fewer is better).
  5. Disciplinary points — calculated as yellow_cards + red_cards × 3 (fewer is better).
  6. Team ID as a final deterministic tiebreaker.
The fourth-place cross-group ranking uses the same sort function but first strips the result against the bottom-placed team in any group that has more teams than the smallest group, ensuring a fair comparison.

Build docs developers (and LLMs) love