DEV Community

Prathamesh More
Prathamesh More

Posted on

Build COVID19 SMS Tracker using Twilio + NodeJS

Let’s get started,

Install the required packages

npm install --save express twilio axios

We will be using an external REST API to get COVID19 Cases.

First, get the latest COVID19 cases for India using Axios.

const covidINdata = await axios.get('');

const latestData =;

//API returns an array which contains all snapshots of cases. We will use the latest, which means the last element of the array.

const data = latestData[latestData.length - 1];

//Now configure, Twilio SMS API - Signup for Twilio, and get Account ID and API KEY.

const API_KEY = "your_auth_token";
const client = new twilio(ACCOUNT_ID, API_KEY);
Create body and send SMS,
        body: data, //This is SMS body, returned from API
        to: 'your_mobile_number',
        from: +12569789527
      }).then(data => {
        return res.status(200).send('SMS has been sent' + data);
      }).catch(error => {
        return res.status(404).send(error);
Enter fullscreen mode Exit fullscreen mode


Top comments (1)

nawazmujawar profile image
Nawaz Mujawar

Good work