π One Stop Solution for Booking Vaccination Slots available in the CoWIN Portal directly from your Terminal...
DUE TO LATEST CHANGES IN THE API ACCESS POLICY BY MoHFW, THERE WILL BE NO MORE COMMITS/CONTRIBUTIONS/RELEASES/MAINTENANCE IN THE PROJECT. THE PROJECT HAS BEEN PUT ON INDEFINITE HOLD. GRATEFUL TO EVERY CONTRIBUTORS, SUPPORTERS, USERS THAT WE COULD HELP YOU IN THE CRISIS. EVEN THOUGH YOU MAY STILL USE THE APP AFTER GOING THROUGH THE T&C, WE ADVISE NOT TO MISUSE IT, OTHERWISE YOU MIGHT FACE LEGAL ISSUES. USE IT AT YOUR OWN RISK.
CoWIN Portal is used to self-register yourself for the Vaccination process in India. Here you can register yourself with your Phone Number and avail a slot from the available slots in various Vaccination Centres around the country.
VacCowin is a CLI based Python Script that can be used to perform tasks such as OTP Generation till Vaccination Slot Booking from Co-WIN Platform directly from your Terminal. This script rechecks after every few seconds and when the slots are available, it confirms the slot only after you enter the captcha shown on the screen.
Since India has started the Vaccination Drive for those above 18 years of age, there is a very heavy rush and slots get booked soon. This script will come in handy for booking those slots as soon as they open.
IMPORTANT: This is a Proof of Concept (POC) Project. I OR the Team do NOT endorse or condone, in any shape or form, automating any monitoring/booking tasks. It's only made for Educational Purposes. Use this at your own risk.
The data used is retrieved using the open APIs at API Setu. It works on both Linux and Windows.
git clone https://github.com/dhhruv/Vac-Cowin.git
OR Download the Zip and Extract the content.
pip install virtualenv
python -m virtualenv venv
venv\Scripts\activate.bat
cd Vac-Cowin
pip install -r requirements.txt
python VacCowin.py
1,2
:Running VacCowin...
Enter the Registered Mobile Number: ββββββββββ
Successfully Requested OTP for the Mobile Number ββββββββββ at 2021-05-23 09:28:41.669816..
Enter OTP (If you do not recieve OTP in 2 minutes, Press Enter to Retry): ββββββββββ
Validating OTP. Please Wait...
Token Generated: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Fetching the Registered Beneficiaries...
+-------+----------------+---------------+-----------+-------+----------------------+
| idx | bref_id | name | vaccine | age | status |
+=======+================+===============+===========+=======+======================+
| 1 | ββββββββββββββ | βββββββββββββ | βββββββ | ββ | ββββββββββββββ |
+-------+----------------+---------------+-----------+-------+----------------------+
################# IMPORTANT THINGS TO BE REMEMBERED #################
# 1. While selecting Beneficiaries, make sure that selected Beneficiaries are all taking the same dose: either their First OR Second.
# Please do no try to club together booking for first dose for one Beneficiary and second dose for another Beneficiary. Recommended to do both seperately.
# 2. While selecting Beneficiaries, also make sure that Beneficiaries selected for second dose are all taking the same vaccine: COVISHIELD OR COVAXIN OR SPUTNIK V.
# Please do no try to club together booking for Beneficiary taking COVISHIELD with Beneficiary taking COVAXIN and other possibilities.
# 3. If you're selecting multiple Beneficiaries, make sure all are of the same Age Group (45+ or 18+) as defined by the Government.
# Please do not try to club together booking for Younger and Older Beneficiaries at the same time.
#####################################################################
Enter comma separated index numbers of Beneficiaries to book for : 1
Selected Beneficiaries are:
+-------+----------------+---------------+-----------+-------+----------------------+
| idx | bref_id | name | vaccine | age | status |
+=======+================+===============+===========+=======+======================+
| 1 | ββββββββββββββ | βββββββββββββ | βββββββ | ββ | ββββββββββββββ |
+-------+----------------+---------------+-----------+-------+----------------------+
+-------+-----------------------------+
| idx | state |
+=======+=============================+
| 1 | Andaman and Nicobar Islands |
+-------+-----------------------------+
| 2 | Andhra Pradesh |
+-------+-----------------------------+
+-------+-----------------------------+
+-------+-----------------------------+
| 35 | Uttar Pradesh |
+-------+-----------------------------+
| 36 | Uttarakhand |
+-------+-----------------------------+
| 37 | West Bengal |
+-------+-----------------------------+
Enter State Index from the Table: 12
+-------+-------------------------+
| idx | district |
+=======+=========================+
| 1 | Ahmedabad |
+-------+-------------------------+
| 2 | Ahmedabad Corporation |
+-------+-------------------------+
| .. | ...... |
+-------+-------------------------+
| 41 | Valsad |
+-------+-------------------------+
Enter comma separated index numbers of Districts to monitor : 2
Selected Districts are:
+-------+---------------+-----------------------+--------------+
| idx | district_id | district_name | alert_freq |
+=======+===============+=======================+==============+
| 1 | 770 | Ahmedabad Corporation | 660 |
+-------+---------------+-----------------------+--------------+
Filter out Centres with Vaccine availability less than ? Minimum 1 :
How often do you want to load Data from the Portal (in Seconds)? Default 15. Minimum 5. :
Search for next seven day starting from when?
Use 1 for Today, 2 for Tomorrow, or provide a date in the format DD-MM-YYYY. Default 2:
Do you have a Preference for Fee Type?
Enter 0 for No Preference, 1 for Free Only, or 2 for Paid Only. Default 0 :
===================================================================================
Centres are available in Ahmedabad Corporation from 24-05-2021 as of 2021-05-23 09:29:10: 0
No Options Available right now. Next Update in 15 seconds..
y
or n
. If you would like to continue, provide y
and proceed to allow using same Mobile NumberToken is INVALID!
Do you want to try for a new Token? (y/n Default y): y
Enter the Registered Mobile Number: βββββββββββ
Enter OTP: βββββββββββ
When a Center with more than minimum number of Slots is available, the Program will make a Beep sound - having different frequency for different districts. It will then display the available options as shown in the Screenshot.
Before the Next Update, you'll have 10 seconds to provide a choice in the given format centerIndex.slotIndex
eg: The input1.4
will select the First Vaccination Center and its Fourth Slot.
Any contributions you make are greatly appreciated.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE
for more information.
Made with β€ by Dhruv Panchal