Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## Coronavirus Tracker API
<h1 align="center">
Coronavirus Tracker API
</h1>

Provides up-to-date data about Coronavirus outbreak. Includes numbers about confirmed cases, deaths and recovered.
Support multiple data-sources.

Expand All @@ -18,6 +21,10 @@ Support multiple data-sources.
![Covid-19 Recovered](https://covid19-badges.herokuapp.com/recovered/latest)
![Covid-19 Deaths](https://covid19-badges.herokuapp.com/deaths/latest)

## Recovered cases showing 0

**JHU (our main data provider) [no longer provides data for amount of recoveries](https://github.com/ExpDev07/coronavirus-tracker-api/issues/155), and as a result, the API will be showing 0 for this statistic. Apolegies for any inconvenience. Hopefully we'll be able to find an alternative data-source that offers this.**

## Available data-sources:

Currently 2 different data-sources are available to retrieve the data:
Expand All @@ -28,7 +35,6 @@ Currently 2 different data-sources are available to retrieve the data:

__jhu__ data-source will be used as a default source if you don't specify a *source parameter* in your request.


## API Reference

All endpoints are located at ``coronavirus-tracker-api.herokuapp.com/v2/`` and are accessible via https. For instance: you can get data per location by using this URL:
Expand All @@ -40,7 +46,6 @@ You can open the URL in your browser to further inspect the response. Or you can
curl https://coronavirus-tracker-api.herokuapp.com/v2/locations | json_pp
```


## API Endpoints

### Sources Endpoint
Expand Down
6 changes: 3 additions & 3 deletions app/services/location/jhu.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_locations():
# Get all of the data categories locations.
confirmed = get_category('confirmed')['locations']
deaths = get_category('deaths')['locations']
recovered = get_category('recovered')['locations']
# recovered = get_category('recovered')['locations']

# Final locations to return.
locations = []
Expand All @@ -127,7 +127,7 @@ def get_locations():
timelines = {
'confirmed' : confirmed[index]['history'],
'deaths' : deaths[index]['history'],
'recovered' : recovered[index]['history'],
# 'recovered' : recovered[index]['history'],
}

# Grab coordinates.
Expand All @@ -151,7 +151,7 @@ def get_locations():
{
'confirmed': Timeline({ datetime.strptime(date, '%m/%d/%y').isoformat() + 'Z': amount for date, amount in timelines['confirmed'].items() }),
'deaths' : Timeline({ datetime.strptime(date, '%m/%d/%y').isoformat() + 'Z': amount for date, amount in timelines['deaths'].items() }),
'recovered': Timeline({ datetime.strptime(date, '%m/%d/%y').isoformat() + 'Z': amount for date, amount in timelines['recovered'].items() })
'recovered': Timeline({})
}
))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_v2_latest(self, mock_request_get, mock_datetime):
'latest': {
'confirmed': 1940,
'deaths': 1940,
'recovered': 1940
'recovered': 0
}
}

Expand Down