top of page

 

Updates

 

May 28, 2021

  • Updated for 2020/2021 season.

August 12, 2020

  • Updated to include additional gameweeks. 

August 2, 2020

  • Due to covid-19, an additional 9 gameweeks were added to the FPL database, which resulted in the excel sheet formatting being out of order. I am in the process of updating the code and it will be ready soon. 

  • Stay Safe.

May 24, 2019

  • Updated to version 2.0

  • Support for 2019 - 2020 Season

  • Added Percentile Gameweek Rank and Percentile Overall Rank Columns. 

FPL Data Fetcher 

 

Click here to go to the github page to download. Instructions below.

With over 5 million players, Fantasy Premier League is the biggest Fantasy Football game in the world. It’s FREE to play and you can win great prizes!  Start playing now at  https://fantasy.premierleague.com/

I follow the English premier league religiously and playing fantasy football is one of my favorite hobbies. Every season millions of players participate in this exciting contest and there are multiple prizes and bragging points to gain throughout the season.

Archiving your season's data is a popular thing among many fpl players. With the amount of detail involved in each team, doing this manually is a very tedious process. So I decided to write a script in Python 3, which does this automatically.

This is my first 'serious' script in Python. I started learning it recently and decided this would be a great opportunity to test my skills in the software. I'm aware there is a possibility something like this already exists considering the number of 3rd party statistics sites available. But I wanted to make my own script, and decided to compile it into a windows application to make it easy for those who don't have access to Python. 

That said, you can also use the raw code and play with it. The project 'design' is up on my github. You can view it here.

The Excel sheet is color coded. The default colors are good, but you can make it even prettier by customizing your own like I did. 

How to use the application

Prerequisites

  • Make sure you are using this application after the season ends. There is some data that can only be fetched at the end of the season. You can try it closer to the end, but I recommend just waiting. You have from the end of May till mid-July (If I'm not wrong)

  • A Windows based system. This WILL NOT work on Mac OS. Apologies. 

  • However, you should be able to open the excel file in Sheets or Mac's built in viewer. 

  • A zip file extractor. Windows has a built in extractor but I recommend something like 7-zip.

  • Your Fantasy Premier League ID. You can find this on the web address when you go to your 'Points' page. 

  • An internet connection. 

Using the application

  • Download the zip folder 'FPLDataFetcherx32' from the above link or from the github page here. Make sure to get the file from 'assets' section.

  • Extract the folder using a zip file extractor.

  • Scroll down and launch the file FPLDataFetcher.exe

  • You should be greeted with a window with the premier league logo and a text box where you can enter your fpl ID.

  • Enter your fpl ID, and click Submit.

  • This will take some time depending on your internet connection, the application won't respond during this time.

  • After it is done, it will display the location of your file. 

  • Done!

 

Under the hood

To put it in very simple terms, the application takes data from the fpl website using json and imports it to an excel spreadsheet. 

View the project on Github​.

Modules Used.

  • tkinter - for GUI

  • openpyxl - to write the imported data to excel workbook

  • requests - to fetch json data from FPL website

  • os - to show the path of the created excel file

  • I've also used urlopen and base64 to read the FPL logo off of an imgur link to place it in the GUI

Here is the list of data imported from the website

  • Gameweek Score

  • Gameweek Average Score

  • Points Benched

  • Transfers Made for GW

  • Transfer Cost

  • Gameweek Rank

  • Overall Points

  • Overall Rank

  • Percentile GW Rank (v2.0 and up)

  • Percentile Overall Rank (v2.0 and up)

  • Position in overall leaderboard

  • Team Value

  • Weekly Squad with captain and vice captain selections highlighted

  • Individual player scores for each GW

  • Chips used and when

  • Complete transfer history with player values

  • FPL Cup History

  • Classic League Ranks

  • H2H Ranks

  • Weekly Dream Team with Scores

  • Final Dream Team

JSON links used

bottom of page