Oliver Looney

Next Post
All blogs
Previous Post
FPL APIs Explained
April 25, 2023
Documentation for how to use FPL (premier league fantasy football) APIs and what endpoints are available


FPL API Explained
Check out FPL Intel:
https://FPLIntel.com

A breakdown of how to use FPL (premier league fantasy football) APIs and what endpoints are available. This blog post is documentation for the publicly available FPL API endpoints and how to use them, because I could not find official documentation or a full list of known endpoints. APIs have a CORS policy so the APIs cannot be called from a front end client. API url: https://fantasy.premierleague.com/api/

Contents:
What do the IDs mean?
How to get your manager_id
How to get your league_id
How to use authenticated endpoints
Endpoints:
General Information
Fixtures
Fixtures on a gameweek
Detailed Data on football players
Data on a given Gameweek
Manager Summary
Manager's History
Manager's Transfers
Manager's Transfers in current Gameweek
Classic League Standings
Head-to-Head League Standings
Manager's Team
Manager's Team on a given Gameweek
Event Status
Dream Team
Set Piece Taker Notes
Manager Data
League Cup Status
Most Valuable Teams
Best Leagues
Example Projects
What do the IDs mean?:
league_id:

This is the id for a league, e.g your mini league, head-to-head leagues or public classic leagues.

manager_id:

This is the id for the manager of a fantasy team. This is for the real users of fpl.

element_id:

This is the id for football players in the premier league.

event_id:

This refers to the gameweek number. There are 38 game weeks in a premier league season.

How to get your manager_id
Log in to https://fantasy.premierleague.com/

img.png

Then click on the points tab, in the url is your manager_id:

img.png

How to get your league_id
Log in to https://fantasy.premierleague.com/

img.png

Then click on the Leagues & Cups tab, and click the league that you want the id of. In the url is that league's league_id:

img.png

How to use authenticated endpoints
Log in to https://fantasy.premierleague.com/

Open inspect element and nvaigate to the network tab. Open the request for 'me/'. On the request there is a header called cookie, this is the authentication token. Right click on this header and copy value.

img.png

In postman, navigate to Headers and enter a new header with the key 'cookie' and for the value paste in token just copied.

img.png

Endpoints:

1 - General Information
Endpoint: bootstrap-static/

Full url: https://fantasy.premierleague.com/api/bootstrap-static/

A summary of the previous game weeks, fpl phases, teams and players.

FPL's game settings are also found here.

img.png

2 - Fixtures
Endpoint: fixtures/

Full url: https://fantasy.premierleague.com/api/fixtures/

Returns an array of fixture objects. If the fixture is a future fixture, only a summary is returned such as teams, kick off time and difficulty for each team.

img.png

For the past fixtures, statistics for the fixture are also returned.

img.png

3 - Fixtures by GameWeek
Endpoint: fixtures/?event={event_id}

Full url: *https://fantasy.premierleague.com/api/fixtures/?event=***{event_id}

Similar to the previous endpoint, this returns specific gameweek fixtures.

Returns an array of fixture objects. If the fixture is a future fixture, only a summary is returned such as teams, kick off time and difficulty for each team. For the past fixtures, statistics for the fixture are also returned.

img.png

4 - Detailed Data on football players
Endpoint: element-summary/{element_id}/

Full url: https://fantasy.premierleague.com/api/element-summary/***{element_id}***/

Returns a summary of data on a football player. This includes the current season's fixtures and a summary for their past seasons.

img.png

5 - Data on a given Gameweek
Endpoint: event/{event_id}/live/

Full url: https://fantasy.premierleague.com/api/event/***{event_id}***/live/

Returns statistics on every football player in FPL for the specified gameweek.

img.png

6 - Manager Summary
Endpoint: entry/{manager_id}/

Full url: https://fantasy.premierleague.com/api/entry/***{manager_id}***/

Returns a summary of the data on a given manager.

img.png

7 - Manager's History
Endpoint: entry/{manager_id}/history/

Full url: https://fantasy.premierleague.com/api/entry/***{manager_id}***/history/

Returns a given manager's history on FPL. 'current' has statistics for every fixture. 'past' gives a summary of the manager's previous seasons and chips shows which chips have been played and when.

img.png

8 - Manager's Transfers
Endpoint: entry/{manager_id}/transfers/

Full url: https://fantasy.premierleague.com/api/entry/***{manager_id}***/transfers/

Returns all of a given manager's transfers in the current season.

img.png

9 - Manager's Transfers in current Gameweek
Endpoint: entry/{manager_id}/transfers-latest/

Full url: https://fantasy.premierleague.com/api/entry/***{manager_id}***/transfers-latest/

Authentication is required to access this endpoint, view auth instructions here

This endpoint returns a given manager's transfers for the most recently completed gameweek. It does not return transfers that are ongoing in a live gameweek.

img.png

10 - Classic League Standings
Endpoint: leagues-classic/{league_id}/standings/

Full url: https://fantasy.premierleague.com/api/leagues-classic/***{league_id}***/standings/

Optional Query Parameters:

page_new_entries
page_standings
phase
img.png

11 - Head-to-Head League Standings
Endpoint: leagues-h2h-matches/league/{league_id}/

Full url: https://fantasy.premierleague.com/api/leagues-h2h-matches/league/3514975/?page=1

img.png

12 - Manager's Team
Endpoint: my-team/{manager_id}/

Full url: https://fantasy.premierleague.com/api/my-team/***{manager_id}***/

Authentication is required to access this endpoint, view auth instructions here

Returns the given manager's current team, data on what chips the manager has used and when, and also the transfers made by the manager in the latest gameweek. The manager id specified must match the details you authenticate with.

img.png

13 - Manager's Team on a given Gameweek
Endpoint: entry/{manager_id}/event/{event_id}/picks/

Full url: https://fantasy.premierleague.com/api/entry/***{manager_id}***/event/***{event_id}***/picks/

Returns data on the given manager for the given gameweek and also shows the players chosen for the manager's team.

img.png

14 - Event Status
Endpoint: event-status/

Full url: https://fantasy.premierleague.com/api/event-status/

Returns the status of adding bonus points and league updates for the current gameweek.

img.png

15 - Dream Team
Endpoint: dream-team/{event_id}/

Full url: https://fantasy.premierleague.com/api/dream-team/***{event_id}***/

img.png

Returns the dream team of the given gameweek.

16 - Set Piece Taker Notes
Endpoint: team/set-piece-notes/

Full url: https://fantasy.premierleague.com/api/team/set-piece-notes/

Returns notes on the set piece takers for each team.

img.png

17 - Manager Data
Endpoint: me/

Full url: https://fantasy.premierleague.com/api/me/

Authentication is required to access this endpoint, view auth instructions here

Returns data on the given manager. The manager id specified must match the details you authenticate with.

img.png

18 - League Cup Status
Endpoint: league/{league_id}/cup-status/

Full url: https://fantasy.premierleague.com/api/league/***{league_id}***/cup-status/

Returns data on the cup status for a given league.

img.png

19 - Most Valuable Teams
Endpoint: stats/most-valuable-teams/

Full url: https://fantasy.premierleague.com/api/stats/most-valuable-teams/

Returns top 5 most valuable teams.

img.png

20 - Best Leagues
Endpoint: stats/most-valuable-teams/

Full url: https://fantasy.premierleague.com/api/stats/most-valuable-teams/

Returns best leagues, by average score of top 5 players in said league.

img.png

Example Projects

Feb 20, 2023
Fantasy Football League Analyzer
CLI in Rust to give me more data about my league with my friends, and to use "knowledge of the crowd" to make better decisions by analysing top 10k players

Read More

Sep 3, 2022
Fantasy Football Reminders
To give myself an advantage over my friends, I built a AWS Lambda function in GoLang, that texts me reminders for upcoming gameweek deadlines in FPL

Read More

Next Post
All blogs
Previous Post
Contact
Subject
Email
Message
Submit

</oliverlooney.com>

FPL APIs Explained | Oliver Looney   اكتب سكريبت بلغه بايث يعطي التشكيلات الاساسيه للفريقين في الوقت الحالي الذي يتم فيه تشغيل سكريبت يعني اي فريقين سيلعبان وتتوفر التشكيله يقوم سكريبت بعرضها مباشره اي سكريبت يعمل بدون توقف تكون العمليه احترافيه من فضلك في العرض وشكرا