fastf1 Failing to Load Session Data

Hey there, thanks for sharing your question and welcome to the Streamlit community! :vertical_traffic_light: It looks like your app works locally but fails to load data from the fastf1 API when deployed on Streamlit Community Cloud. This is a common scenario—many APIs work locally but run into issues in cloud deployments due to network restrictions, missing dependencies, or resource limits.

My understanding is that Streamlit Community Cloud restricts outbound network requests to certain domains and may block or rate-limit requests to some APIs, especially if they’re not on an allowlist or if the API requires authentication, custom headers, or specific user agents. Additionally, if your app is making many requests or downloading large datasets, you could be hitting resource limits or timeouts, which are stricter in the cloud than locally. There’s no explicit mention in the docs of fastf1 being blocked, but similar issues have been reported with other APIs and web scraping libraries. You might also want to check if your app is using caching (st.cache_data) to avoid repeated downloads, as this can help with both speed and resource usage in the cloud environment.

For more details, see the official docs on resource limits, deployment issues, and API/networking considerations. If you can, try logging the actual HTTP error or exception—sometimes it’s a DNS, SSL, or timeout issue. If you’re able, share a minimum reproducible example or more logs for the community to help debug! And if anyone else has run into fastf1 API issues on Community Cloud, please jump in and share your experience.

Sources: