sean-b765 / covid-api

Find current or historical COVID-19 data. Uses JHU and OWID GitHub repositories as source.
0 stars 0 forks source link

COVID-19 API

NOTE Demo no longer working because heroku free tiers discontinued

Uses latest data from John Hopkins University. Historical data is pulled from the OWID repository, which collates all the previous dates into one CSV file. Current data is pulled from JHU's repository.

A worker thread is used to perform daily updates. Due to the free heroku plan idling when no activity is detected, these updates occur when the service is started. Your response may contain outdated data while the worker thread updates the database.

List all Locations

Some listings (e.g. Bermuda) are provinces belonging to a larger territory. Current data does not list Bermuda, as it is a province of the United Kingdom

https://covid-history.herokuapp.com/locations

Historical data

Use (almost) all options from /locations route, or continents, or World e.g.

https://covid-history.herokuapp.com/history/World

https://covid-history.herokuapp.com/history/North%20America

https://covid-history.herokuapp.com/history/India

type response = [
    {
        location: string
        data: [
            {
                date: string
                new_cases: string
                new_deaths: string
                total_cases: string
                total_deaths: string
                weekly_cases: string
                weekly_deaths: string
                biweekly_cases: string
                biweekly_deaths: string
            }
        ]
    }
]

Current data

Will return a total for the country, as well as all provinces (if data exists) e.g.

https://covid-history.herokuapp.com/current/Australia

https://covid-history.herokuapp.com/current/United%20Kingdom

type response = [
    {
        location: string
        provinces: [
            {
                county: string
                zip: string
                state: string
                lat: string
                lng: string
                cumulative: string
                deaths: string
                recovered: string
            }
        ]
        lat: string
        lng: string
        cumulative: string
        deaths: string
        recovered: string
    }
]