Check for available CoWIN vaccination slots just by using your WhatsApp
Yes you read it right, you can check the availability of vaccination drive just by putting up your pin code. 💉
Motivation for building such script? 🤔
The website https://www.cowin.gov.in/ sometimes suffers heavy load in such times due to obvious reasons, so instead of loading all the unnecessary web content along with the crucial API data , I trimmed out the data part from https://apisetu.gov.in/public/marketplace/api/cowin/cowin-public-v2 , an open source API , and integrated with configured Twilio’s WhatsApp sandbox and ngrox.
Some briefs introductions about components: ⚙️🔧
Flask : Flask is a micro web framework of Python that allows us to build up web-applications. Used for fetching and filtering out important data from aforementioned API.
ngrok : ngrok allows you to expose a web server running on your local machine to the internet. Just tell ngrok what port your web server is listening on. Then its easy to make ngrok to listen to port 5000 ( on which Flask is running )
Twilio : For displaying the above obtained data to your WhatsApp chat , using twilio for seems to be more convenient to me. You can easily configure the sandbox for WhatsApp using this tutorial : https://www.twilio.com/docs/whatsapp/sandbox
After setting all things up. Things started to came out pretty neat.
I implemented the logic in the bot to only show available vaccination slots corresponding to entered 6 digit existing pin code (as Indian standards). Anything more or less, it would throw a readable error.
If you find this useful , please give it a 👏🏽 .
Thanks 😁
git repo : https://github.com/ashutosh2205x/vaccination-slot