Skip to main content

Overview

The Player endpoints provide access to Premier League player statistics, including goals scored and assists provided. Data can be retrieved in JSON format or exported as CSV/JSON files.

Get Top Goalscorers

curl "http://localhost:5000/players/goals?season=2023-2024&limit=10&league=Premier%20League"
Retrieve a list of top goalscorers with detailed statistics.

Query Parameters

season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)Defaults to current season if not specified.
limit
integer
Maximum number of results to return.Must be a positive integer. If not specified, returns all available results.
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 player objects with goal scoring statistics
[
  {
    "Name": "Erling Haaland",
    "Country": "Norway",
    "Club": "Manchester City",
    "Goals": "27",
    "In Play Goals+Penalty": "21+6"
  },
  {
    "Name": "Cole Palmer",
    "Country": "England",
    "Club": "Chelsea",
    "Goals": "22",
    "In Play Goals+Penalty": "13+9"
  },
  {
    "Name": "Alexander Isak",
    "Country": "Sweden",
    "Club": "Newcastle United",
    "Goals": "21",
    "In Play Goals+Penalty": "19+2"
  }
]

Get Top Assist Providers

curl "http://localhost:5000/players/assists?season=2023-2024&limit=10&league=Premier%20League"
Retrieve a list of top assist providers with detailed statistics.

Query Parameters

season
string
Filter results by season. Format: YYYY-YYYY (e.g., 2023-2024)Defaults to current season if not specified.
limit
integer
Maximum number of results to return.Must be a positive integer. If not specified, returns all available results.
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 player objects with assist statistics
[
  {
    "Name": "Cole Palmer",
    "Country": "England",
    "Club": "Chelsea",
    "Assists": "11"
  },
  {
    "Name": "Bukayo Saka",
    "Country": "England",
    "Club": "Arsenal",
    "Assists": "10"
  },
  {
    "Name": "Mohamed Salah",
    "Country": "Egypt",
    "Club": "Liverpool",
    "Assists": "10"
  }
]

Export Goalscorers to CSV

curl "http://localhost:5000/players/goals/csv_file?filename=top_scorers&season=2023-2024&limit=20&header=Top%20Scorers" \
  -o top_scorers.csv
Export top goalscorers data 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)
limit
integer
Maximum number of results to include in the export.
header
string
Include a header row in the CSV file with this text.
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
CSV file download with text/csv MIME type.The file contains player statistics with columns: Name, Country, Club, Goals, In Play Goals+Penalty

Error Responses

{
  "error": "Missing filename parameter"
}

Export Assists to CSV

curl "http://localhost:5000/players/assists/csv_file?filename=top_assists&season=2023-2024&limit=20&header=Top%20Assists" \
  -o top_assists.csv
Export top assist providers data 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)
limit
integer
Maximum number of results to include in the export.
header
string
Include a header row in the CSV file with this text.
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
CSV file download with text/csv MIME type.The file contains player statistics with columns: Name, Country, Club, Assists

Error Responses

{
  "error": "Missing filename parameter"
}

Export Goalscorers to JSON

curl "http://localhost:5000/players/goals/json_file?filename=top_scorers&season=2023-2024&limit=20" \
  -o top_scorers.json
Export top goalscorers data 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)
limit
integer
Maximum number of results to include in the export.
header
string
Include metadata in the JSON file with this key.
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
JSON file download with application/json MIME type.The file contains an array of player objects with goal statistics.

Error Responses

{
  "error": "Missing filename parameter"
}

Export Assists to JSON

curl "http://localhost:5000/players/assists/json_file?filename=top_assists&season=2023-2024&limit=20" \
  -o top_assists.json
Export top assist providers data 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)
limit
integer
Maximum number of results to include in the export.
header
string
Include metadata in the JSON file with this key.
league
string
default:"Premier League"
Filter results by league name.

Response

file
file
JSON file download with application/json MIME type.The file contains an array of player objects with assist statistics.

Error Responses

{
  "error": "Missing filename parameter"
}

Build docs developers (and LLMs) love