Fantasy Premier League API Endpoints: A Detailed Guide
A detailed guide to all currently available Fantasy Premier League API endpoints.
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/
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.
- game_settings: The game settings and rules. (not important)
- phases: Phases of FPL season. (not really important)
- teams: Basic information of current Premier League clubs.
- total_players: Total FPL players.
- elements: Information of all Premier League players including points, status, value, match stats (goals, assists, etc.), ICT index, etc.
- 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/
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).
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/
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:
- history: A list of player’s previous fixtures and its match stats.
- history_past: A list of player’s previous seasons and its seasonal stats.
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/
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.
- 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 🙏)
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.
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.
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/
This endpoint returns a manager’s data from previous Gameweeks (current), previous seasons (past), and chips that already used during this season.
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.
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.
- chips: A list of chips that you have/haven’t used.
- transfers: Your team’s last transfer information.
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.
- 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.