Premier League API
This is an unofficial Premier League API client for pulling player stats, fixtures, tables, and results data from the Premier League. The API is built using Flask, and the data is scraped from the Premier League website.
API Endpoints
The application provides the following API endpoints:
GET /players/{player_name}
This endpoint retrieves information about a Premier League player with the given name. The player name should be provided as a URL parameter.
The API returns a JSON object with the following structure:
[
{
'name': name,
'position': position,
'club': club,
'key_stats': basic_stats,
'Nationality': nationality,
'Date of Birth': dob,
'height':height,
'complete stats': all_stats
}
]
GET /table
The JSON object contains an array of strings, where each string represents a team's position, name, number of games played, wins, draws, losses, goal difference, and total points.
The API returns a JSON object with the following structure:
[ { Played Won Draw Lost Goal Differnece Total Points } ]
GET /fixtures/{team_name}
This endpoint retrieves information about the next Three Premier League fixtures of the team. The team name should be provided as a URL parameter.
The API returns a JSON object with the following structure:
[ { "Team A vs Team B DD/MM/YYYY HH:MM", "Team A vs Team C DD/MM/YYYY HH:MM", "Team A vs Team D DD/MM/YYYY HH:MM"} ]
Follow the following instructions to run the application and start using the api in your local pc Setup Details
$ pip install -r requirements.txt
Individual PLayer PL Stats
- Example: Stats of Cristiano Ronaldo | One can use the common name of the Players as well to retrive the data