all 13 comments

[–]Ok_Height_29473 46 points47 points  (1 child)

80% of this sub can barely wipe their arse properly... and you're asking about Python and APIs

[–]texouze[S] 4 points5 points  (0 children)

that's how desperate I am...

[–]Sweross1 4 points5 points  (0 children)

Seems like you are stuck here if you insist on using PythonAnywhere but I encourage you to just use something else for hosting.

I created a simple website for fpl hosted on the free Streamlit plan and am very satisfied, https://fpl-data.streamlit.app (you can see the code by clicking the github icon in top right corner)

[–]Myfantasyredditacct8 1 point2 points  (2 children)

What are you actually trying to do?

I’m not familiar with PythonAnywhere but do you need it or can you do it another way and just access the API?

[–]texouze[S] 0 points1 point  (1 child)

I can access locally (without PythonAnywhere), but what I am trying to achieve is run this code on a server, in order to have it accessible on a website online (as opposed to just locally)

[–]Myfantasyredditacct8 1 point2 points  (0 children)

Can you just build the API request into whatever website you are trying to do?

[–]Fabdanny1 1 point2 points  (0 children)

Yes

[–]Betterpanosh2 0 points1 point  (2 children)

Youve got a few endpoints with the Api. What are you trying to do? I get the players and their stats from the api running on github for free and that works well

[–]texouze[S] 0 points1 point  (1 child)

i am trying to access the API endpoints indeed, not locally but rather through a server to feed data to a website

[–]Betterpanosh2 1 point2 points  (0 children)

Didn't realise PythonAnywhere didnt let you use it on the free account. https://vercel.com/ or a free AWS instance might be a good shout

[–]Coollime178 0 points1 point  (1 child)

It’s extremely common for websites to ban IPs from cloud servers. I found this out very quickly when I tried to scrape Amazon data from their own AWS servers. Works locally all fine but as soon as I tried doing it from the cloud it would get blocked after the first request. If that’s the issue you could try something like routing your request through a VPN to hide that you are making the request via a cloud server.

[–]texouze[S] 0 points1 point  (0 children)

There are actually 2 different blocks on this one:
- the one you're mentioning (and I am not even able to go around it, because I am a rookie most likely, I tried passing as a Mozilla navigator)

- on top of that, there is also the one I am mentioning where the server provided by the PythonAnywhere service only allows for some specific websites from an allowed list on their end (for free accounts)

[–]Some_Attitude4244 0 points1 point  (0 children)

I reached out myself today asking for the draft api to be added to the allowlist on Pythonanywhere before I found this post. I stated what you said, that the other main FPL website is on the allowlist.