Is FCC Weather API broken?

Is FCC Weather API broken?
0

#1

Good night everyone!

Right now I’m trying to complete the “Local Weather” project. FCC Weather API documentation states that the server’s response should include links to icons showing the relevant weather condition. However, I get this…

{
    "coord": {
        "lon": -6.26,
        "lat": 53.37
    },
    "weather": [
        {
            "id": 500,
            "main": "Rain",
            "description": "light rain"
        },
        {
            "id": 300,
            "main": "Drizzle",
            "description": "light intensity drizzle",
            "icon": "09n"
        }
    ],
    "base": "stations",
    "main": {
        "temp": 11.43,
        "pressure": 983,
        "humidity": 87,
        "temp_min": 11,
        "temp_max": 12
    },
    "visibility": 10000,
    "wind": {
        "speed": 11.8,
        "deg": 250
    },
    "clouds": {
        "all": 75
    },
    "dt": 1505086200,
    "sys": {
        "type": 1,
        "id": 5237,
        "message": 0.0048,
        "country": "IE",
        "sunrise": 1505109115,
        "sunset": 1505155810
    },
    "id": 6691027,
    "name": "Drumcondra",
    "cod": 200
}

As you can see, there is no weather[0].icon, and weather[1].icon contains only “09n” instead of a valid URL.

It seems the API is broken in the sense that it doesn’t match its own documentation.

It would also be nice to have a list of all available conditions (like Rain, Clouds, Clear) etc, so I would be able to use a set of my own icons (but it would be rather difficult because you can’t host you own images with CodePen, and the images must be available via HTTPS in order for geolocation functions to work.


#2

It looks like the FCC Weather API is using the Open Weather Map API.
To access the icon you can append the 09n (weather[1].icon) to the following http://openweathermap.org/img/w/

So https://openweathermap.org/img/w/09n.png

Below is a list of all the icons you asked about and their corresponding conditions:
https://openweathermap.org/weather-conditions

Good luck!


#3

I finished my weather app not too long ago and ran into the same issue. I think it is indeed broken. I would simply make a work-around and consider it part of the challenge (even if it’s unintended). Use the link that Drustin2 posted to get the images and then just write some code to call those images when their corresponding alphanumeric codes come up.


#4

Thanks for your help! In the end, I simply switched to OpenWeatherMap API — it’s more or less the same API, only a bit more predictable in its behaviour.