Covid19-API
An opensource Covid19 API (currently uses worldometer only)
Output
Examples
-
Covid19 Every Country Data
- Request URL
<your-ip>/api/all
- Response
- Request URL
-
Covid19 WorldWide Summarised Data
- Request URL
<your-ip>/api/world
- Response
- Request URL
-
Covid19 India Data
-
Request URL
<your-ip>/api/country?req=ind
or
<your-ip>/api/country?req=in
-
Usage
On VPS (Unix Based Systems)
Without Docker
- Clone the Repository
git clone https://github.com/AmreshSinha/Covid19-API
- Install dependencies
pip install -r requirements.txt
- Run
scraper.py
python scraper/scraper.py
- Note: The Scraper has a time interval of 1 hour by default
- Run Flask App with Gunicorn or Waitress
- Like for waitress the
waitress_server.py
is there python waitress_server.py
- Like for waitress the
- If you want to host for web then update your rules in nginx accordingly and get one ssl certificate
With Docker
- Clone the Repository
git clone https://github.com/AmreshSinha/Covid19-API
- Build Docker Image
docker build -t covid19-api:1.0 .
- Run Container
docker container run --name covid19-api-web -p 80:80 covid19-api:1.0
- The container will start running with PORT 80 exposed to Public.
- To Stop the Container
docker container stop covid19-api-web
Contribution
There is a lot of work still remaining. Some of which:
- Adding more sources
- Cleaning Data
- Adding provinces covid data under their parent country.
- Making our own pycountry module fork according to our needs.
For Extra features (other than the above) you want to contribute, open an issue first.