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 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.
We provide multiple data-sources you can pick from, simply add the query paramater ?source=your_source_of_choice to your requests. JHU will be used as a default if you don't provide one.
-
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 - US County data comes from Conference of State Bank Supervisors
-
... more to come later.
GET /v2/latest{
"latest": {
"confirmed": 197146,
"deaths": 7905,
"recovered": 80840
}
}GET /v2/locations{
"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 country (alpha-2 country_code).
GET /v2/locations?country_code=USInclude timelines.
GET /v2/locations?timelines=1GET /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=0GET /v2/locations?source=csbs{
"locations": [
{
"coordinates": {
"latitude": 40.71455,
"longitude": -74.00714
},
"country": "US",
"country_code": "US",
"county": "New York",
"id": 0,
"last_updated": "2020-03-21 14:00 EDT",
"latest": {
"confirmed": 6211,
"deaths": 43,
"recovered": 0
},
"province": "New York",
"state": "New York"
},
{
"coordinates": {
"latitude": 41.16319759,
"longitude": -73.7560629
},
"country": "US",
"country_code": "US",
"county": "Westchester",
"id": 1,
"last_updated": "2020-03-21 14:00 EDT",
"latest": {
"confirmed": 1385,
"deaths": 0,
"recovered": 0
},
"province": "Westchester",
"state": "New York"
},
...
]
}
## 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.
### Golang
* [Go-corona by @itsksaurabh](https://github.com/itsksaurabh/go-corona).
### C#
* [Coronavirus tracker API Wrapper by @Abdirahiim](https://github.com/Abdirahiim/covidtrackerapiwrapper).
### Python
* [COVID19Py by @Kamaropoulos](https://github.com/Kamaropoulos/COVID19Py).
### Java
* [Coronavirus by @mew](https://github.com/mew/Coronavirus).
### Node.js
* [jhucsse.covid by @Sem1084](https://www.npmjs.com/package/jhucsse.covid).
### Ruby
* [covid19-data-ruby by @jaerodyne](https://github.com/jaerodyne/covid19-data-ruby).
### Lua
* [lua-covid-data by @imolein](https://codeberg.org/imo/lua-covid-data).
## Prerequisites
You will need the following things properly installed on your computer.
* [Python 3](https://www.python.org/downloads/) (with pip)
* [Flask](https://pypi.org/project/Flask/)
* [pipenv](https://pypi.org/project/pipenv/)
## 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](http://localhost:5000).
### Running Tests
* `make test`
### Linting
* `make lint`
### Building
### Deploying
## Contributors β¨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/ExpDev07"><img src="https://avatars3.githubusercontent.com/u/10024730?v=4" width="100px;" alt=""/><br /><sub><b>ExpDev</b></sub></a><br /><a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=ExpDev07" title="Code">π»</a> <a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=ExpDev07" title="Documentation">π</a> <a href="#maintenance-ExpDev07" title="Maintenance">π§</a></td>
<td align="center"><a href="https://github.com/bjarkimg"><img src="https://avatars2.githubusercontent.com/u/1289419?v=4" width="100px;" alt=""/><br /><sub><b>bjarkimg</b></sub></a><br /><a href="#question-bjarkimg" title="Answering Questions">π¬</a></td>
<td align="center"><a href="https://github.com/Bost"><img src="https://avatars0.githubusercontent.com/u/1174677?v=4" width="100px;" alt=""/><br /><sub><b>Bost</b></sub></a><br /><a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=Bost" title="Documentation">π</a></td>
<td align="center"><a href="https://github.com/gribok"><img src="https://avatars1.githubusercontent.com/u/40306040?v=4" width="100px;" alt=""/><br /><sub><b>GRIBOK</b></sub></a><br /><a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=gribok" title="Code">π»</a> <a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=gribok" title="Tests">β οΈ</a></td>
<td align="center"><a href="https://github.com/oliver-xapix-io"><img src="https://avatars0.githubusercontent.com/u/13470858?v=4" width="100px;" alt=""/><br /><sub><b>Oliver Thamm</b></sub></a><br /><a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=oliver-xapix-io" title="Documentation">π</a></td>
<td align="center"><a href="https://maurom.dev"><img src="https://avatars1.githubusercontent.com/u/22800592?v=4" width="100px;" alt=""/><br /><sub><b>Mauro M.</b></sub></a><br /><a href="https://github.com/ExpDev07/coronavirus-tracker-api/commits?author=MM-coder" title="Documentation">π</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
## License
The data is available to the public strictly for educational and academic research purposes. Please link to this repo somewhere in your project :).