-2

I'm developing an application that will show some weather information based on the user's location. Since the weather forecast is just a very small feature of the app that complements the main ones, I do not want to spend too much money on the 3rd party weather API which charges per per API call

The app will make a request at least once every 30mins. I plan on caching the requests in my server based on the coordinates with a 2-decimal place precision (1.11 km) but I fear caching it that way will not be enough and it will end up being a very expensive minimal feature.

Any other (better) ways of doing this?

If it matters, I will be using https://openweathermap.org/api

Thanks!

3
  • 2
    In what way are you afraid this will be an expensive feature? How big of an area do the forecasts you retrieve apply to? How accurate do your users expect your forecast to be and in what aspects (wind, temperature, amount of rain, when it will rain, etc.)? Commented May 19, 2021 at 8:00
  • @BartvanIngenSchenau The API charges per call (1 call provides all the info I need), so 10,000 users = 20,000 calls/h, 20,000 users = 40,000 calls/h, etc. There's also a limit per minute. Commented May 19, 2021 at 9:44
  • It's not really clear what the question is here. Are you asking if your caching strategy is going to be expensive or if you've limited your calls enough? If it's the latter, how are we to know what you can afford? Commented May 19, 2021 at 16:17

1 Answer 1

0

Your question is about a trade-off between precision in the weather forecast and cost in number of external API calls. This depends on several factors:

  • How important is the precision for the users? E.g is this for sailing or trekking in dangerous terrain?
  • Does the weather service even provide forecasts at such granularity?
  • Hos distributed are your users? E.g. if they are inside a city, a lot of users might be in the same 1km2 area (so caching will save a lot of calls), but if this is for the countryside or ocean, it is unlikely to save much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.