COVID-19 Vaccination Slot Booking in India using CLI based script

Mr Robot
4 min readMay 18, 2021

Currently the Co-Win portal has become one of the critical website for India right now, its allowing Indians to register and schedule vaccinations against COVID-19, and it has also published the Co-Win APIs. Since the population of India is so large and the situation is extremely tense right now, the available vaccination slots are getting booked within seconds. Though the portal’s traffic has increased considerably since, and getting a vaccine appointment has become more difficult.

While a very few tasted success in registering for slots, many found that booking a slot was akin to buying tatkal ticket. I have been trying manually for the past few weeks but never succeeded in booking a slot through Co-Win portal. Every time I saw a free slot and tried booking, it got gobbled up within few minutes which led to me believe that bots are in play.

Finally I gave up and went with “If You Can’t Beat Them…Join Them” and a simple Google search threw this up, I got one very basic CLI based script that can be used to automate Covid vaccination slot booking on Co-WIN Platform.

You can follow below steps to :

  1. Go to the GitHub repository — https://github.com/vishalv26/covid-vaccine-booking and download the Zip file from here.

2. Unzip the archive and run native.bat(Tested on Windows 10 x64)

3. For first run you have to enter parameters like State, Area, Vaccine preference, Free/Paid, date range to book etc. which will then be saved to a json file. More details of the script execution is mentioned on the GitHub portal.

4. You have to rerun the batch file every 15–20 mins with a fresh OTP. I modified the python script for subsequent runs and hardcoded the user prompts and my phone number to minimize manual intervention to just OTP entry for polling.

The optional modifications for .src/covid-vaccine-slot-booking.py are as follows (for subsequent runs only)-

5. As you can see below this method worked for me.

You will need to enter the captcha manually when a free slot is captured. It has a nasty beep alert which you cannot miss.

6. (Optional)

Currently this script will run only on the Windows or Linux based system. So you have to monitor the script execution continuously and have to provide the OTP again and again whenever it gets expires. But if you want you can setup a RDP connection for your computer where you are running the script. you can follow below link to find more details of RDP connection setup.

https://www.windowscentral.com/how-use-remove-desktop-app-connect-pc-windows-10-0

Once you setup the RDP connection, now you can use that assigned IP of that system and can use any RDP client (Android, iOS or any other Environment which support RDP incoming connection) to access that machine.

a. For android you can use Microsoft Remote Desktop.

Important Note:

  • As mentioned by the contributor in the GitHub repository space. This is a proof of concept project. And I also do NOT endorse or condone, in any shape or form, automating any monitoring/booking tasks. Use at your own risk. Seriously, if you get into legal trouble for using this, I am not liable.

--

--