axisbits / covid-api

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

Examples #3

Closed mcteapot closed 4 years ago

mcteapot commented 4 years ago

Hi, I had seen your API doc, but some examples and return json objects would be nice to see.

elitemaks commented 4 years ago

Hi @mcteapot, there is an example of data in the documentation. Click on needed request, then scroll down and thee will be examples of successful response and error response. Also, you can click on the Try It Out button, send the request and see the actual response. Please let us know if you need any further assistance.

impredicative commented 4 years ago

@mcteapot Examples:

  1. https://covid-api.com/api/reports?iso=USA
  2. https://covid-api.com/api/reports?iso=CAN&date=2020-03-16
  3. https://covid-api.com/api/reports?iso=USA&region_province=New%20York&date=2020-03-17
mcteapot commented 4 years ago

@mcteapot Examples:

  1. https://covid-api.com/api/reports?iso=USA
  2. https://covid-api.com/api/reports?iso=CAN&date=2020-03-16
  3. https://covid-api.com/api/reports?iso=USA&region_province=New%20York&date=2020-03-17

This is exactly what I was looking for thanks! More examples like this would be great, on how to get diff with previous days and such

elitemaks commented 4 years ago

@mcteapot diffs are now part of every response. For example, if you check this - https://covid-api.com/api/reports?iso=USA - you'll see such fields there: confirmed_diff deaths_diff recovered_diff active_diff. Those are diffs from the previous day. If you need to compare any two dates, you'll have to make 2 separate requests and compare numbers manually.

mcteapot commented 4 years ago

It would be nice to have data of cities in regions as well; EG: Los Angeles and such.

elitemaks commented 4 years ago

@mcteapot unfortunately, Johns Hopkins provides information for regions only, so you can get info for California, but cannot for a particular city. If and when they add such info in their CSV files, we will provide it too, of course. I will check if there is such a suggestion in their repo.

elitemaks commented 4 years ago

Just checked, there was data by the city in Time Series before, but now there are zeros, so data is not updated.

mcteapot commented 4 years ago

@elitemaks I had figured this might be the case, at some point on the JHU website just started aggerating the city info into whole states. Now the only way to find out about new cases in your country or city is through news outlets that are behind paywalls or vague updated on different news outlets.

For large states like California, the numbers although are growing it is almost impossible to determine if it is growing rapidly around your area.

I am creating a project tracking the Coronavirus and trying to give you warnings if near you via a Discord Bot. Currently, it is linked to your API as well. https://github.com/mcteapot/COVID19DiscordBots

elitemaks commented 4 years ago

@mcteapot do you have a reliable source of data of cases by cities? Maybe, if there is some with open data, we could integrate it into our API.

mcteapot commented 4 years ago

@elitemaks All the ones I had seen are now not sowing it again. I will keep an eye out

mcteapot commented 4 years ago

@elitemaks I was looking at the Spreadsheet that states the JHU tracking info. All the cases seem to be giving lat and long

https://docs.google.com/spreadsheets/d/1avGWWl1J19O_Zm0NGTGy2E-fOG05i4ljRfjl87P7FiA/edit?ts=5e5e9222#gid=1223604501

mcteapot commented 4 years ago

It seems they have added cites to the time series data https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series

impredicative commented 4 years ago

I rely on producing and using global and country level totals of cases using the data provided by the API. I wouldn't want my totals to contain duplicates. Data at the world and country level shouldn't therefore contain city level data if it contains country or province level data.

elitemaks commented 4 years ago

@mcteapot I saw this, but if you check the latest dates, they all have zeros for cities. Seems like they do not have enough resources to keep it up to date. Let's monitor it, maybe it'll change

elitemaks commented 4 years ago

@mcteapot I think the original question was answered so I'll close this issue. You are welcome to open new ones with bugs or suggestions!

elitemaks commented 4 years ago

@mcteapot Johns Hopkins CSSE has added the US cities data to their repo, so we added it too. You can check it for example here - https://covid-api.com/api/reports?date=2020-03-25&iso=USA&region_province=California

mcteapot commented 4 years ago

@elitemaks thank you for adding, the cities. The diff in your API has been so great as well. It really has been letting me tracking how bad it is getting out there.