Skip to main content

Documentation Index

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

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

The Standings API returns the live league table for the Futsal League Manager. Standings are organised by competition group and are automatically recalculated every time a match is finalised. Results are cached in Redis for up to one hour; the cache is invalidated immediately when match data changes.

Points system

ResultPoints
Win3
Draw1
Loss0

Tiebreaker order

When two or more teams finish on equal points, the following criteria are applied in order:
  1. Head-to-head points between the tied teams
  2. Overall goal difference (goals_for − goals_against)
  3. Fair-play penalty score (yellow_cards + red_cards × 3), lowest wins
  4. Goals scored
  5. Goals conceded (fewest wins)
  6. Team ID (deterministic fallback)
For groups with more than the minimum number of teams, the fourth-placed team’s record is adjusted to exclude matches against the weakest opponent before being ranked in the cross-group best-fourths comparison.

Get standings

GET /standings
Returns standings grouped by competition group, plus the ranked best-fourths list.

Query parameters

season_id
integer
Season to retrieve standings for. Defaults to the currently active season when omitted.

Response

groups
object
required
A map of group names to sorted arrays of team standing objects.
bestFourthId
integer | null
Team ID of the highest-ranked fourth-place team across all groups. null when no group has four or more teams.
fourthPlacesRanking
object[]
Sorted array of all fourth-place teams with their adjusted stats (excluding matches against the weakest opponent in unequal-size groups). Uses the same standing object shape as the entries in groups.

Example

curl https://api.example.com/standings
curl "https://api.example.com/standings?season_id=3"

Example response

{
  "groups": {
    "Group A": [
      {
        "id": 1,
        "team_name": "FC Example",
        "team_logo": "https://res.cloudinary.com/.../logo.jpg",
        "group_id": 1,
        "group_name": "Group A",
        "played": 5,
        "won": 4,
        "drawn": 0,
        "lost": 1,
        "goals_for": 18,
        "goals_against": 7,
        "goal_difference": 11,
        "points": 12,
        "yellow_cards": 3,
        "red_cards": 0
      }
    ],
    "Group B": []
  },
  "bestFourthId": 9,
  "fourthPlacesRanking": [
    {
      "id": 9,
      "team_name": "Los Rápidos",
      "played": 4,
      "won": 2,
      "drawn": 1,
      "lost": 1,
      "goals_for": 9,
      "goals_against": 6,
      "goal_difference": 3,
      "points": 7,
      "yellow_cards": 1,
      "red_cards": 0
    }
  ]
}

Caching behaviour

Standings responses are cached in Redis under the key standings (or standings:<season_id> for season-scoped requests) with a TTL of 3600 seconds. The cache is invalidated automatically when a match is set to finalizado, so the table always reflects the latest finalised results within one request cycle.
If Redis is unavailable, the API falls back to querying the database directly on every request.

Build docs developers (and LLMs) love