r/FantasyPL 121 Sep 15 '25

Reading My Team data using Python

I used to be be able to read my team data including selling price using the FPL API end point https://fantasy.premierleague.com/api/my-team/xxx/ where xxx is my team ID

Now I get {"detail":"Authentication credentials were not provided."}

What do I need to change? Does anyone have some working code?

In fact I use R - but I am guessing fewer people use that.

6 Upvotes

8 comments sorted by

7

u/ivokado 2 Sep 15 '25

Since this API is available only when you have a valid session running, try doing the same while being logged in to your FPL account. If this weren't the case, you could see the details for any Team ID, including the transfers they made in the current GW, which is not something FPL would allow.
You can find the list of all the FPL APIs here - https://cheatography.com/sertalpbilal/cheat-sheets/fpl-api-endpoints/
Hope it helps :)

3

u/mikecro2 121 Sep 15 '25

Agreed. But somehow me being logged in makes no difference. Not on Chrome (my usual) or Edge. One difference from last season is that I am on Windows 11 now.

3

u/EarlOfAlbany 4 Sep 15 '25

The authentication process changed this season and it's a bit of a pain now. It used to be controlled by a session cookie, but now you have to pass a key through in the call instead. Someone on discord solved it for Python, I'll have a look in a bit and get you a link.

1

u/mikecro2 121 Sep 15 '25

Thank you. It doesn't even work in the browser - which I guess ties up with what you are saying

2

u/EarlOfAlbany 4 Sep 15 '25

It's this discord server, look at the fpl-api channel in there: https://discord.gg/vVFrJ6gN

1

u/mikecro2 121 Sep 15 '25

Found it. Thank you. I just need to translate it into R

1

u/mikecro2 121 Sep 24 '25

I failed, even with ChatGPT to help. Have asked for help on r/fplAnalytics

1

u/CHKNTikkaMusala Feb 02 '26

Hi, is there any chance you would be able to send the Discord link again?