I have a Streamlit app I’m working on now that tells me which bands are playing tonight in my city. You can find it at Music In Seattle.
To get the information, the app has a module that makes a few calls to a ticketing service API, and another module (still under construction) which will scrape the calendars of some venues that aren’t listed on bigger ticketing websites.
Right now, the module that calls the API is run every time the app is accessed, i.e., called once for each user. I’m trying to figure out a way that I can run this API code only once per day, just after midnight, and then use that information with every user.
Aside from just being more efficient and better practice, I want to limit API calls because of the cost to me if I exceed a certain threshold. I’d like to start sharing this with many people, so I don’t want to run into this problem once it’s already happening.
Does anyone have any ideas on how I might achieve this? Thanks in advance