MITB Banner

This Data Scientist Created A Python Script To Get Real-Time Vaccination Slot Alerts

Share

Last month, the Indian government announced COVID-19 vaccinations would be available for citizens above 18 from May 1. The announcement came as a huge relief for the country struggling with the pandemic. However, the hope was short-lived. Governments and private hospitals are allocating vaccines every day, but vaccination slots fill up in just a couple of seconds.

Computer Software Engineer from BITS Pilani and IIT Madras alumnus Bragadeesh S recently faced a similar situation when his attempt to book a vaccination slot for himself and his wife failed. The IIT-Madras alumnus turned to his computer for assistance. Bragadeesh has developed a Python script to allow users to get real-time alerts for vaccination slots for the 18 to 45 age group. 

How the code works

In conversation with Analytics India Magazine, Bragadeesh explained how he used Python to fetch information from the CoWIN website. The Chennai resident used the Government’s publicly available API (from API Setu) to write the Python script. The script constructs a URL path and hits the API to receive information in a JSON file.

“I then check for two criteria mentioned in every centre in the JSON file. First, if the age group is not equal to 45 years; and second, if the ‘Available Vaccine Doses’ is greater than zero,” Bragadeesh said. Once both these conditions are satisfied, the code sends an alert through email to users who have subscribed to receive alerts for every available vaccine slot. 

The code has a couple of configurable parameters. First, its pin code parameter is configurable and can be changed as per the user’s requirement. Secondly, the time interval parameter can be altered as per the user’s discretion. Bragadeesh explains, “The script runs for a certain period through a While Loop where the internal parameters can be set. If the time set is 60 seconds, the script will keep checking the API or the website every one minute.”

However, Bragadeesh suggests the ideal period is five seconds. 

Finally, the user must provide a username and password for the email, sending the trigger or alert to the subscribed users. Supposedly, when Bragadeesh enters his email address and password, and when both the criteria are satisfied, the code uses Bragadeesh’s email id to generate trigger or alert emails and send them to multiple people. Once the user receives the email alert, they will have to visit the CoWIN website and book their slots. 

When asked about the privacy concernş, Bragadeesh said the code is safe to use since it runs on a user’s local or personal computer. The scripting can be done on any personal system without compromising the user id or password and privacy. 

Launched on May 9, Bragadeesh has helped about 10 of his friends book their vaccination slots using the Python script, besides himself and his wife. 

Bragadeesh explains the code here

PS: The story was written using a keyboard.
Share
Picture of Debolina Biswas

Debolina Biswas

After diving deep into the Indian startup ecosystem, Debolina is now a Technology Journalist. When not writing, she is found reading or playing with paint brushes and palette knives. She can be reached at debolina.biswas@analyticsindiamag.com
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India