Forums

Unable to fetch json from my pythonanywhere url

Hey! I'm a noob so forgive my incompetence. I'm building a website where I want to display a certain information generated by my script. This script uses etherscan API, so I don't want to include it in my website code. For this reason I made pythonanywhere account where I uploaded the code, implemented flask into it and generated a web app, so now, I can view the output of this code on my pythonanywhere api endpoint. So it works, json is generated correctly! However, I am unable to fetch this data through javascript code on my website. I use the same code to fetch json from different websites and display it on my website, so the code works alright. Is pythonanywhere blocking the request? I even upgraded my account in hopes that it will make it work.

How do you fetch it? Could you share the code please?

I fixed the issue, I had to use cors.

Glad you solved it