Closed mgfcf closed 4 years ago
@mgfcf Hi, we will look into it, thanks!
@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.
Thank you very much @elitemaks ! It works and looks great.
@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.
@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?
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.
@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.
@impredicative I thought about this too, will do soon!
@impredicative done, "date" is optional now.
@elitemaks OK. Lastly, I can't use this endpoint without region.name
and region.iso
also being present in the output.
@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.
@impredicative may you please suggest what region.name and region.iso can we use for the global data?
@elitemaks That is an interesting question. I propose:
iso
is specified in the query, it should return data for the world (as it does). The response should then not contain any region.iso
or region.name
keys.iso
is specified in the query, it should return the corresponding data (as it does). The response should then contain the correct value for region.iso
and region.name
.iso
is specified in the query, e.g. XYZ
, it should return code 422 and no data. It should not continue to return code 200 with data for the world.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.
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.