Google Places API works on local but not on Streamlit Cloud

Hello! I have an app that uses google places API and it works perfectly on my local host but when I run it in Streamlit cloud the API returns zero results, no error code just zero results. The API is configured with zero restrictions and I call it from my app with the basic API key i get in the google cloud console. I have no idea what’s going on. Please help!

Hey @Samuel_Wainberg,

Without seeing any code, my guess would be that the API is denying the requests coming from your deployed app because the IP address associated with those requests is different from the IP address when you’re running your app locally. It looks like the Google Places API allows you to restrict your API key to specific IP addresses (doc here), so I would check to see if this restriction has been configured for your API key.

Unfortunately, we are in the process of discontinuing IP allowlisting on Community Cloud going forward since the platform is geared towards community members trying to share their apps and code publicly (you can learn more about this here).

As a result, if you do need to restrict your API key to specific IP addresses, the best solution would be to host your app on a different platform – I’d recommend checking out our community hosting guide here.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.