api

command module
Version: v0.0.0-...-436ab10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 7 Imported by: 0

README

COVID 19 Data REST API for South Africa

A RESTful API to expose the COVID 19 Data for South Africa created, maintained and hosted by DSFSI research group at the University of Pretoria

Running the project

Before running the project API, you should set the PORT environmental variable on your computer (e.g. PORT=1323)

# Run
cd covid19za/api
go run main.go

# API Endpoint : http://127.0.0.1:1323

API

The hosted API can be found on https://covid-za-api.herokuapp.com.

Authentication

There's no authentication required. Anybody and everybody is welcome to use this widely.

Rate limit

There is no rate limit of any kind but we hope that you use it in a sensible manner and whenever possible cache response for a few hours.

Endpoints
/latest-update
  • GET : Get the timestamp of the latest update to the data
/cases/confirmed
  • GET : Get all confirmed cases
/cases/confirmed?province={province}
  • GET : Get all confirmed cases in a province
/cases/deaths
  • GET : Get all reported deaths
/cases/deaths?province={province}
  • GET : Get all reported deaths in a province
/cases/timeline/tests
  • GET : Get test timeline data
/cases/timeline/provincial/cumulative
  • GET : Get cumulative provincial timeline data
/hospitals/public
  • GET : Get public hospitals
/hospitals/private
  • GET : Get private hospitals
Example Usage

You can get the confirmed cases by performing a GET request to:

https://covid-za-api.herokuapp.com/cases/confirmed

You can get the confirmed cases in Gauteng (GP) by performing a GET request to:

https://covid-za-api.herokuapp.com/cases/confirmed?province=GP

Todo

  • Expose an endpoint to get all confirmed cases.
  • Allow filtering by province on the confirmed cases endpoint.
  • Expose an endpoint to get test timeline data.
  • Expose an endpoint to get all fatalities (reported deaths).
  • Allow filtering by province on the fatalities endpoint.
  • Expose an endpoint to get all available hospitals.
  • Allow filtering by province on the hospitals endpoint.

Issues

  • Expose an endpoint to get provincial cumulative timeline data [Issue #122].

Documentation

The Go Gopher

There is no documentation for this package.

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto