axisbits / covid-api

API based on publicly available data by Johns Hopkins CSSE
21 stars 0 forks source link

Is there an easy way to get combined data for multiple/all regions? #9

Closed mgfcf closed 4 years ago

mgfcf commented 4 years ago

I would be interested in an easy way to get the total active cases, deaths, etc. for the region earth. Similar for the USA. Not just provinces.

elitemaks commented 4 years ago

@mgfcf Hi, we will look into it, thanks!

elitemaks commented 4 years ago

@mgfcf we added a new endpoint, please check the documentation. Example - https://covid-api.com/api/reports/total?date=2020-04-07. Please let us know if that works.

mgfcf commented 4 years ago

Thank you very much @elitemaks ! It works and looks great.

impredicative commented 4 years ago

@elitemaks This is missing a lot of the keys found in the standard API. It doesn't make sense for it to be missing keys.

elitemaks commented 4 years ago

@impredicative not sure if I got you correct, but it's a separate API endpoint and it's ok that it has a different set of values than standard /reports endpoint. Do you have some suggestions here?

impredicative commented 4 years ago

What is special about this endpoint is that it has totals. Everything else should remain consistent with the older endpoint. I use the older endpoint and compute totals myself which is inefficient. I could conceivably use this endpoint but it's inconsistent as it's lacking keys, and so I can't use it.

impredicative commented 4 years ago

@elitemaks Thank you. Can the date be made automatic for this endpoint too in the same exact way as for the previous endpoint? I cannot currently use this endpoint without an automatic date.

elitemaks commented 4 years ago

@impredicative I thought about this too, will do soon!

elitemaks commented 4 years ago

@impredicative done, "date" is optional now.

impredicative commented 4 years ago

@elitemaks OK. Lastly, I can't use this endpoint without region.name and region.iso also being present in the output.

impredicative commented 4 years ago

@elitemaks How about it? I can't use this endpoint without region.name and region.iso also being present in the output. If it's there in the main endpoint, it follows that it should be here too.

elitemaks commented 4 years ago

@impredicative may you please suggest what region.name and region.iso can we use for the global data?

impredicative commented 4 years ago

@elitemaks That is an interesting question. I propose:

elitemaks commented 4 years ago

Hi @impredicative , sorry for the late reply. It seems that now we have almost the same logic as you described, just separated by 2 endpoints. Not sure why it is a problem to perform a request to another endpoint to get global data.