I have a limitation of 1 million calls per month on an API and I want to call the API ~1000 times/hour. The problem is that when I do it on the front-end, I have to do it 1000 times/hour for every user on the site. Is this how APIs intended to work? I am using Hostinger to host my site and I'm building it with Wordpress and Code Snippets extension. The only solution I thought would be to call the API from a server (probably within Hostinger or Wordpress, not my own) and call the API from there. Then, I can call an API I make from my server as many times as I want from the front-end.
Is this good thinking? What else can I do? The API calls can't be reduced since I'm working on a weather website and for every location i want to know the weather I have to make a seperate API call.
https://www.weatherapi.com This is the API I use. Notice that even on high-end paid plans (10 million API calls per month) my site will easily top the limit within a few days with even a few tens of users.
When the site loads or refreshes, 200 API calls must be made. This is because the features I use need this data to work. Every time the user refreshes or opens the site a new batch of API calls will be made. If the site remains open or the user changes tab, the API will be called ~200 times every 15 minutes when the weather data updates.
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)•Free plan available
Get better conversions by improving store loading speed
Turbo Multi-language Chat - AI Customer service in one hand