IBM Developer Blog

Follow the latest happenings with IBM Developer and stay in the know.

Understand how weather conditions can reduce the impacts to people in a natural disaster

Exhaustive scientific research has confirmed changing weather and temperature patterns, rapidly rising sea levels, and an intensifying proliferation of extreme weather events around the world. The frequency of these weather events continue to increase year after year. And the impact they have on people and the amount of damage they cause are escalating.

Severe and devastating weather is not going away. It is only going to get worse, according to the National Climate Assessment. By the year 2100, global temperatures are projected to increase 3 to 5 degrees Celsius (5.4 to 9 degrees Fahrenheit).

major flooding

Call for Code

Call for Code is a challenge to the world’s developers. It aims to get developers thinking about climate change and creating solutions that lessen the impacts from changing weather. Developers are called upon to use their skills to help fight the climate crisis.

For example, the 2020 Call for Code Grand Prize winner Agrolly created a solution that uses IBM Cloud Object Storage, IBM Watson Studio, IBM Watson Assistant, and The Weather Company technologies to run climate risk assessments, which allows farmers with less resources available to them to still make more educated decisions, obtain the necessary financing, and improve their economic outcome.

The Weather Company

We cannot control the weather, but we can better understand it. In doing so, we can use data and analytics to get ahead of an occurrence and reduce the impact severe weather caused by climate change can have on our communities. We can better predict, prepare, and recover from extreme weather and climate impacts.

Solving problems where weather is involved, or more specifically any application that takes into account weather conditions, means we need access to the weather data itself.

Global weather data access is back

Once again, The Weather Company® is opening some of its Weather Data APIs to developers who are participating in the Call for Code Global Challenge. It is free of charge for developers to use as they’re building their submissions.

Over 25 of The Weather Company’s critical and popular API endpoints are available. The endpoints span multiple weather data packages:

  • Core Weather Data Package: Includes the most essential weather APIs, such as current conditions, forecasts, and radar and satellite data.
  • Enhanced Current Conditions Weather Data Package: Includes one of the highest-resolution weather observation networks in the field, based on over 200,000 personal weather stations (PWSs).
  • Enhanced Forecast Weather Data Package: Built by using our leading-edge model forecasting; expertise from 200 meteorologists and related scientists; and our network of observations, radar, and satellite assimilation and modeling capabilities. The package delivers the most accurate forecasts at 500-square-meter resolution globally.
  • Severe Weather Data Package: Includes forecasted, real-time, and trailing estimates of severe weather data. Weather conditions, such as hail, lightning, severe wind, tornadoes, and more are in this package.

Developers will be able to quickly add weather data such as severe weather alerts, tropical storm forecasts, power disruption index, and more into their innovative climate change solutions.

Getting started with the Weather APIs

To access and use the Weather APIs, you must first register for an API Key. Registration is free and will be available while the Call for Code Challenge is taking place. After you agree to the terms, you will receive your API key.

You can review the API documentation to see the list of available endpoints and detailed information on these endpoints. The documentation can also help you determine which endpoints are right for your application.

Please note not all the available APIs are global. Some APIs have restrictions for use in certain regions or countries. Refer to the terms and conditions for API availability and restrictions.

Using the API requires you to make a GET request to the appropriate endpoint. The request must include the API key and any parameters required by the endpoint. For example, getting the short-range “NowCast” for Ridgewood, NJ (ZipCode: 07450) would look something like this (using curl):

curl -X GET "" -H "accept: application/json"

Where WXYZ is the API key you received from registration.

Learning by doing

GitHub repositories with sample applications that use the API endpoints are available online for you to gain inspiration from and see them in action. The repositories also provide a starting point for creating an application. The sample code demonstrates how you can query and process responses from the following endpoints:

  • Monthly Almanac API: The almanac information is sourced from National Weather Service observation stations and provided by the National Climatic Data Center (NCDC) from time periods spanning 10 to 30 years or more.
  • Weather Alerts – Headlines API: Provides weather watches, warnings, statements and advisories that are issued by the National Weather Service (NWS), Environment Canada, and MeteoAlarm.
  • Daily Forecast API: Returns the geocode weather forecasts for the current day in the API endpoint.
  • Severe Weather Power Disruption Index 15 Day: Provides insight that indicates the potential for power disruptions due to weather.
  • Tropical Forecast – Projected Path: Provides the ability to query the single projected path per active storm.
  • Weather Alerts Detail: Provides weather watches, warnings, statements, and advisories issued by the NWS, Environment Canada, and MeteoAlarm.

There are Node.js, Node-RED, and Python implementations of the sample application that are available for you to use on GitHub. You can run the sample code to see how to incorporate the endpoints into an application or examine the code to learn how you could go about consuming any of the other available endpoints. Instructions on how to obtain and run the sample codes are in both repositories.

For a quick look at how easy it is, here are the basic steps to run the samples locally with Node.js, Node-RED, or Python:

  1. Clone the desired GitHub repository (Node.js, Node-RED, and Python).
  2. Create the WEATHER_API_KEY environment variable and set it to your API key.
  3. Install dependencies using npm (for Node.js) or pip (for Python).
  4. Launch app.js (for Node.js) or (for Python).

Here’s how to deploy the samples to IBM Cloud by using the IBM Cloud Developer Tools:

  1. Clone the desired GitHub repository (Node.js and Python).
  2. Update the WEATHER_API_KEY variable in the manifest.yml.
  3. Push the application/repository to IBM Cloud using ibmcloud cf push.
  4. Start the IBM Cloud application.

(Don’t have an IBM Cloud account yet? Register here.)

The README for the sample code implementations include more detailed steps:

If you need help or have questions please join the Call for Code Slack community.

How you and other developers can make a difference

Have a solution for a more effective severe weather preparedness system or how to predict long-range climate impacts from historical weather patterns? Whatever your idea may be, join the cause.

Interested in building a solution that can have an immediate and lasting impact? Accept the challenge. Submission period for Call for Code 2021 is March 22, 2021 to July 31, 2021.

You can make a difference!

Va Barbosa and Raj Singh contributed to this blog.