This is a simple serverless application that helps you check the slot availability for any age using the CoWIN open APIs
The script uses Lambda with Python 3.8 environment and an active SNS Topic to send you the alerts. You can trigger the lambda function using CloudWatch Events (EventBridge) to run at specific intervals.
Requirements:
- Lambda needs a role to allow permissions to publish to SNS topic.
- SNS Email Subscription needs to be confirmed.
- Lambda Memory: 128 MB
- Lambda Duration: 15 sec
Lambda Role Policy: { "Version": "2012-10-17", "Statement": [ { "Sid": "Stmt1620068379252", "Action": [ "sns:Publish" ], "Effect": "Allow", "Resource": "arn:aws:sns::<account_ID>:<topic_name>" } ] }
Customization: You can customize the script as per your location and requirements:
- districtCode: You can add the district code for your district by looking it up on the link provided here: https://apisetu.gov.in/public/marketplace/api/cowin#/Appointment%20Availability%20APIs/findByDistrict
- age: Set the age 18 or 45
- pincodeFirstCharacters: This is an additional filter which I have added to filter slots near to your location. This is added so that the rural pincodes are filtered out. First four characters are matched. You can customize it by changing the number of characters on line 42 of the lambda_function.py file
- topicArn: You can add your own SNS Topic ARN here to receive alerts. Make sure the Topic type is Standard and subscription is added and confirmed (for email)
Feel free to get in touch with me if you need any assistance.