act-now-coalition / covid-data-model

Data backend providing computed data for the graphs displayed at https://covidactnow.org
https://covidactnow.org/
MIT License
149 stars 57 forks source link

Expose an API #68

Closed igorkofman closed 4 years ago

igorkofman commented 4 years ago

GET https://data.covidactnow.org/states/CA { population: "", infected: "", dead: "", recovered: "" }

GET https://data.covidactnow.org/states/CA/counties/kern { population: "", infected: "", dead: "", recovered: "" }

We should just pre-compute all of these and publish them into an s3 bucket. To start it can be the same bucket as we're using for the DOD. (data.covidactnow.org)

asciimike commented 4 years ago

Let's add "updated_at": <ISO8601 datetime> to this as well.

At some point we may want a list endpoint on states and counties, but we can deal with that later--for now it should be fine for states.

crwilcox commented 4 years ago

Based on the example, it might make sense to point folks to https://console.cloud.google.com/marketplace/details/johnshopkins/covid19_jhu_global_cases?filter=solution-type:dataset&q=covid&id=430e16bb-bd19-42dd-bb7a-d38386a9edf5 rather than doing the same thing?

SELECT * FROM `bigquery-public-data.covid19_jhu_csse.summary` ORDER BY date desc LIMIT 1000

returns

[
  {
    "province_state": "Texas",
    "country_region": "US",
    "date": "2020-04-06",
    "latitude": "30.71780434",
    "longitude": "-99.22629416",
    "location_geom": "POINT(-99.22629416 30.71780434)",
    "confirmed": "1",
    "deaths": "0",
    "recovered": "0",
    "active": "0",
    "fips": "48319",
    "admin2": "Mason",
    "combined_key": "Mason, Texas, US"
  },
  {
    "province_state": null,
    "country_region": "Belgium",
    "date": "2020-04-06",
    "latitude": "50.8333",
    "longitude": "4.469936",
    "location_geom": "POINT(4.469936 50.8333)",
    "confirmed": "20814",
    "deaths": "1632",
    "recovered": "3986",
    "active": "15196",
    "fips": null,
    "admin2": null,
    "combined_key": "Belgium"
  },
  {
    "province_state": "Hawaii",
    "country_region": "US",
    "date": "2020-04-06",
    "latitude": "22.03935037",
    "longitude": "-159.5966786",
    "location_geom": "POINT(-159.5966786 22.03935037)",
    "confirmed": "17",
    "deaths": "0",
    "recovered": "0",
    "active": "0",
    "fips": "15007",
    "admin2": "Kauai",
    "combined_key": "Kauai, Hawaii, US"
  },
asciimike commented 4 years ago

@crwilcox thanks for the pointer. Any idea if they have county level data?

We'll need to provide our model data as well though (that's the real value of the API), so I think we'll still have to provide something.

I imagine something like:

{
  location_info: {
    state,
    population,
    current_intervention,
    num_hospital_beds,
    num_icu_beds,
    hospital_overload_date,
    hospital_bed_shortfall,
    icu_overload_date,
    icu_shortfall,
    peak_death_date,
    peak_death
  },
  model: [
    {
      date,
      days_til_bed_overload,
      days_til_icu_overload,
      days_til_peak_death,
      hospitalizations,
      hospital_beds_used,
      icu_beds_used,
      deaths
    }
  ]
}
crwilcox commented 4 years ago

@asciimike that makes sense. Right now I don't see county data but I can reach out and see if that is in the cards or not.

crwilcox commented 4 years ago

I take that back, it is in the dataset already. image

davidstrauss commented 4 years ago

Per @igorkofman, we can finally close this. Thank you, team!