CallForCode weather API in Node-RED

I notice there are some changes in the usage of the weather API. For that reason I created a very simple sample with Node-RED to access the weather forecast. The Node-RED flow implements the access to the weather API you can use during your CallForCode challenge.

Here is what you need to do, to get access to the weather API:

  1. Register on Welcome to The Weather Company API Platform Site Powering the best Weather Apps & Sites
  2. You will get a mail with the apikey
  3. Then you can use the documentation to access the APIweather-api-doc-2019

Please ensure you have following simple settings for your REST API request in place:

  1. The HTTP header must contain Accept-Encoding: gzip
    The reason for that is, that all responses of the weather API requests are compressed. The Supported encoding format is: gzip
  2. Use the parameter apiKey

The following picture shows a simple postman this request:

postman-weather

Inside the flow you have to replace the text YOUR_WEATHER_APIKEY  with the apiKey you got in your mail. Beware you have to install node-red-contrib-gzip in your Node-RED to use the sample. You can get the Node-RED flow from GitHub.

In the following gif you can see the usage of the flow:

node-red-weather

For a more detailed understanding, how the weather service can be used in real world UseCases, please visit that awesome blog post from Va Barbosa All for code the weather company and you .

I hope this was useful for you and let’s see what’s next?

Greetings,

Thomas

PS: By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.

#IBMDeveloper, #CallForCode, #Node-RED, #WeatherAPI

 

 

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 )

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: