├── ding-sound.mp3 ├── README.md └── Cowin_Slots.py /ding-sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hetshah25/Cowin_Slots_Checker/HEAD/ding-sound.mp3 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cowin_Slots_Checker 2 | Automated Python Script to retrieve vaccine slots availability and get notified when a slot is available. 3 | 4 | pre requisite 5 | pip install playsound 6 | 7 | Full Explanation on Youtube - https://youtu.be/CItBkXVMLw4 8 | -------------------------------------------------------------------------------- /Cowin_Slots.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import time 3 | from playsound import playsound 4 | dist = 770 5 | date = '26-05-2021' 6 | URL = 'https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict?district_id={}&date={}'.format( 7 | dist, date) 8 | 9 | header = { 10 | 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36'} 11 | 12 | 13 | def findAvailability(): 14 | counter = 0 15 | result = requests.get(URL, headers=header) 16 | response_json = result.json() 17 | data = response_json["sessions"] 18 | for each in data: 19 | if((each["available_capacity"] > 0) & (each["min_age_limit"] == 18)): 20 | counter += 1 21 | print(each["name"]) 22 | print(each["pincode"]) 23 | print(each["vaccine"]) 24 | print(each["available_capacity"]) 25 | playsound('C:/Users/Het/Desktop/ding-sound.mp3') 26 | return True 27 | if(counter == 0): 28 | print("No Available Slots") 29 | return False 30 | 31 | 32 | while(findAvailability() != True): 33 | time.sleep(5) 34 | findAvailability() 35 | --------------------------------------------------------------------------------