How to avoid getting timed out by a third part API on Render/Heroku servers?

Hey Dashers,

I have a Dash app that fetches data from a third party API outside of a call back function (Hence, it is nor over requesting). In fact, It works perfectly locally, however it gives me error when I deploy it on a Render server. I suspect some third party APIs intentionally block addresses of mainstream cloud servers due to security reasons(?). Hence, I am experiencing a timed out error.

So, what should I do?

I am open to all kind of recommendations… I heard something about proxy https, but I don’t have any idea about how to implement them. Although I have no idea about how to do, another option could be creating a SQL database and running a script that would periodically fetch data from API locally and send data to the database/dash app, if that make sense…

Anyways, I am looking forward to your replies

Cheers!

Hello @Berbere !

Could you be a little bit more specific about the code and the error it gives you? It can be a lot of different issues. For example I had a function running well on my local machine but it got timed out on the Render - but it is a limit you can increase with gunicorn parameter.

Hey @martin2097,

Thank you so much for your reply, and sorry for my late reply.

I agree that it can be a a lot of things, however there is a countless issue on the GitHub page of the package that I use it to fetch data from nba.com. The main consensus over there is indeed cloud server IPs were and will be blocked by the website.

Nevertheless, I managed fix my problem (more true if I say go around the problem :slight_smile: ) by following the latter option in my question: I wrote a script that periodically fetches the data locally, connects with the db on cloud and sent the fetched data to it.

Cheers!

1 Like