Hi! guys!
For the weather app project I’d like to switch the background image according to the fetched weather data (“partly cloudy”, “sunny”…etc…); i want to set up a function that does all that, and that seems fairly easy;
The thing is: i do not know all the possible weather descriptions i could be possibly getting from the API…is there a way to retrieve that info in their docs? If so, i could then set up an array and use it in my function;
Thank you!
The API should have documentation explaining all the possible outcomes and codes, post the API you are using, maybe we can help you out 
EDIT: Didn’t realize your API was named Dark Sky. This is the data you were looking for in the documentation:
icon optional
A machine-readable text summary of this data point, suitable for selecting an icon for display. If defined, this property will have one of the following values: clear-day, clear-night, rain, snow, sleet, wind, fog, cloudy, partly-cloudy-day, or partly-cloudy-night. (Developers should ensure that a sensible default is defined, as additional values, such as hail, thunderstorm, or tornado, may be defined in the future.)
edited my answer, check it out 
perfect, that would be it! thanks so much
1 Like