Skip to content

AmreshSinha/Covid19-API

Repository files navigation

Covid19-API

Python Flask

An opensource Covid19 API (currently uses worldometer only)

Output

Examples

  • Covid19 Every Country Data

    • Request URL
      <your-ip>/api/all
      
    • Response
  • Covid19 WorldWide Summarised Data

    • Request URL
      <your-ip>/api/world
      
    • Response
  • Covid19 India Data

    • Request URL

      <your-ip>/api/country?req=ind
      

      or

      <your-ip>/api/country?req=in
      
    • Response

Usage

On VPS (Unix Based Systems)

Without Docker

  1. Clone the Repository
    • git clone https://github.com/AmreshSinha/Covid19-API
  2. Install dependencies
    • pip install -r requirements.txt
  3. Run scraper.py
    • python scraper/scraper.py
    • Note: The Scraper has a time interval of 1 hour by default
  4. Run Flask App with Gunicorn or Waitress
    • Like for waitress the waitress_server.py is there
    • python waitress_server.py
  5. If you want to host for web then update your rules in nginx accordingly and get one ssl certificate

With Docker

  1. Clone the Repository
    • git clone https://github.com/AmreshSinha/Covid19-API
  2. Build Docker Image
    • docker build -t covid19-api:1.0 .
  3. 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.
  4. To Stop the Container
    • docker container stop covid19-api-web

Contribution

There is a lot of work still remaining. Some of which:

  1. Adding more sources
  2. Cleaning Data
  3. Adding provinces covid data under their parent country.
  4. 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.

About

Covid19 API. (Currently Scrapes: worldometers)

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published