Open in app
Sign up

Sign in



Fantasy Premier League API Endpoints: A Detailed Guide
A detailed guide to all currently available Fantasy Premier League API endpoints.
Frenzel Timothy
Frenzel Timothy

·
Follow

8 min read
·
Oct 8, 2020

Listen


Share


We all know that Fantasy Premier League (FPL) is a game which is heavily based on data. Some of the you might also know that there is some API endpoints that we could use to get data about players, points, fixtures, leagues, etc. In this article I will explain about each endpoints I have used to get all those information.

I’m using Postman to make the API call and retrieve the responses. This tool pretty much helps me because of its pretty JSON formatting, ability to expand or collapse a JSON element, and to create a collection of API calls.

For every API endpoints, they use https://fantasy.premierleague.com/api/ as the base URL then followed by the endpoint path. Now I’m gonna show you the available endpoints:

1. General Information
Endpoint path: bootstrap-static/
Full URL: https://fantasy.premierleague.com/api/bootstrap-static/

JSON response of https://fantasy.premierleague.com/api/bootstrap-static/
JSON response of bootstrap-static endpoint
This endpoint returns general information about the FPL game divided into these sections:

events: Basic information of every Gameweek such as average score, highest score, top scoring player, most captained, etc.
JSON structure of events
JSON structure of events
game_settings: The game settings and rules. (not important)
phases: Phases of FPL season. (not really important)
JSON structure of phases
JSON structure of phases
teams: Basic information of current Premier League clubs.
JSON structure of teams
JSON structure of teams
total_players: Total FPL players.
elements: Information of all Premier League players including points, status, value, match stats (goals, assists, etc.), ICT index, etc.
JSON structure of elements (part 1)
JSON structure of elements (part 1)
JSON structure of elements (part 2)
JSON structure of elements (part 2)
element_types: Basic information about player’s position (GK, DEF, MID, FWD).
2. Fixtures
Endpoint path: fixtures/
Full URL: https://fantasy.premierleague.com/api/fixtures/

A JSON object inside of fixtures response
A JSON object inside of fixtures response
This endpoint returns a JSON array which contains every fixture of the season. To get fixtures for specific Gameweek, you can add a parameter after the endpoint path (ex: fixtures?event=7). You can also request only the upcoming fixtures using future parameter (ex: fixtures?future=1). If you set the future value to 0, you will get all fixtures, but if 1 you will only get the upcoming fixtures. I see this parameter as a boolean value (future = true or false).

Now here’s the explanation of some of the JSON elements:

event refers to the event id in events section of the bootstrap-static data.
team_a and team_h refers to the team id in teams section of the bootstrap-static data. team_a for the away team and team_h for the home team.
team_h_difficulty and team_a_difficulty is the FDR value calculated by FPL.
stats contains a list of match facts that affect points of a player. It consists of goals_scored, assists, own_goals, penalties_saved, penalties_missed, yellow_cards, red_cards, saves, bonus, and bps data. The JSON structure can be seen in image below.
value is the amount and element refers to the element id in elements section of the bootstrap-static data. For example, in image below we can see goals_scored data from the away team. These information can be read as: Aubameyang, Lacazette, and Gabriel each scored one goal for the away team (which is Arsenal).
JSON structure of stats
JSON structure of stats
3. Player’s Detailed Data
Endpoint path: element-summary/{element_id}/
Full URL: https://fantasy.premierleague.com/api/element-summary/{element_id}/
Example: https://fantasy.premierleague.com/api/element-summary/4/

JSON response of player’s detail information endpoint
JSON response of player’s detail information endpoint
This endpoint returns a player’s detailed information divided into 3 section:

fixtures: A list of player’s remaining fixtures of the season. Each fixture object consists of these information below:
JSON structure of fixtures
JSON structure of fixtures
history: A list of player’s previous fixtures and its match stats.
JSON structure of history
JSON structure of history
history_past: A list of player’s previous seasons and its seasonal stats.
JSON structure of history_past
JSON structure of history_past
4. Gameweek Live Data
Endpoint path: event/4/live/
Full URL: https://fantasy.premierleague.com/api/event/{event_id}/live/
Example: https://fantasy.premierleague.com/api/event/4/live/

JSON response of live event endpoint
JSON response of live event endpoint
A JSON object of live event response
A JSON object inside of live event response
This endpoint returns a list of players’ information in that specific Gameweek. Each element is divided into three section:

id: Refers to the element id in elements section of the bootstrap-static data.
stats: Player’s match stats including goals, assists, etc.
stats section of an element
stats section of an element
explain: Breakdown of a player’s event points. For example, let’s see from image below (Son Heung-Min’s data in Gameweek 4 match against Manchester United, 2020/21). From image below we can see that Son played 72 minutes, so 2 points given. We can also see that he scored 2 goals which resulted in 10 points, one assist which resulted in 3 points, and 3 bonus points. Overall, he scored a solid 18 points in Gameweek 4. (Sorry for the example United fans and anyone who didn’t start Son that week 🙏)
explain section of an element
explain section of an element
5. Manager/User Basic Information
Endpoint path: entry/{manager_id}/
Full URL: https://fantasy.premierleague.com/api/entry/{manager_id}/
Example: https://fantasy.premierleague.com/api/entry/565066/

You might be wondering: how to get the manager id? The answer is simple. Just go to https://fantasy.premierleague.com, sign in with your account, go to ‘Pick Team’ then ‘View Gameweek history’. You can find your id in the URL, right before the ‘/history’.

Update: If you have been authenticated, you can simply hit https://fantasy.premierleague.com/api/me/ to get your profile information. You can see your manager/team id in entry field.

Now let’s back to the topic.

JSON response of manager endpoint
JSON response of manager endpoint
This endpoint returns manager’s (or FPL user’s) basic information as we can see from image above. Everything’s pretty clear up there, now I’m gonna explain a little bit about the classic section inside the league.

A JSON object of classic league
A JSON object of classic league
From here you can see the leagues that you joined (or someone with id that you use). You can see the league type, your (or the user’s) rank in the league, and the previous rank. For the league type, s is for public league and x is for private league.

6. Manager/User’s History
Endpoint path: entry/{manager_id}/history
Full URL: https://fantasy.premierleague.com/api/entry/{manager_id}/history/
Example: https://fantasy.premierleague.com/api/entry/565066/history/

JSON response of manager history endpoint
JSON response of manager history endpoint
This endpoint returns a manager’s data from previous Gameweeks (current), previous seasons (past), and chips that already used during this season.

Previous gameweek data
Previous Gameweeks data

Previous seasons data
7. Classic League Standings
Endpoint path: leagues-classic/{league_id}/standings
Full URL: https://fantasy.premierleague.com/api/leagues-classic/{league_id}/standings
Example: https://fantasy.premierleague.com/api/leagues-classic/119928/standings

This endpoint returns the classic league standings as we can see from image below. The entry value refers to the manager id, event_total is the event points, and total is the total points. One classic league may contain large amount of members (especially public leagues), so this endpoint might not return the full data. To retrieve more data, you can use a page_standing parameter after the endpoint path (ex: standings?page_standings=2) just like a pagination.

JSON response of classic league standings endpoint
JSON response of classic league standings endpoint
8. My Team (requires authentication)
Endpoint path: api/my-team/{manager_id}/
Full URL: https://fantasy.premierleague.com/api/my-team/{manager_id}/
Example: https://fantasy.premierleague.com/api/my-team/565066/

This API call requires authentication. You can read the FPL API authentication guide here (using Python). This endpoint returns your team information divided into 3 section:

picks: A list of players you have picked in your team.
Picks section of my team response
picks section of my team response
chips: A list of chips that you have/haven’t used.
chips section of my team response
chips section of my team response
transfers: Your team’s last transfer information.
transfers section of my team response
transfers section of my team response
Update 19/10/2021:

9. Manager/User’s Team Per Gameweek
Endpoint path: entry/{manager_id}/event/{event_id}/picks/
Full URL: https://fantasy.premierleague.com/api/entry/{manager_id}/event/{event_id}/picks/
Example: https://fantasy.premierleague.com/api/entry/4791912/event/8/picks/

This is the same API when you open Points section on FPL app or website. Normally, they will show you the latest or currently active Gameweek when you first open the page (for example your team lineup and points for Gameweek 8) but you can track your past gameweeks points just by click the previous button. This is possible because they use this API which contains your id and event id as the query parameters.


This endpoint returns 4 main information: active_chip, automatic_subs, entry_history, and picks.

automatic_subs: This contains an array of players that automatically subbed in if your outfield play didn’t play that Gameweek. Field entry is your id, element_in and element_out is player id who has been subbed in and out, and event refers to the event id.

automatic_subs field
entry_history: This is basically your Gameweek summary.

picks: This is an array of the players you have in your team. Multiplier = 1 if the player is in your field, 0 if in your bench (position 12 to 15), and 2 if it’s your captain (probably becomes 3 if triple captain, I’ll confirm it later).

10. Event Status
Endpoint path: event-status/
Full URL: https://fantasy.premierleague.com/api/event-status/

If you frequently checks your FPL point, you might have noticed that they update some data periodically. For example, they usually update bonus points and league standings once a day in an active matchday. This is the endpoint to confirm that status.


11. Dream Team
Endpoint path: dream-team/{event_id}/
Example: https://fantasy.premierleague.com/api/dream-team/8/

Not really important, but this is a team consists of each Gameweek’s best performer. top_player is the highest scoring player.


12. Set Piece Taker Notes
Endpoint path: team/set-piece-notes/
Full URL: https://fantasy.premierleague.com/api/team/set-piece-notes/

Information of each team’s set piece taker updates or confirmation. id refers to the team_id.


Thank you for staying with me this long and good luck for your FPL team! I will update this post if I found any new endpoints.

498


14

FPL
Fantasy Premier League
API
Rest Api
Json
498


14


Frenzel Timothy
Follow
Written by Frenzel Timothy
45 Followers
·
9 Following
Android Engineer @ Tokopedia

More from Frenzel Timothy
Accessing Fantasy Premier League API from Android App
Frenzel Timothy
Frenzel Timothy

Accessing Fantasy Premier League API from Android App
A little bit tricky but helpful guide to access Fantasy Premier League APIs from Android application. (Yes, it’s tricky but very easy!)
Oct 9, 2020
5
See all from Frenzel Timothy
Recommended from Medium
Python is No More The King of Data Science
Stackademic
In

Stackademic

by

Abdur Rahman

Python is No More The King of Data Science
5 Reasons Why Python is Losing Its Crown

Oct 23
9.2K
35
How I Am Using a Lifetime 100% Free Server
Harendra
Harendra

How I Am Using a Lifetime 100% Free Server
Get a server with 24 GB RAM + 4 CPU + 200 GB Storage + Always Free

Oct 26
6.8K
102
Lists



Coding & Development
11 stories
·
933 saves



Company Offsite Reading List
8 stories
·
171 saves



data science and AI
40 stories
·
296 saves



Natural Language Processing
1850 stories
·
1473 saves
I used OpenAI’s o1 model to develop a trading strategy. It is DESTROYING the market
DataDrivenInvestor
In

DataDrivenInvestor

by

Austin Starks

I used OpenAI’s o1 model to develop a trading strategy. It is DESTROYING the market
It literally took one try. I was shocked.

Sep 15
6.9K
183
Jeff Bezos Says the 1-Hour Rule Makes Him Smarter. New Neuroscience Says He’s Right
Jessica Stillman
Jessica Stillman

Jeff Bezos Says the 1-Hour Rule Makes Him Smarter. New Neuroscience Says He’s Right
Jeff Bezos’s morning routine has long included the one-hour rule. New neuroscience says yours probably should too.

Oct 30
14.7K
350
SQL interview at Google
Harshit Singh
Harshit Singh

SQL interview at Google
SQL question asked in Google interview. This question is published at stratascratch.com

Sep 27
216
7
Most Developers Failed with this Senior-Level Python Interview Question
Programming Domain
In

Programming Domain

by

Shuai Li

Most Developers Failed with this Senior-Level Python Interview Question
What is the difference between [0] * 3 and [0, 0, 0]?

Aug 9
3.6K
54
See more recommendations  ساعطيك هذه الوثائق لتكون مرجع لك ستستخدمها مع بايث او لتصحيح مجموعه سكريبتات ساعطيها لك او ساحتاجك في انشاء مشروع انتظرني