Home Command line utilities Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline

By sk
Published: Last Updated on 1.4K views

It is very difficult time for the entire World! The deadly Coronavirus (COVID-19) is spreading very fast across the Globe. All countries are taking various precautions including lock-down and curfew and trying their best to control this infectious disease. The World Health Organization (WHO) website provides many resources, current situation reports, travel advice, protective measures & awareness and answers for all questions related to the Coronavirus disease outbreak. Besides WHO, many NGOs, individuals and volunteers are doing their part by developing tools and apps to track the Novel Coronavirus statistics. This guide explains how to track Coronavirus disease 2019 (COVID-19) statistics from Commandline using Corona-cli, Coronavirus-tracker-cli and COVID-19 Tracker CLI on Linux.

1. Corona-cli

Corona-cli is a command line application written in NodeJS. The corona-cli gets you the following details from commandline:

  • Worldwide Coronavirus disease (COVID-19) report,
  • Active daily report of your country's COVID-19 statistics,
  • Track Coronavirus statistics of US states,
  • Displays the report by country-wise, cases, deaths, active, recovered, critical, no of cases per-million.

Install Corona-cli on Linux

Make sure you have installed Nodejs on your Linux system as described in the following guide.

After installing Nodejs, run the following command to install Corona-cli on your Linux system:

$ npm install -g corona-cli

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Corona-cli

When you run Corona-cli without any options, it displays the world-wide Coronavirus statistics in a neat tabular-column format as shown below.

$ corona

Sample output:

Coronavirus Disease 2019 (COVID-19) Statistics From Commandline

As you can see, each column in the above output contains the following details:

  • Country - Name of the country.
  • Cases - Total number of cases in a country.
  • Cases (today) - Cases in 24 hours GMT/UTC.
  • Deaths - Total number of deaths in a country.
  • Deaths (today) - Deaths in 24 hours GMT/UTC.
  • Recovered - Total number of recovered people.
  • Active - Total number of active patients.
  • Critical - Total number of critical patients.
  • Per Million - Affected patients per million.

It is possible to display Coronavirus statistics by country-wise. For instance, to display the Coronavirus statistics data for India, run:

$ corona India

Coronavirus statistics data for India

We can also sort Coronavirus statistics by various types as given below.

$ corona -s country
$ corona -s cases
$ corona -s cases-today
$ corona -s deaths
$ corona -s deaths-today
$ corona -s recovered
$ corona -s active
$ corona -s critical
$ corona -s per-million

If you're live in United States, you can display the Coronavirus data by states-wise.

$ corona states

Coronavirus data by states-wise in US

To display states data sorted by active cases, run:

$ corona states --sort active

To display states data sorted by Cases today:

$ corona states -s cases-today

To get help, run:

$ corona --help
  Track the Coronavirus disease (COVID-19).

  Usage
    corona <command> [--option]

  Commands
    country-name         Get data for a given country
    states               Get data for all USA states

  Options
    --xcolor, -x         Single colored output
    --sort, -s           Sort data by type

  Examples
    corona china
    corona states
    corona -x
    corona --sort cases-today
    corona -s critical

  ❯ You can also run command + option at once:
    corona china -x -s cases

For more details, refer the project's GitHub page given at the end.

2. Coronavirus-tracker-cli

Coronavirus-tracker-cli tracks the Coronavirus (COVID-19) statistics from command line using curl program. It gets the Coronavirus data from the following two sources:

By default, it uses Worldometers API if the source is not explicitly mentioned.

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Coronavirus-tracker-cli

Unlike the previous tool, coronavirus-tracker-cli requires no installation! All you have to do is to use curl command which comes pre-installed with many Linux distributions.

To track the Coronavirus stats globally, simply run:

$ curl https://corona-stats.online

Sample output:

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Coronavirus-tracker-cli

As I mentioned already, if no source mentioned, It gets the Cornavirus data from Wordometer API by default.

You can also specify source explicitly like below:

$ curl https://corona-stats.online?source=1
$ curl https://corona-stats.online?source=2

Filter Cornavirus stats by country-wise:

To display COVID-19 data for a specific country, mention the country name like below.

$ curl https://corona-stats.online/India 
$ curl https://corona-stats.online/Spain

Filter Cornavirus stats by country-wise from specific source:

$ curl https://corona-stats.online/uk?source=1
$ curl https://corona-stats.online/gb?source=2

Display top affected countries

To display top ten affected countries by COVID-19, run:

$ curl https://corona-stats.online?top=10

Track Top ten affected countries by COVID-19 Using Coronavirus-tracker-cli

Besides using Curl command, it is possible to install it using npm package manager.

Please note that coronavirus-tracker-cli will conflict with the corona-cli tool. Because both uses the same executable name i.e. corona. So it is recommended to remove the previous one if it is already installed and then install coronavirus-tracker-cli.

$ npm uninstall -g corona-cli

Make sure you have installed NodeJS. After installing Nodejs, run the folllowing command to install Coronavirus-tracker-cli:

$ npm install coronavirus-tracker-cli -g

Now track the Coronavirus stats globally using command:

$ corona

Get Coronavirus data from specific source:

$ corona --source=1

Or,

corona -s=1

Get Coronavirus data country-wise:

$ corona India

Display top N countries afftected by Coronavirus:

$ corona --top=10

Or,

corona -t=10

For more details, refer the project's GitHub page given at the end.

3. COVID-19 Tracker CLI

COVID-19 Tracker CLI is yet another command line program to track Coronavirus Disease 2019 (COVID-19) cases around the world. It is also written in NodeJS. It uses Worldometer API to collect the COVID-19 data.

Concerning about the features, we can list the following:

  • Real-Time updates.
  • Optimized application.
  • Fast response time (~< 100ms).
  • Simple layout and easy to understand.
  • By country query.
    • e.g. (/country).
  • Windows CMD support.
    • e.g. (/cmd or /cmd/country).
  • Plain or Basic version.
    • e.g. (/plain or /plain/country) or (/basic, /basic/country).
  • Random health saying on footer.
  • No installation required!
  • Free and Open source!!

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using COVID-19 Tracker CLI

As I already mentioned, COVID-19 Tracker CLI doesn't require any installation. All you need to do is Curl or Wget commands. Both are comes pre-installed in most Linux distributions.

To track COVID-19 data worldwide, simply run:

$ curl https://covid19tracker.xyz

Or,

$ wget -i https://covid19tracker.xyz && cat index.html

Sample output:

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using COVID-19 Tracker CLI

As you can see in the above outputs, COVID-19 Tracker CLI program displays the COVID-19 global cases in a simple tabular-column format with the following details:

  • Total number COVID-19 cases,
  • Total number of deaths,
  • Total number of recovered cases,
  • Mortality rate in %.
  • Recovered rate in %.

There is also a random health saying or precaution message at the bottom. Very cool!

You can also track the COVID-19 cases by country-wise by mentioning the country name like below.

$ curl https://covid19tracker.xyz/India

Track the COVID-19 cases by country-wise Using COVID-19 Tracker CLI

To me tracking COVID-19 cases with curl command is much better than wget method. Anyway, you can use any method that suits for you.

For more details, look at the project's GitHub page given at the end.

Useful online resources that provides live Coronavirus statistics

If you don't want to install anything, use the following online resources to track the Coronavirus data from an Internet-connected desktop/mobile/tablet:

Stay informed about Coronavirus:

Protect yourself from Coronavirus

There is a popular proverb - "Prevention is better than cure.". I fully concur with it. Since there is currently no vaccine to prevent coronavirus disease, follow all advises suggested by the WHO, Doctors and local healthcare authorities to protect yourself and your family from Coronavirus:

  1. Wash your hands frequently with soap and water or with an alcohol-based solution.
  2. Maintain social-distancing (at least 1 metre from others).
  3. Cover your mouth/nose with your elbow while coughing and sneezing.
  4. Avoid touching your face, particularly eyes, nose and mouth.
  5. Stay in your HOME as much as possible.

Resources:

  1. Corona-cli GitHub Repository
  2. Coronavirus-tracker-cli GitHub Repository
  3. COVID-19 Tracker CLI GitHub Repository

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

4 comments

Uwe Brauer March 29, 2020 - 1:12 pm

Hi
thanks
I am running Ubuntu 16.04

I followed your steps.
I needed to run it as root
sudo npm install -g corona-cli
but even then I obtained
corona
/usr/bin/env: ‘node’: No such file or directory

what is wrong, thanks
Uwe Brauer

Reply
sk March 29, 2020 - 4:56 pm

Make sure you have installed Nodejs on your system. The installation guide s linked in the article itself. Also you don’t need to run it as root. Just install as normal user with command – “npm install -g corona-cli”.

Reply
wb greene March 29, 2020 - 11:16 pm

Installed it, had to use sudo npm install -g corona-cli on Ubuntu 16.04. Uwe Brauer doesn’t seem to have nodejs installed.

What does “nodejs –version” return?

But it doesn’t work as the api seems to be “down”:
corona-cli v3.8.6 by Awais.dev
Track the Coronavirus disease (COVID-19).


⚠ API is down, try again later.

Further investigation suggests this is a generic error message.

I tried corona united states and it fails, but corona USA succeeds. I think you may need to run corona with no arguments to get the country names.

Reply
Pierre Masson May 21, 2020 - 8:02 pm

Hi, it would convenient to have all the data without the graphical characters, in a CSV format for example. Is this possible?

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

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

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More