Skip to content

Latest commit

 

History

History
91 lines (65 loc) · 2.37 KB

README.md

File metadata and controls

91 lines (65 loc) · 2.37 KB

WEB API COVID19 MALAYSIA

MOH CITF

1. To run locally in Python3 environment

Run:

$ pip3 install -r requirements.txt
$ python3 wsgi.py

2. To run locally in Docker

Run:

$ docker build -t apicovidmy .
$ docker run -p 5000:5000 -d apicovidmy .

3. Query

Category Fields Query
index None None
epidemic cases, deaths, tests, hospital start_date, end_date, *state
vaccination registration, progress start_date, end_date, state

Available states:

  • Johor
  • Kedah
  • Kelantan
  • Melaka
  • Negeri Sembilan
  • Pahang
  • Perak
  • Perlis
  • Pulau Pinang
  • Sabah
  • Sarawak
  • Selangor
  • Terengganu
  • W.P. Kuala Lumpur
  • W.P. Labuan
  • W.P. Putrajaya

Check out:

CURL-X POST -H "Content-Type: application/json" https://api-covidmy.onrender.com//category

4. Access data using GET request

Fetching epidemic category data example:

https://api-covidmy.onrender.com//epidemic/cases?state=Selangor&start_date=2021-01-02&end_date=2021-01-05

Fetching vaccination category data example:

https://api-covidmy.onrender.com//vaccination/registration?state=Selangor&start_date=2021-06-02&end_date=2021-07-05

5. Access data using JSON POST request

Fetching epidemic category data example:

CURL-X POST -H "Content-Type: application/json" -d '{"start_date": "2021-02-03", "end_date": "2021-07-05", "state": "Selangor"}' https://api-covidmy.onrender.com//epidemic/cases

Fetching vaccination category data example:

CURL -X POST -H "Content-Type: application/json" -d '{"start_date": "2021-02-03", "end_date": "2021-07-05", "state": "Selangor"}'  https://api-covidmy.onrender.com//vaccination/progress

6. Render Web Service

render