How to use OpenWeatherMap API for historical data [closed]
How to use OpenWeatherMap API for historical data [closed]
I'm trying to use the OpenWeatherMap API to get historical data by city name, though the Docs do not specify how to pass an API key in such a call.
The example they have on the docs is:
http://history.openweathermap.org/data/2.5/history/city?q=London,UK
http://history.openweathermap.org/data/2.5/history/city?q=London,UK
though without passing an API key I get a 401
error. I've seen in other Stack posts where people have succeeded to make calls by inserting the parameter ?&APPID=**api-key-here**
, though I've tried tens of permutations with no luck.
401
?&APPID=**api-key-here**
I'd like to use the following call so I can specify the time range.
http://history.openweathermap.org/data/2.5/history/city?q=city ID,country code&type=hour&start=start&end=end
http://history.openweathermap.org/data/2.5/history/city?q=city ID,country code&type=hour&start=start&end=end
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1 Answer
1
OpenWeatherMap charges for use of the historical weather collection. If you're a free user, your API Key will not work for the paid content.
You can find more information about their rates here: https://openweathermap.org/price
I was asking same question to myself, what I find out is if you're using free version, you can only get data for current and 5 day / 3 hour forecast. Rest of the data is for paid users. I hope this helped
– mtkilic
Dec 14 '16 at 20:16