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 endpoint returns the full league table organised by group, together with a cross-group ranking of fourth-placed teams used to determine playoff qualification. Results are served from a Redis cache that is valid for one hour and is invalidated automatically whenever a match is marked as finished.

Endpoint

Method: GET
Path: /standings
Auth: None

Query parameters

season_id
number
Season to fetch standings for. When omitted, the currently active season is used.

Caching

Responses are cached in Redis for 3,600 seconds (1 hour). The cache key is standings for the active season or standings:<season_id> when a season ID is specified. The cache is invalidated automatically after any match in that season is finalised.

Response

groups
object
A map where each key is a group name (e.g. "Grupo A") and the value is an ordered array of team objects sorted by the competition tiebreaker rules.
bestFourthId
number | null
ID of the best-ranked fourth-placed team across all groups, used to fill a knockout playoff slot. null if no fourth places exist.
fourthPlacesRanking
object[]
Ordered array of all fourth-placed teams ranked against each other by the competition tiebreaker criteria. Each entry has the same fields as the team objects inside groups, adjusted to exclude matches against teams that did not exist in groups with fewer sides.

Tiebreaker rules

When teams are level on points the server applies the following criteria in order:
  1. Head-to-head points in matches between the tied teams.
  2. Overall goal difference.
  3. Goals scored.
  4. Goals conceded (fewer is better).
  5. Fair-play score (yellow_cards + red_cards × 3, lower is better).
  6. Database ID (descending) as the final deterministic tiebreaker.
For groups with more teams than the minimum group size, the result against the last-placed team is discounted when computing the fourth-place cross-group ranking.

Example

curl "https://api.futsalmanager.example/standings?season_id=3"
Response
{
  "groups": {
    "Grupo A": [
      {
        "id": 7,
        "team_name": "Atlético Norte",
        "team_logo": "https://res.cloudinary.com/example/image/upload/teams/atletico.png",
        "points": 18,
        "played": 6,
        "won": 6,
        "drawn": 0,
        "lost": 0,
        "goals_for": 28,
        "goals_against": 9,
        "goal_difference": 19,
        "yellow_cards": 4,
        "red_cards": 0
      }
    ],
    "Grupo B": []
  },
  "bestFourthId": 12,
  "fourthPlacesRanking": [
    {
      "id": 12,
      "team_name": "Deportivo Sur",
      "points": 7,
      "played": 5,
      "won": 2,
      "drawn": 1,
      "lost": 2,
      "goals_for": 11,
      "goals_against": 10,
      "goal_difference": 1,
      "yellow_cards": 2,
      "red_cards": 1
    }
  ]
}

Build docs developers (and LLMs) love