0

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

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.

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}

jhpratt
  • 6,841
  • 16
  • 40
  • 50
Timi Bennatan
  • 71
  • 1
  • 10
  • 3
    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

1 Answers1

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