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. Supports multiple sources!
Live global stats (provided by fight-covid19/bagdes) from this API:
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.
Picking data source
We provide multiple data-sources you can pick from, simply add the query parameter ?source=your_source_of_choice
to your requests. JHU will be used as a default if you don't provide one.
Available sources:
-
jhu - https://github.com/CSSEGISandData/COVID-19 - Data repository operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE).
-
csbs - https://www.csbs.org/information-covid-19-coronavirus - U.S. County data that comes from the Conference of State Bank Supervisors.
-
... more to come later.
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
{
"latest": {
"confirmed": 272166,
"deaths": 11299,
"recovered": 87256
},
"locations": [
{
"id": 0,
"country": "Thailand",
"country_code": "TH",
"province": "",
"last_updated": "2020-03-21T06:59:11.315422Z",
"coordinates": {
"latitude": "15",
"longitude": "101"
},
"latest": {
"confirmed": 177,
"deaths": 1,
"recovered": 41
}
},
{
"id": 39,
"country": "Norway",
"country_code": "NO",
"province": "",
"last_updated": "2020-03-21T06:59:11.315422Z",
"coordinates": {
"latitude": "60.472",
"longitude": "8.4689"
},
"latest": {
"confirmed": 1463,
"deaths": 3,
"recovered": 1
}
}
]
}
Additionally, you can also filter by any attribute, including province and country (alpha-2 country_code).
GET /v2/locations?country_code=US
Include timelines.
GET /v2/locations?timelines=1
Getting a specific location (includes timelines by default).
GET /v2/locations/:id
{
"location": {
"id": 39,
"country": "Norway",
"country_code": "NO",
"province": "",
"last_updated": "2020-03-21T06:59:11.315422Z",
"coordinates": { },
"latest": { },
"timelines": {
"confirmed": {
"latest": 1463,
"timeline": {
"2020-03-16T00:00:00Z": 1333,
"2020-03-17T00:00:00Z": 1463
}
},
"deaths": { },
"recovered": { }
}
}
}
Exclude timelines.
GET /v2/locations?timelines=0
Getting US per county information.
GET /v2/locations?source=csbs
{
"latest": {
"confirmed": 7596,
"deaths": 43,
"recovered": 0
},
"locations": [
{
"id": 0,
"country": "US",
"country_code": "US",
"province": "New York",
"state": "New York",
"county": "New York",
"last_updated": "2020-03-21T14:00:00Z",
"coordinates": {
"latitude": 40.71455,
"longitude": -74.00714
},
"latest": {
"confirmed": 6211,
"deaths": 43,
"recovered": 0
}
},
{
"id": 1,
"country": "US",
"country_code": "US",
"province": "New York",
"state": "New York",
"county": "Westchester",
"last_updated": "2020-03-21T14:00:00Z",
"coordinates": {
"latitude": 41.16319759,
"longitude": -73.7560629
},
"latest": {
"confirmed": 1385,
"deaths": 0,
"recovered": 0
},
}
]
}
Wrappers
These are the available API wrappers created by the community. They are not necessarily maintained by any of this project's authors or contributors.
PHP
Golang
C#
Python
Java
Node.js
Ruby
Lua
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
flask run
- Visit your app at http://localhost:5000.
Running Tests
make test
Linting
make lint
Building
Deploying
Contributors β¨
Thanks goes to these wonderful people (emoji key):
ExpDev π» π π§ |
bjarkimg π¬ |
Bost π |
GRIBOK π» |
Oliver Thamm π |
Mauro M. π |
JKSenthil π» π |
SeanCena π» π |
Abdirahiim Yassin π |
DarΓo HereΓ±ΓΊ π |
Oliver π |
License
See LICENSE.md for the license. Please link to this repo somewhere in your project :).