Local Weather API not returning correct data

Hi everyone!

This question does not regard my code (I got it to work the way I want it to) but is about the API I am using:

I am currently on the Local Weather Challenge and I have gotten all the jQuery to work they way I want. However, for some reason the API from OpenWeathermap is no longer providing the correct data.When working with it yesterday the right temperature was provided each time. When doing it today it no longer provides the right temperature (it’s real hot in Amsterdam today and I get 12 degress centigrade back from the API…;D).

Again, the problem is not in my code as I have tested this outside of my code on the OpenWeatherMap page as well(for Amsterdam), with the same result. My key works, I get data back, but it is not current data (even when testing straight on the OpenWeatherMap site, away from my code).

Any ideas what may be causing this?

p.s. when I change the city name to let’s say Chicago or Taipei, I do get the right weather conditions back (checked it against other website that provide current conditions). Does this maybe have something to do with my browser caching data?(or is that a silly question…)

I would appreciate any insights on this!


Do you have a CodePen available, or some way to share your code?

Here’s the codepen:


As I just started working on the styling of the app I noticed that the correct conditions are provided now. I just do not know why the API doesn’t consistently provide me with data of the ‘current’ weather, but seems to alternate between current weather and previous conditions.Perhaps there is an explanation concerning the intervals at which OpenWeatherMap updates these conditions, which would makes the interpretation of ‘current’ quite a loose one, seeing that half an hour ago it indicated 12 degress while I am sitting here with a fan in my face! :smiley:

Maybe you can tell me if the correct condition are provided for your location?

Thank you!

It’s showing me data for a city about 30 miles away, which is what I get via ipinfo every time. I don’t really have a way to test this, but your location oddities could have something to do with the way ipinfo assesses your location rather than openweather’s service.

1 Like

Yeah. I read something like that before about ipinfo. When I log to the console it doesshow the correct city, Amsterdam, every time. Since it is working well now I’m just going to keep monitoring it. It does everything else fine. Just get non-current conditions from time to time!

Thanks for checking it for me!

Have a great day!

Consider using a different weather api - I use forecast.io because openweather is often inaccurate for me. There will still be some variance, since location is ip based - but otherwise will respond with current weather data.


Definitely considering. Will do if I come across this problem again. I gues the most important thing is to learn how to work with API’s. This was the first time for me and I am happy I got it to work.

Thanks for the suggestion. Wrote it down!