Google Books API

Hi ya’ll,

I’m relatively new to coding and have been using ChatGPT to help build most of my project. I’m working on an app that searches for books on variou ssites but I’ve run into an issue with the Google Books API on Streamlit Cloud. I get a 403 Forbidden error when deploying on Streamlit Cloud, even though the API works fine when tested locally.

App URL: https://thebookworm.streamlit.app/

GitHub Repo: GitHub - dylancampbell/bookz

Error Message: Error connecting to the Google Books API: 403 Client Error: Forbidden for url: https://www.googleapis.com/books/v1/volumes?q=intitle%3Aexample&key=AIzaSyXXXXXX

What I’ve Tried:

  • Verified that the API key works locally (no issues).
  • Checked API quotas and restrictions — the key is unrestricted, and no referrer/IP restrictions are set.
  • Regenerated the API key, but still get the 403 error only on Streamlit Cloud.

I’m wondering if anyone has run into similar issues or if there’s a known limitation with using Google APIs on Streamlit Cloud due to IP restrictions. Any workarounds or suggestions would be greatly appreciated!

Thank you!