Node-RED node for The Weather Company (TWC) COVID-19 Disease Tracking API
These nodes implements the TWC APIs for COVID-19 Disease Tracking.
The API allows you to track the progression of a disease for a given location. It provides information regarding active diseases including confirmed cases, deaths, and recoveries over a period of up to 60 days in the past.
Either use the Editor - Menu - Manage Palette - Install option, or run the following command in your Node-RED user directory (typically ~/.node-red
).
$ npm install node-red-contrib-twc-covid19-tracker
To use The Weather Company API for COVID-19 Disease Tracking, you need an API key. Call for Code participants can register to join the Call for Code 2020 COVID Challenge and request a TWC API key for this Node-RED node at callforcode.weather.com A time-limited API key will be sent to you via email.
This Node-RED package creates twc covid19 tracker and twc covid19 country report nodes in your Node-RED palette.
- twc covid19 tracker - Query 60 day history of COVID-19 statistics at the Country, State, County level by Geocode, Place ID or Postal Code.
- twc covid19 country report - Query the current state of a disease for a set of countries globally.
Review the CHANGELOG for enhancement history.
Once the node is installed in your Node-RED palette, drag it to your flow and double-click on the twc covid tracker node. In the Properties dialog box enter the following information:
- Your TWC API Key provided by callforcode.weather.com
- Specify whether the node will retrieve country, state or county COVID-19 data
- Specify the location you are interested in; geocode latitude/longitude, Place ID, or Postal Key
- The location either via latitude/longitude, place id or postal code. Examples:
- 40.74,-73.99
- 327145917e06d09373dd2760425a88622a62d248fd97550eb4883737d8d1173b
- 10001:US
Review the node information documentation in the Node-RED right hand side bar for techniques that allow you to programmatically pass in the above parameters via a msg.twcparams json object.
The Weather Company offers TWC Weather Data Packages that are available for purchase. The Node-RED node in this package implements the Disease Tracking API service and is free for Call for Code participants (please review the Terms of Service)
The TWC Disease Tracker API allows you to track the progression of the COVID-19 disease for a given location. It provides information regarding active diseases including confirmed cases, deaths, and recoveries over a period of up to 60 days in the past.
See the online documentation for more information about The Weather Company API for Disease Tracking.
See the online documentation for more information about The Weather Company API for Global Disease Country Reporting.
The APIs returns an array of json objects containing COVID-19 data which you can integrate into dashboards or applications.
For a full tutorial with instructions, screenshots and examples, review the IBM Developer Build a Node-RED COVID-19 dashboard tutorial.
Learn how to implement a Node-RED COVID-19 statistics dashboard using The Weather Company Disease Tracker API.
Access COVID-19 location and infection data through an API provided by The Weather Company (TWC) and incorporate that data in Node-RED dashboard, charts, and tables. Use Node-RED for data analysis and data visualization of COVID-19 infections by country, state and county.
Four examples are provided in the examples folder.
-
Install Node-RED on your system or in the cloud
- This flow can be deployed to IBM Cloud by creating a Node-RED Starter Application
-
Test each of the TWC COVID-19 APIs by importing this covid19-api-test.json flow.
- This example Node-RED Dashboard displays 60 days of USA State COVID-19 historical data in a table and on a chart.
- Install Node-RED on your system or in the cloud
- This flow can be deployed to IBM Cloud by creating a Node-RED Starter Application
- This example requires some additional dependencies:
- Import this Node-RED-covid19-dashboard.json flow.
- This example Node-RED Dashboard displays all of the counties in the State of New Jersey in a table and plots 60 days of COVID-19 historical data on a chart. It also plots a chart of new cases reported each day and a seven day moving average that demonstrates flattening the curve.
- Install Node-RED on your system or in the cloud
- This flow can be deployed to IBM Cloud by creating a Node-RED Starter Application
- This example requires some additional dependencies:
- Import this Node-RED-covid19-county-dashboard.json flow.
-
This example Node-RED Dashboard displays all of the States in the USA in a table and, for the selected state, plots 60 days of COVID-19 historical data on a chart. It also plots a chart of new cases reported each day and a seven day moving average that demonstrates flattening the curve or states that have recurrent outbreaks. It also drops pins with state metrics on a map. To determine the latitude/longitude of the state, it uses a TWC location API - reuse your TWC api key.
-
Install Node-RED on your system or in the cloud
- This flow can be deployed to IBM Cloud by creating a Node-RED Starter Application
-
This flow requires Node-RED v1.1 or higher
-
This example requires some additional dependencies:
-
Import this Node-RED-covid19-states-dashboard.json flow.
This flow has four sections:
- The Load State Table section displays a Node-RED Dashboard button widget, a Template node which contains a CSV list of States and zip codes, and a CSV node which splits the state list into individual messages.
- The Query COVID Stats for all 50 States section calls the TWC Disease Tracking API to retrieve the COVID19 infection data for each state. It builds an array of states and their COVID19 stats.
- The Build Charts and Tables section displays a table of states with sortable COVID19 stats. When a user selects a state, the 60 days of COVID-19 historical data is displayed on a chart and table. It also plots a chart of new cases reported each day and a seven day moving average that demonstrates flattening the curve or states that have recurrent outbreaks.
- The COVID Map of USA section determines the latitude/longitude of the state by using a TWC Location Search API call. It then drops pins with state COVID19 metrics on a map.
- The data for this API is aggregated from trusted sources listed in the response of each API call.
Enjoy! Give me feedback if you have suggestions on how to improve this node.
This npm package is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.