Skip to content

covid19-eu-zh/covid19-eu-data-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covid19-eu-data-api

Structure of the Project

  1. GitHub Actions pulls data from the raw data repo (covid19-eu-zh/covid19-eu-data) and saves a copy in dataset.
  2. GitHub Actions transformed the data into clean json files and save them in api/db/.
  3. The code in api folder serves the API.

Development

The API source code is located inside the api folder. There are two ways to access access the api.

  1. Start up a local server
  2. Serverless Functions

Local server

  1. cd server
  2. yarn
  3. yarn start
  4. Validate the results: http://localhost:3001

There are 2 endpoints available.

List all countries

/country

Get data from specific country

// alpha2 ex: at, fr, de... etc 
countries/:alpha2

Serverless functions

The API is hosted on Vercel.com. The 2 endpoints available are:

List all countries and their corresponding alpha

https://covid19-eu-data-api-gamma.now.sh/api/countryLookup

Get data from specific country

By default the last 30 days of data is returned if not specified otherwise.

// alpha2 ex: at, fr, de... etc 
// optional query param: days
https://covid19-eu-data-api-gamma.now.sh/api/countries?alpha2=de&days=1