Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fantasy Premier League API [closed]

Tags:

api

Does anyone know if there is an API for the fantasy Premier league website? Found a few old posts but the links don't work anymore. There are a couple of apps on the app store so must be something ?

like image 649
RichieRoo Avatar asked Jul 29 '16 16:07

RichieRoo


People also ask

Does Fantasy Premier League have an API?

With fpl you can easily use the Fantasy Premier League API in all your Python scripts, exactly how you expect it to work.

Is there an API for fantasy football?

Introduction to Fantasy Sports API¶Currently the APIs support retrieval of Fantasy Football, Baseball, Basketball, and Hockey data including game, league, team, and player information. The APIs are based on a RESTful model.

Has Fantasy Premier League Been Hacked?

There is no indication or evidence of a security breach on the accounts of these FPL managers via fantasy.premierleague.com or the Premier League mobile app.


1 Answers

EDIT

It seems for the 2019/2020 season, they renamed the URLs from drf to api. Here are the new URLS:

All player/team data and more:

  • https://fantasy.premierleague.com/api/bootstrap-static/
  • Specific player: https://fantasy.premierleague.com/api/element-summary/[player_id]/
  • Example first player: https://fantasy.premierleague.com/api/element-summary/1/

ORIGINAL

These are new ones that currently work:

  • All player/team data and more: https://fantasy.premierleague.com/drf/bootstrap-static
  • Specific player: https://fantasy.premierleague.com/drf/element-summary/[player_id]
  • Example Ospina: https://fantasy.premierleague.com/drf/element-summary/1

EDIT: To find out about the links, you can check the APIs called by the fpl website client. On Chrome, go to view -> developer -> developer tools. Then click on the network tab. After that, click on a player info in your team, and check the call that is being made on the network tab (see pic below).

enter image description here

EDIT 2: You can see an example of implementation in Python here where you get interesting statistics about a certain league. You can use it as a starting point. https://github.com/spinach/FantasyPremierLeague-Api_Python

like image 173
Guy Daher Avatar answered Sep 30 '22 08:09

Guy Daher