Awesome
covid19-eu-data-api
Structure of the Project
- GitHub Actions pulls data from the raw data repo (
covid19-eu-zh/covid19-eu-data
) and saves a copy indataset
. - GitHub Actions transformed the data into clean json files and save them in
api/db/
. - 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.
- Start up a local server
- Serverless Functions
Local server
cd server
yarn
yarn start
- 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