Home

Awesome

<p align="center"> <img src="https://cdn2.iconfinder.com/data/icons/covid-19-2/64/29-Doctor-256.png"> </p>

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

<ins>Request</ins>:

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

<ins>Response</ins>:

{
  "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 a new project to the list