Covid-19 Vaccine Availability Checker
Flask | COVID-19 REST API API | Cowin API | Plotly

I am Developer, Artist and trying my luck on blogging as well. Well I am Ambitious, Passionate towards Learning, The Night Owl, And I Like challenges...
Search for a command to run...
Flask | COVID-19 REST API API | Cowin API | Plotly

I am Developer, Artist and trying my luck on blogging as well. Well I am Ambitious, Passionate towards Learning, The Night Owl, And I Like challenges...
No comments yet. Be the first to comment.
Post #2 in the Complete Prompt Engineering Series Welcome back! In What is Prompt Engineering? A Complete Introduction, you learned what prompt engineering is and why it matters. Now we're going deeper: understanding the engine under the hood. You do...

Welcome to the future of human-AI collaboration. If you're reading this in 2024-2025, you're witnessing a fundamental shift in how humans interact with machines—and prompt engineering is your passport to this new world. The Definition: What Exactly I...
In this post, we’ll walk through the anatomy of a great prompt, illustrate every step with vivid examples, and even peek under the hood to see what happens technically when you hit “send.” By the end, you’ll be able to craft prompts that unlock the f...

What is GenAI and Why Does Prompting Matter? If you’ve ever wondered how people interact with AI tools, or why some folks seem to get exactly what they want from tools like ChatGPT while others receive confusing or generic responses, this article is ...

Let’s be honest—being a developer isn’t just about writing code. It’s about solving problems, dealing with burnout, handling meetings, chasing deadlines, and finding time to learn, debug, and ship. But in the middle of this chaos, one simple habit ca...

Since Government has announced Vaccination registration for people above +18 Age, People are facing issues booking slots and struggling with OTPs on government websites and apps. So many developers took an oath to solve this issue for the normal people. Nowadays you can find many GitHub repositories that talk or teach about how can we leverage government-provided official APIs to solve their issues. But my question is normal people want a solution, which they can easily access from anywhere without digging into codes, packages, libraries, etc. So how can we give something to them without making them tangled in scripts and codes? People need one-click solutions so I have decided to make something useful that can tackle these problems. Maybe this type of platform has already been published by someone somewhere. But I believe it's better to have multiple platforms rather than having a single one. for example, let suppose in your area there is only one hospital and your area is suffering from a plague then there will be a rush in the hospital and hospital authorities will not be able to handle the situation, and here every second count. And if there are multiple hospitals then the load will be less and people get the treatments on time and nobody has to die due to lack of resources. Similarly, if we have multiple platforms then everyone gets the solutions they are seeking for.
Covidash India, named so because it provides a dashboard related to Covid-19 effects & its statistics. This provides data like Daily cases country-wise stats, Cases per state stats, Hospitals and beds available per state, medical colleges & admission capacities per state, Helplines, Notification & Advisories sourced from Ministry of Health and family welfare. And data like Available centers & slots based on the district and Pincode by Cowin Govt. API.
you can check the website from this link

$ git clone https://github.com/d-evil0per/coviddash
covidash directory cd covidash
C:.
│ app.py
│ app.yaml
│ Procfile
│ README.md
│ requirements.txt
│ wsgi.py
│
├───API
│ api.py
│ base_api.py
│ constants.py
│ utils.py
│
├───static
│ ├───css
│ │ news.css
│ │ Social-Icons.css
│ │ styles.css
│ │
│ └───js
│ bs-init.js
│ filter.js
│ main.js
│ script.min.js
│
└───templates
index.html
sitemap.xml
Python flask Framework has been used as a backend for this project you can use PHP, Node, etc as per your choice.
Bootstrap 4 has been used as front-end, you can also use React, Angular, etc
Cowin API - Check the official website Open APIs
COVID-19 REST API - check the API sourced from Ministry of Health and family welfare
You need to install all the required libraries used in this project. You can find the requirements.txt file in the root directory of this project.
Check Creating Virtual Environment in Python blog to install Virtual environment in python.
pip install -r requirements.txt
Windows
py wsgi.py
Linux & MacOS
python3 wsgi.py
if you want to use the Cowin API these are the things you should keep in mind.
header with the user-agent attribute as shown below. {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}fake_useragent library in python. it provides a nice abstraction layer over user agents.
from fake_useragent import UserAgent
user_agent = UserAgent()For example, Let's Grab the center details using Pincode and Date using Cowin findByPin API
from typing import Union
import requests
from requests.exceptions import HTTPError
import json
url="https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin?pincode=831001&date=31-03-2021"
def call_api(url) -> Union[HTTPError, dict]:
# user_agent = UserAgent()
# headers = headers={'User-Agent': user_agent }
headers = headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url, headers=headers)
try:
response.raise_for_status()
except requests.exceptions.HTTPError as e:
return e
return response.json()
response= call_api(url)
print(json.dumps(response,indent = 4))
{
"sessions": [
{
"center_id": 627226,
"name": "ASG Hospital Covishield",
"address": "",
"state_name": "Jharkhand",
"district_name": "East Singhbhum",
"block_name": "Jugalsalai Sah Golmu",
"pincode": 831001,
"from": "19:30:00",
"to": "14:30:00",
"lat": 22,
"long": 86,
"fee_type": "Paid",
"session_id": "735811ed-f841-49e4-b129-62ac7e9fef37",
"date": "31-03-2021",
"available_capacity_dose1": 0,
"available_capacity_dose2": 0,
"available_capacity": 100,
"fee": "0",
"min_age_limit": 45,
"vaccine": "COVISHIELD",
"slots": []
}
]
}
Now Let's check the same Code without passing header data
from typing import Union
import requests
from requests.exceptions import HTTPError
import json
url="https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin?pincode=831001&date=31-03-2021"
def call_api(url) -> Union[HTTPError, dict]:
response = requests.get(url)
try:
response.raise_for_status()
except requests.exceptions.HTTPError as e:
return e
return response.json()
response= call_api(url)
print(response))
403 Client Error: Forbidden for url: https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin?pincode=831001&date=31-03-2021
Cowin API. Please keep this in mind if you are using any server hosted in other regions except India then you will not be able to call the API and it will give you the 403 Access Forbidden Error.