/covid-africa-api

Primary LanguagePythonMIT LicenseMIT

Covid-Africa API

Requirements

  • Python 3.4 +
  • OpenSSL (latest version)
  • Pip
  • Masonite
  • Masonite-api
  • virtualenv

Setup

craft install
craft run serve

If you are stuck here, refer to this article to better understand how to setup your masonite development environment.

Run the project locally

First, configure your database environment. Refer to the official documentation.

craft migrate
craft schedule:run --task UpdateAfricaData
craft schedule:run --task UpdateCountryData

Theses tasks will insert the data in your database. The next step now is to update your database. Check here to see how to do it.

How to use the API :

GET Country

Return the name of the country, the number of cases, death and recovered.

http://covidafrica-api.herokuapp.com/api/africa/countries/:country

Example

curl --request GET 'https://covidafrica-api.herokuapp.com/api/africa/countries/Benin'

GET countries

Return the list of every african Country with name, and case, death and recovered numbers.

http://covidafrica-api.herokuapp.com/api/africa/countries

Example

curl --request GET 'https://covidafrica-api.herokuapp.com/api/africa/countries'

GET historical Africa

Return a list of object containing the date (since 2019-12-31) with the number of cases and deaths; and the new case and new deaths of that day.

http://covidafrica-api.herokuapp.com/api/africa/

Example

curl --request GET 'https://covidafrica-api.herokuapp.com/api/africa/'

GET Date Africa

Return the number of cases, new cases, deaths and new deaths of the requested date. Be sure the date is between 2019-12-31 and yesterday date.

http://covidafrica-api.herokuapp.com/api/africa/dates/:YYYY-MM-DD

Example

curl --request GET 'https://covidafrica-api.herokuapp.com/api/africa/date/2020-01-30'

Maintainers

Contribution

If you're new to contributing to Open Source on Github, this guide can help you get started. Please check out the contribution guide for more details on how issues and pull requests work.