Skip to content

An unofficial api client for pulling player Stats, Fixtures, Tables and Results data from the Premier League

Notifications You must be signed in to change notification settings

tarun7r/Premier-League-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Premier League API 2.0

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, 
          'Nationality': nationality, 
          'Date of Birth': dob,
          'height':height,
          'key_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:

[
      "Position",
      "Team",
      "Played",
      "Wins",
      "Draws",
      "Losses",
      "Goal Difference",
      "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"} ] 

Setup Details

Follow the following instructions to run the application and start using the api in your local pc
  • Clone the repository
  • Open the terminal, navigate to the folder where your clone of this repository is located and type:

    $ pip install -r requirements.txt

  • Type $ python main.py in the terminal and the script will run for as long as you let it.
  • Individual PLayer PL Stats

    • Example: Stats of Cristiano Ronaldo | One can use the common name of the Players as well to retrive the data


    Premier League Table

    • Current Premier League Table


    Premier League Fixtures

    • Fixtures of the Next three weeks


    Update 🚀

    The API has been enhanced with new features and improvements:
    • ✨ Optimized the code for better performance.
    • 🔄 Rebased and updated to ensure compatibility with the latest dependencies.
    You can also search player stats using the player's reference image ( Face Recognition ) as well - Repo 📸

    Disclaimer

    This project is created solely for learning and educational purposes. It is not intended for production-level use or commercial applications

    About

    An unofficial api client for pulling player Stats, Fixtures, Tables and Results data from the Premier League

    Topics

    Resources

    Stars

    Watchers

    Forks

    Languages