Strange '404' status for correct API information

Today, I was using the OpenWeatherMap API, and when I live tested it, with all the error handlings(if not error, if status = 200), and it gave back a status of 404. I pasted the URL of the WEB API inti my browser, and got a valid response.
Here’s my URL:
http://api.openweathermap.org/data/2.5/weather?q=Bangalore&appid=MY_API_KEY

This is my code:



This is my valid JSON resposne:
{“coord”:{“lon”:77.6033,“lat”:12.9762},“weather”:[{“id”:800,“main”:“Clear”,“description”:“clear sky”,“icon”:“01d”}],“base”:“stations”,“main”:{“temp”:303.23,“feels_like”:296.71,“temp_min”:302.04,“temp_max”:304.15,“pressure”:1016,“humidity”:18},“visibility”:8000,“wind”:{“speed”:7.2,“deg”:70},“clouds”:{“all”:6},“dt”:1614756841,“sys”:{“type”:1,“id”:9205,“country”:“IN”,“sunrise”:1614733476,“sunset”:1614776330},“timezone”:19800,“id”:1277333,“name”:“Bengaluru”,“cod”:200}

In the JSON formatter:

Why am I receiving 404 in my text input?

1 Like

The url (http://api.openweathermap.org/data/2.5/weather?q=Bangalore&appid=MY_API_KEY) works for me. It might be that you left out the https:// in the “Web_API OpenmapAPI’s URL” block.

Just curious… what is the 3 second wait for. I wouldn’t think it would be needed.

2 Likes

According to the open weather map web site

The city name is not spelled as expected.

1 Like

I’ve tried every single spelling. There are 3:
Bangalore
Bangalore
Bengaluru

1 Like

That’s my debug method… It’s meant so that I have enough time to copy the URL from the input and paste it in my browser so I can check if anything’s wrong.

Edit @tatiang You were right! I didn’t add the https://. As soon as I did, it worked. I just copied whta they had on their site:

2 Likes

And now it’s crashing again. This time, I’m using lat and lon from the location sensor:

I know the block which is making it crash:


As soon as I remove that, it doesn’t crash. I’m not getting any error values or status- it’s just crashing. What’s wrong?

1 Like

It seems that there is a problem in the system

See this comment

1 Like

Thanks… checking it out

1 Like

Surprisingly, it was working fine just yesterday… I hope this gets fixed soon

1 Like

Hi there,

As mentioned in this thread, there was an issue with the ‘get object from JSON’ block.

I would like to confirm that the issue was resolved within a few hours, so your API blocks should behave as expected again.

2 Likes

Yes, it is working well now. Thanks!