M-Media-Group / Covid-19-API

This is the code running in AWS Lambda powering covid-api.mmediagroup.fr/v1. The API provides realtime and historical data on Coronavirus COVID-19 confirmed cases, deaths, and recovered cases. This API has now been called over 40 million times, thank you!
https://covid-api.mmediagroup.fr/v1/cases
GNU Affero General Public License v3.0
399 stars 30 forks source link

Number of vaccinated is wrong #20

Closed yano404 closed 3 years ago

yano404 commented 3 years ago

Number of people_vaccinated and people_partially_vaccinated is wrong for certain countries (Canada, India, UK, ...). For example, /vaccines?country=Canada returns

{
  "All": {
    "administered": 49836,
    "people_vaccinated": 0,
    "people_partially_vaccinated": 0,
    "country": "Canada",
    "population": 36624199,
    "sq_km_area": 9970610,
    "life_expectancy": "79.4",
    "elevation_in_meters": 487,
    "continent": "North America",
    "abbreviation": "CA",
    "location": "North America",
    "iso": 124,
    "capital_city": "Ottawa", 
    "updated": "2021/05/12 00:00:00+00"
  }
}

This is because Province_State column was added by the vaccine data provider. Data of the country having Province_State column seems to be overwritten by the next row.

, Canada, ...
Alberta, Canada, ...
British Columbia, Canada, ...

I suggest the solutions:

  1. /vaccines?country=foo returns only 'All'.
    {
      "All": {
        "administered": ...,
        "people_vaccinated": ...,
        "people_partially_vaccinated": ...,
        ...
      }
    }
  2. /vaccines?country=foo returns "All" and provinces.
    {
      "All": {
        "administered": ...,
        "people_vaccinated": ...,
        "people_partially_vaccinated": ...,
        ...
      },
      "Province1": {
        "administered": ...,
        "people_vaccinated": ...,
        "people_partially_vaccinated": ...,
        ...
      },
      ...
    }
yano404 commented 3 years ago

This problem will be fixed by #21. In #21, /vaccines?country=foo will return "All" and provinces (solution 2).