Access COVID-19 data

Data is of the essence in crisis situations. Rejustify has enabled access to coronavirus disease (COVID-2019) data through its API. The data sources we support include:

  1. 2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE (see on the map),
  2. worldwide situation updates by the European Centre for Disease Prevention and Control,
  3. the daily situation reports of the World Health Organization scrapped by Our World in Data (discontinued on 17th March 2020).

The tables are tagged COVID-19-CSSE, COVID-19-ECDC and COVID-19-WHO, and allow for all AI functionality offered by rejustify. Below we demonstrate an easy example to quickly access the data in R in three steps.

1. Package installation and setup

Firstly, make sure you have the most recent version of the API, available at github, and setup up you access rights.

install.packages("remotes") #just in case
remotes::install_github("rejustify/r-package")
library(rejustify)
setCurl()
register(token = "YOUR_TOKEN", email = "YOUR_EMAIL")

2. Design your data canvas

Secondly, design your data structure. In the example below, we will rejustify daily data of total infections in Italy, in the first two weeks of March 2020.

days <- seq(as.Date("2020-3-1"), as.Date("2020/3/13"), "days")
days <- format(days, format = "%d %b, %Y") #optional
df   <- data.frame(days = days,
                   country = rep("Italy", length(days)),
                   covid = NA,
                   check.names = FALSE, stringsAsFactors = FALSE)

3. Rejustify

Thirdly, let rejustify do the rest.

st  <- analyze(df)
rdf <- fill(df, st)

Original data set

         days country covid
 01 Mar, 2020   Italy    NA
 02 Mar, 2020   Italy    NA
 03 Mar, 2020   Italy    NA
 04 Mar, 2020   Italy    NA
 05 Mar, 2020   Italy    NA
 06 Mar, 2020   Italy    NA
 07 Mar, 2020   Italy    NA
 08 Mar, 2020   Italy    NA
 09 Mar, 2020   Italy    NA
 10 Mar, 2020   Italy    NA
 11 Mar, 2020   Italy    NA
 12 Mar, 2020   Italy    NA
 13 Mar, 2020   Italy    NA

Rejustified data set

         days country covid
 01 Mar, 2020   Italy  1128
 02 Mar, 2020   Italy  1689
 03 Mar, 2020   Italy  2036
 04 Mar, 2020   Italy  2502
 05 Mar, 2020   Italy  3089
 06 Mar, 2020   Italy  3858
 07 Mar, 2020   Italy  4636
 08 Mar, 2020   Italy  5883
 09 Mar, 2020   Italy  7375
 10 Mar, 2020   Italy  9172
 11 Mar, 2020   Italy 10149
 12 Mar, 2020   Italy 12462
 13 Mar, 2020   Italy 15113

More functionality of the API is described in our R package documentation. The full list of our resources, including data providers and tables, can be found in our repository browser.