Good day to all! I want to write live wallpapers that display the weather in real time. Already decided on the data source - openweathermap.org. But the following question arose: how to properly receive this data in the application? On openweathermap there is a limit of 60 requests per minute. Accordingly, if you contact the application directly to openweathermap under one account, then with a large number of downloads of my application, this restriction will be reached very quickly. Buy paid subscriptions? Or somehow write your server to which all data will be downloaded in one request, and the application will already access my server? Or are there other solutions?
- Make your server, and let customers turn to him, so I think it would be better. - MrTrojan
- Make your caching proxy server. Let it cache client requests for, say, 5 minutes. - ilyaplot 1:09 pm
- Probably, one request gives the weather in a certain place and time. We then need such a server to store the data that users need, and they quickly deleted outdated ones. - AivanF.
1 answer
Your proxy server. On it, set up a scheduler for cyclically updating the data in squares
Cities within a rectangle zone Description:
The geographic coordinates are.
Parameters:
bbox bounding box [lon-left, lat-bottom, lon-right, lat-top]
callback javascript functionName
cluster use server clustering of points. Possible values are [yes, no]
lang language [ru, en ...]
Examples of API calls:
http://api.openweathermap.org/data/2.5/box/city?bbox=12,32,15,37,10&cluster=yes
And even better so
1) a request comes from the user
2) If there is no local data around the city, or they are very outdated (> 30m for example) - you load a square (circle) 200x200 km around the query point and cache all the cities