Skip to content

Covid-19-Response-Greece/covid19-greece-api

Repository files navigation

Coronavirus Tracker API for Greece

This repository provides an API with real-time data about the Coronavirus (COVID-19) outbreak in Greece.

API page: https://covid-19-greece.herokuapp.com

This project is performed by volunteers of COVID-19 Response Greece.

Documentation

API documentation can be found here.

Example

All the endpoints are located at https://covid-19-greece.herokuapp.com/ and are accessible via https.

Example: Get the number of confirmed cases as timeseries

Querying

Request:

You can visit https://covid-19-greece.herokuapp.com/confirmed via a browser or run the following command:

curl https://covid-19-greece.herokuapp.com/confirmed | json_pp

Response:

{
  "cases": [
    {
      "date": "2020-01-22",
      "confirmed": 0
    },
    {
      "date": "2020-01-23",
      "confirmed": 0
    },
    ...
  ]
}   

Javascript

let url = "https://covid-19-greece.herokuapp.com/confirmed"

let response = await fetch(url);

if (response.ok) // if HTTP-status is 200-299
{ 
    // get the response body 
    let json = await response.json();
    console.log(json)
} 
else 
{
    alert("HTTP-Error: " + response.status);
}

Python

import requests

url = "https://covid-19-greece.herokuapp.com/confirmed"
response = requests.get(url)

print(response.json())

Data sources

This API combines data from multiple sources. All data are fetched from here and updated 3 times a day using Github Actions.

Requirements

Run the following command to install depedencies:

pip install -r requirements.txt 

How to run locally

python app.py

How to test locally

Example: Get the number of confirmed cases

Request:

curl -v localhost:5000/confirmed

Projects & Organizations utilizing Coronavirus Greece API (+ add yours!)

Adding your project to the list

If your project/organization utilizes the Coronavirus Greece API, you are kindly asked to place it here, under the following rules:

  • Add only open source projects.
  • Make sure to cite this repo under your project as a source (together with a link).
  • Follow the same order as in the rest of the list * [project_or_organization-name](project_or_organizatio-url) ([repo](repo-url)): description
  • Be careful to conform with the existing text formatting.

👉 Add a new project to the list