REST API to track Coronavirus cases in India on state level
COVID 19 India States Data API
Coronavirus is shaking the world 🌍. At such crucial times, the purity of data is to be maintained. Govt. of India hasn't released an official API yet. This API scraps data from Official Website of Ministry of Health and Family Welfare ✔️ and exposes them as a REST API at https://covid-india-api.herokuapp.com/v1/api
URL: https://covid-19-apis.postman.com/
cURL Command:
curl --request GET "https://covid-india-api.herokuapp.com/v1/api"
git clone https://github.com/udaya2899/covid-india-api.git
cd covid-india-api
pip install -r requirements.txt
python app.py
- 🐍 Python 3
- 🍶 Flask - REST GET Implementation
- 🍲 BeautifulSoup - Web Scraping
- ➡️ JSON - Data Serialization
- 🔯 Heroku - Deployment
Refer to requirements.txt
for full list of requirements
beautifulsoup4==4.8.2
Flask==1.1.1
python-dateutil==2.8.1
requests==2.23.0
Sample data from Ministry of Health and Family Welfare, Govt. of India (link)
Sample API Response obtained from https://covid-india-api.herokuapp.com/v1/api
{
"data": {
"state_data": [
{
"id": "1",
"place": "Andhra Pradesh",
"confirmed_indian": "14",
"confirmed_foreign": "0",
"cured": "1",
"deaths": "0"
},
{
"id": "2",
"place": "Andaman and Nicobar Islands",
"confirmed_indian": "6",
"confirmed_foreign": "0",
"cured": "0",
"deaths": "0"
},
.
.
.
{
"id": "27",
"place": "West Bengal",
"confirmed_indian": "15",
"confirmed_foreign": "0",
"cured": "0",
"deaths": "1"
}
]
"total_data": {
"confirmed_indian": "862",
"confirmed_foreign": "47 ",
"cured": "80",
"deaths": "19"
},
"last_updated": "2020-03-28 17:45:00"
}
}
}
Pull requests are welcomed to make changes. To make drastic changes, open an issue to discuss.
Mail me at [email protected] for further queries