Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See country total instead of province. #129

Closed
lburch02 opened this issue Mar 21, 2020 · 10 comments · Fixed by #122
Closed

See country total instead of province. #129

lburch02 opened this issue Mar 21, 2020 · 10 comments · Fixed by #122
Labels
question Further information is requested

Comments

@lburch02
Copy link

I don't know if I'm just missing it, but I can't seem to find a query parameter that returns the latest cases per country, instead of per province, as is currently the case. Is the only possibility at the moment to go through each province belonging to a country and to add the total cases together?

Thanks

@ExpDev07 ExpDev07 added the question Further information is requested label Mar 21, 2020
@ExpDev07
Copy link
Owner

ExpDev07 commented Mar 21, 2020

There is a PR open right now addressing this (#122). You can do it yourself for now though. Simply get your country's provinces (e.g U.S: /v2/locations?country_code=US), then sum the latest of all the locations returned together (aggregation). That'll yield your result. It's a really simple process and like I said, once the PR is merged, the API will do this for you.

@ExpDev07 ExpDev07 linked a pull request Mar 21, 2020 that will close this issue
@lburch02
Copy link
Author

Thanks, that's what I thought, and that's what I've been doing :). Any idea when the PR will merged?

@ExpDev07
Copy link
Owner

@yachtSamba depends when the guy gets back to me. If not, I'll just add it myself.

@lburch02
Copy link
Author

Ok thanks

@lburch02
Copy link
Author

Has it been added, seeing you closed the issue? I can't find the query parameter.

@ExpDev07
Copy link
Owner

ExpDev07 commented Mar 21, 2020

Latest for U.S: https://coronavirus-tracker-api.herokuapp.com/v2/locations?country_code=US, then see the latest top-level JSON object. Unfortunately, JHU is showing 0 cases for recovered at the moment (#113).

@lburch02
Copy link
Author

Oh ok thank you. I wasn't sure if that was right as the numbers were significantly lower than on other sources, but on #113 I see that it's because JHU only update daily. Thank you.

@ExpDev07
Copy link
Owner

ExpDev07 commented Mar 21, 2020

You can try an alternative source like /v2/locations?country_code=US&source=csbs (from https://www.csbs.org/information-covid-19-coronavirus) which update hourly, but unfortunately, they don't provide recoveries at all.

@lburch02
Copy link
Author

Thank you, but they don't seem to provide data for countries other than the US, so that's also a non-starter for me :). I love what you've made though!

@ExpDev07
Copy link
Owner

Planning to add more datasources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants