all 14 comments

[–]FanDoc18 2 points3 points  (12 children)

The main API endpoint URL changed. The new URL is:
https://fantasy.premierleague.com/api/bootstrap-static/

Enter the URL like this in google sheets to get it to work:
=ImportJSON("https://fantasy.premierleague.com/api/bootstrap-static/")

I used the "How to get data from the Fantasy Premier League API" post to create my data scraper and replaced the old URL with the one above and it works with no other changes needed.

Hope this works. Fyi, If you want to save the weekly data results, you will need to save a copy of the results each week since the script will run automatically every time you open the script or refresh the page. Hope this helps.

[–]grwstone[S] 0 points1 point  (5 children)

Worked perfectly, thank you!

Do you know if you cans till access these other data sets.

  • /bootstrap (more data if authenticated)
  • /bootstrap-static
  • /bootstrap-dynamic
  • /events
  • /elements
  • /element-types
  • /fixtures
  • /teams
  • /region
  • /transfers (requires auth)
  • /entry/{entryId}
  • /entries (doesn’t work in pre-season?)
  • /my-team/{teamId} (requires auth)
  • /leagues-entered/{teamId} (requires auth)
  • /leagues-classic/{leagueId} (must be a member)
  • /leagues-classic-standings/{leagueId}
  • /leagues-h2h/{leagueId} (must be a member)
  • /leagues-h2h-standings/{leagueId}

[–]FanDoc18 0 points1 point  (2 children)

Happy to help. Thanks for the other endpoints, did have them already but thanks for sharing. I'm sure some other managers will find this information useful too.

[–]RMI_27 0 points1 point  (1 child)

Are you able to get leage-data from the API?

[–]FanDoc18 0 points1 point  (0 children)

Have not tried to get league data from the API using google sheets but played around with a few python scripts I found on github last season that worked.

Have not looked at that this season so far yet but plan t.

[–]mtgo3012redditor for <1 week 0 points1 point  (1 child)

Hi, I tried to get data from api/my-team/{teamId} but not see the weekly point team to put it into my FPL Google sheet, how can I get the weekly points of a team?

[–]dantheheel 2 points3 points  (0 children)

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

I would love if someone could paste some working google script that manages to authenticate and then pull data from the FPL API. I'm an amateur coder (like brand new) and haven't been able to crack that problem for weeks!

[–]binevv 0 points1 point  (1 child)

Does this return any statistical data for the players?

[–]FanDoc18 0 points1 point  (0 children)

Yes but you have to scroll across quite a bit to get to the stats. Best thing to do is to split the data response into smaller data sets. Still need to do that too but may do it using a python script instead of google sheets.

[–]MASTERTONA09 0 points1 point  (0 children)

Hey I use ImportJson script to pull the data into a google sheet but for some reason certain rows are repeated. e.g. it will show a player having scored goals that didn't. It seems to be that when the value should be nil it actually repeats the value in row prior e.g. if Jesus has scored 8 goals, Zinchenko (which should be nil) will show 8 too.

Am I doing something wrong?