/covid-19-api

Novel Coronavirus 2019 API. Maintained itself every 12 hours

Primary LanguageJavaScriptMIT LicenseMIT

COVID 19 API

Buy Me A Coffee donate button

Novel Coronavirus 2019 API.

Env Variables default

DB_HOST='mysql-server-covid19'
DB_PORT=3306
DB_USER='root'
DB_PASSWORD='covid-19'
DB_DATABASE='covid19'

Endpoints

Endpoint Description Query Params Response Type
/ Default Endpoint None JSON
/countries Return historic data for countries [Date/date] : Format YYYY-MM-DD ; [Country/country]: Format String JSON
/worldwide Return historic data for the worldwide [Date/date] : Format YYYY-MM-DD JSON

Response Schemas

Worldwide schema

    {
        "date": String, // UTC Date
        "confirmed": Number,
        "recovered": Number,
        "deaths": Number
    }

Countries Schema

    {
        "date": String, // UTC Date
        "country": String,
        "confirmed": Number,
        "recovered": Number,
        "deaths": Number
    }

Source

Novel Coronavirus 2019 time series data on cases: https://github.com/datasets/covid-19

This dataset is populated from:

Database

Schema

Country Dataset

CREATE TABLE dataset (
    id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
    dt_reported TIMESTAMP NOT NULL,
    dt_creation TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    dt_updated TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    ds_country VARCHAR(100) NOT NULL,
    confirmed INT NOT NULL,
    recovered INT NOT NULL,
    deaths INT NOT NULL,
    UNIQUE KEY(ds_country,dt_reported) 
);

Worldwide Dataset

CREATE TABLE worldwide (
    id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
    dt_reported TIMESTAMP NOT NULL,
    dt_creation TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    dt_updated TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    confirmed INT NOT NULL,
    recovered INT NOT NULL,
    deaths INT NOT NULL,
    increase_rate DOUBLE NOT NULL
);

AutoPatcher

This worker will mantain upated the dataset in the mysql database.

Env Variables default

DATA_URI='https://raw.githubusercontent.com/datasets/covid-19/master/data/'
DB_HOST='mysql-server-covid19'
DB_PORT=3306
DB_USER='root'
DB_PASSWORD='covid-19'Î
DB_DATABASE='covid19'
CRON_SCHEDULE='0 */12 * * *'