Seperate file for population count
Currently the population count for each state/district is embeded with the various data.json file.
It would be more efficient if you move the population data into a separate json file.
This will (a) reduce data.json file size (b) give a direct url from where population data can be retrieved anytime (without having to download a huge file). (c) It would also be easier you to update the population count.
Population info is available here: https://api.covid19india.org/misc.json
@john2014 Keeping it all monolithic was a design decision that we took. Makes it easier for us to manage things on our website. Though I agree it has added a lot of redundancy, especially to the data-all.json. With the date-specific ones, I don't think it's that big an issue.
As @JunaidBabu mentioned, there's also a separate API if you just want the population data. All this data is pulled from a Google Sheet that we maintain, so updating is not a problem.
How are you using the API? If you want I can add another data-all.json endpoint without the meta key
Thank you for letting me know about misc.json file. Few suggestions:
- Could you add link to misc.json in the main github page (where all links are posted).
- The names in misc.json do not always match the name in data.json (misc.json has ''Mumbai Suburban' whereas data.json has "Mumbai"). Could we make sure they are exact match.
- Regarding the monolith decision: people can easily pull two different files and merge them (assuming the district names and state names are an exact match). Also (a) By removing population count from data.json, it would significantly reduce the file size and make it faster to download the file (especially if file is loaded directly by users when they visit any covid website). (b) Most websites do not use the population data. Hence adding it to data.json would simply increase the file size. Currently data-all.json is around 12 MB (which is huge data to pull on every single request).
So Mumbai and Mumbai Suburban are actually two different districts. The state government doesn't release numbers for Mumbai Suburban separately, so its entry is missing from data.json. And we don't have population data for 'Mumbai' district, so its entry is missing from misc.json. It's a weird scenario. Anyways, the chances of district names not matching in the APIs are pretty low, so if the district names are different, then it's usually safe to assume that they are separate districts.
The recent increase in data-all.json is not just because of population numbers. We also added district testing numbers wherever the data was available. That is what is primarily contributing to the increased size. Even if I remove the population figures, the size would still be ~11MB. Also, just FYI, we already have separate APIs for different types of numbers. The whole point of creating a v3 API was to combine it all into a single source.
Finally, data-all.json is not meant to be pulled on every request. It's a consolidated file which we use for debugging and analysis, not for any real-time stuff. If you just want the latest data, then you're much better off in using v3/min/data.min.json.
Let me know if you have more questions.
-
Is https://api.covid19india.org/v3/data.json (linked from github) same as https://api.covid19india.org/v3/min/data.min.json (not linked from github)?
-
District level test data: I only see tested value. Is that same as total tests performed? Also does any district have separate data for total tested positive, total tests negative, and tests pending ?
-
In https://api.covid19india.org/state_test_data.json, does it have data for total hospitalized cumulative, total icu cumulaative, total ventilator cumulative? If yes, could you tell me which fields in json file maps to these three fields?
-
Similarly to number 3 above, is this data available at district level?
-
Are there data available for antibodies (PCR tests) at country/state/district level?
-
Is it possible to create a new json file which merges state and district data into a new json file. Currently test data at state level is in its own json file; but test data for district is mixed with data.json file
Thanks for your help with this 😄
I forgot to ask: Do you also have case breakdown by age, gender, etc.
- Yep.
v3/min/*.min.jsonare the minified versions ofv3/*.json. Not sure what you mean by 'linked from GitHub', but everything on this branch is what is there on api.covid19india.org - So there's a lot of nuance which is lost when creating the v3 APIs. For most districts, it is the total samples tested (probably the same as total tests performed). Yep, I think positive/negative tests numbers are there (check this file)
- 4, 5 - /cc @sudevschiz
- ICU related information is rarely present in any of the bulletins. If it is available, it's being captured. However, it's unreliable and scanty.
- No
- No