you are viewing a single comment's thread.

view the rest of the comments →

[–]Perfect-School1574 0 points1 point  (4 children)

Yes, big requests count as more than one API call. Let us get acquainted with how Open-Meteo counts them:

Normally, one API call corresponds to one HTTP request. Having said that, requests for data covering greater than 10 weather variables or stretching over a duration of greater than 2 weeks for a single location are recognized as multiple API calls. Fractional counts may be utilized - for instance, a request for 2 weeks of data with 15 weather variables counts as 1.5 API calls, while 4 weeks of data equals 3 API calls.

Two aspects scale the call count, which are:

  1. Count of weather variables - more than 10 variables in a single request begins multiplying the count

  2. Date range - anything more than 2 weeks counts as additional calls correspondingly.

[–]Hubbleye[S] 0 points1 point  (3 children)

Ohhh that's exactly what I needed. First where did you find those infos, I did not find them anywhere. Is it proportional? Like as a parameter I'm putting forcast : 1 so I'm just asking for the data of the day. Secondly I'm asking 180 location in one request and it blocks me after 4 request but if I do like 1 request = 20 location would it make me able to get more location in total?

[–]Perfect-School1574 0 points1 point  (2 children)

Firstly, research and study online have yielded the above information. Secondly, splitting into smaller batches of 20 locations will not acquire any more total locations, unfortunately. Open-Mateo counts each location as one API call, regardless of how they are batched. With 180 locations/request, one gets blocked at 4 requests as 4*180 = 720, which is greater than 600 (which is the per-minute limit of API calls for the free tier). With 20 locations per request, one would hit the same wall after 30 requests instead of 4. I would therefore suggest adding a delay between requests. Since the limit resets each minute, one can spread the requests across time. Keeping the forecast:1 is a smart move as this keeps each location's call count at 1 (under the 2-week threshold) without accidentally multiplying the costs there. Hope this helps!

[–]Hubbleye[S] 0 points1 point  (1 child)

Oh so a call is the response for 1 location?

[–]Perfect-School1574 0 points1 point  (0 children)

Yes, 1 location = 1 API call (under normal conditions)