Skip to content

๐Ÿฆ  A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the ๐Ÿผ Flask framework.

Notifications You must be signed in to change notification settings

whitehat007/coronavirus-tracker-api

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

coronavirus-tracker (API)

This is a fast (< 200ms) and basic API for tracking development of the new coronavirus (COVID-19, SARS-CoV-2). It's written in python using ๐Ÿผ Flask.

All Contributors GitHub stars GitHub forks GitHub last commit GitHub pull requests GitHub issues Tweet

Endpoints

All requests must be made to the base url: https://coronavirus-tracker-api.herokuapp.com/v2/ (e.g: https://coronavirus-tracker-api.herokuapp.com/v2/locations). You can try them out in your browser to further inspect responses.

Getting latest amount of total confirmed cases, deaths, and recoveries.

GET /v2/latest
{
  "latest": {
    "confirmed": 197146,
    "deaths": 7905,
    "recovered": 80840
  }
}

Getting all locations.

GET /v2/locations
{
  "locations": [
    {
      "id": 0,
      "country": "Thailand",
      "country_code": "TH",
      "province": "",
      "coordinates": {
        "latitude": "15",
        "longitude": "101"
      },
      "latest": {
        "confirmed": 177,
        "deaths": 1,
        "recovered": 41
      }
    },
    {
      "id": 39,
      "country": "Norway",
      "country_code": "NO",
      "province": "",
      "coordinates": {
        "latitude": "60.472",
        "longitude": "8.4689"
      },
      "latest": {
        "confirmed": 1463,
        "deaths": 3,
        "recovered": 1
      }
    }
  ]
}

Additionally, you can also filter by country (alpha-2 country_code).

GET /v2/locations?country_code=US

Include timelines.

GET /v2/locations?country_code=US&timelines=true

Getting a specific location (includes timelines by default).

GET /v2/locations/:id
{
  "location": {
      "id": 39,
      "country": "Norway",
      "country_code": "NO",
      "province": "",
      "coordinates": { },
      "latest": { },
      "timelines": {
        "confirmed": {
          "latest": 1463,
          "timeline": {
            "2020-03-16T00:00:00Z": 1333,
            "2020-03-17T00:00:00Z": 1463
          }
        },
        "deaths": { },
        "recovered": { }
      }
    }
  }
}

Data

The data comes from the 2019 Novel Coronavirus (nCoV) Data Repository, provided by JHU CCSE. It is programmatically retrieved, re-formatted and stored in the cache for one hour.

Wrappers

These are the available API wrappers created by the community. They are not neccecarily maintained by any of this project's authors or contributors.

Java

Node.js

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone https://github.com/ExpDev07/coronavirus-tracker-api.git
  • cd coronavirus-tracker-api
  • pipenv shell
  • pipenv install

Running / Development

Running Tests

  • py.test -s -v tests/

Linting

  • pylint app/

Building

Deploying

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


ExpDev

๐Ÿ’ป ๐Ÿ“– ๐Ÿšง

bjarkimg

๐Ÿ’ฌ

Bost

๐Ÿ“–

GRIBOK

๐Ÿ’ป โš ๏ธ

License

The data is available to the public strictly for educational and academic research purposes. Please link to this repo somewhere in your project :).

About

๐Ÿฆ  A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the ๐Ÿผ Flask framework.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%