Getting a ‘Feels Like’ Temperature when transitioning away from the Weather Underground API

IBM has made the disappointing decision to retire the Weather Underground API effective 12/31, leaving many developers scrambling due to the abruptness of this decision and the complete lack of roadmap or guidance as to how to transition to a replacement so that their applications will work on January 1st.

One key element of the Weather Underground API that my popular tutorial for making an Alexa Skill makes use of is the ‘feels-like’ temperature. When updating this tutorial due to the bad news I chose to transition this tutorial to the OpenWeatherMaps API, which offers a free tier like the Weather Underground API used to that allows for up to 60 requests per minute and the current weather.

While it does not offer a ‘feels-like’ temperature, this can be easily calculated by simply factoring in wind chill to the temperature you report. This means you do not need to use OpenWeatherMaps- you can really use any API that gives you a current temperature and wind speed! It really is as simple as this:

 

The formula in the above code is to calculate a temperature with windchill using US Customary units:

Wind Chill = 35.74 + 0.6215T – 35.75(V^0.16) + 0.4275T(V^0.16) (Courtesy of MentalFloss)

where T is a temperature in Fahrenheit and V is a wind speed in MPH. You should be able to find a corresponding formula for metric online.

I also went ahead and rounded my ‘feels like’ temperature to one decimal place, to make it easier to read (or for a voice assistant to read out loud, which is how I eventually used this code).

I hope this helps others as they transition to other weather APIs as Weather Underground winds down. Its developer community will be missed!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s