Skip to main content

Overview

The Ranking endpoints provide access to Premier League standings with comprehensive team statistics. Data can be retrieved in JSON format or exported as CSV, JSON, or PDF files.

Get League Standings

curl "http://localhost:5000/ranking?season=2023-2024&league=Premier%20League"
Retrieve detailed league standings with comprehensive team statistics.

Query Parameters

season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)Defaults to current season if not specified.
header
string
Include additional metadata in the response.When provided, wraps the standings data under this key.
league
string
default:"Premier League"
Filter results by league name.Supported values: Premier League, La Liga, Serie A, Ligue 1, Bundesliga

Response

response
object
League standings with detailed team statistics
{
  "2023-2024 Premier League Standings": [
    {
      "Pos": "1",
      "Team": "Liverpool",
      "Pld": "38",
      "W": "28",
      "D": "8",
      "L": "2",
      "GF": "86",
      "GA": "41",
      "GD": "+45",
      "Pts": "92"
    },
    {
      "Pos": "2",
      "Team": "Manchester City",
      "Pld": "38",
      "W": "27",
      "D": "7",
      "L": "4",
      "GF": "96",
      "GA": "34",
      "GD": "+62",
      "Pts": "88"
    },
    {
      "Pos": "3",
      "Team": "Arsenal",
      "Pld": "38",
      "W": "26",
      "D": "6",
      "L": "6",
      "GF": "91",
      "GA": "29",
      "GD": "+62",
      "Pts": "84"
    }
  ]
}

Get Simplified Standings Table

curl "http://localhost:5000/ranking/table?season=2023-2024&league=Premier%20League"
Retrieve a streamlined version of the league table focused on essential statistics.

Query Parameters

season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)Defaults to current season if not specified.
league
string
default:"Premier League"
Filter results by league name.Supported values: Premier League, La Liga, Serie A, Ligue 1, Bundesliga

Response

response
array
Array of team standings with basic statistics
[
  {
    "Pos": "1",
    "Team": "Liverpool",
    "Pld": "38",
    "W": "28",
    "D": "8",
    "L": "2",
    "GF": "86",
    "GA": "41",
    "GD": "+45",
    "Pts": "92"
  },
  {
    "Pos": "2",
    "Team": "Manchester City",
    "Pld": "38",
    "W": "27",
    "D": "7",
    "L": "4",
    "GF": "96",
    "GA": "34",
    "GD": "+62",
    "Pts": "88"
  }
]

Export Standings to CSV

curl "http://localhost:5000/ranking/csv_file?filename=standings&season=2023-2024&league=Premier%20League" \
  -o standings.csv
Export league standings to a CSV file.

Query Parameters

filename
string
required
Name for the exported file (without extension).The filename will be sanitized for security. Special characters and path separators will be removed.
season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
CSV file download with text/csv MIME type.The file contains the complete league table with columns: Pos, Team, Pld, W, D, L, GF, GA, GD, Pts

Error Responses

{
  "error": "Missing filename parameter"
}

Export Standings to JSON

curl "http://localhost:5000/ranking/json_file?filename=standings&season=2023-2024&league=Premier%20League" \
  -o standings.json
Export league standings to a JSON file.

Query Parameters

filename
string
required
Name for the exported file (without extension).The filename will be sanitized for security. Special characters and path separators will be removed.
season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
JSON file download with application/json MIME type.The file contains the complete league table with detailed team statistics.

Error Responses

{
  "error": "Missing filename parameter"
}

Export Standings to PDF

curl "http://localhost:5000/ranking/pdf_file?filename=standings&season=2023-2024&league=Premier%20League" \
  -o standings.pdf
Export league standings to a formatted PDF file.

Query Parameters

filename
string
required
Name for the exported file (without extension).The filename will be sanitized for security. Special characters and path separators will be removed.
season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
PDF file download with application/pdf MIME type.The file contains the complete league table in a formatted, printable layout.

Error Responses

{
  "error": "Missing filename parameter"
}

Build docs developers (and LLMs) love