Novel Corona Virus (COVID19) : Archive and API of India Data
I have been archiving Novel Corona Virus #Covid19 data published by Ministry of Health and Family Affairs (mohfw) for last few days. This archival will give us access to historical data which mohfw doesn't publish. All data is on Github. You can access raw html or parsed JSON.
Each record in parsed JSON (mohfw.json) will look like this
{ "_id": "2020-03-10T12:00:00.00+05:30|dl", "report_time": "2020-03-10T12:00:00.00+05:30", "state": "dl", "confirmed_india": 4, "confirmed_foreign": 0, "cured": 0, "death": 0 }
- One record per state and report_time combination. This makes it easy to use it with Google charts etc
- state attribute is the ISO state code
- The report_time is in RFC3339 format. You can parse it in javascript very easily.
Parsing report_time in javascript
report_time = "2020-03-10T12:00:00.00+05:30"; dt_mils = Date.parse(report_time); new Date(dt_mils); //Tue Mar 10 2020 12:00:00 GMT+0530 (India Standard Time)
I also publish the aggregations. Total confirmed cases by report_time.
{"rows":[ {"key":["2020-03-10T12:00:00.00+05:30","total_confirmed"],"value":47}, {"key":["2020-03-11T17:30:00.00+05:30","total_confirmed"],"value":60}, {"key":["2020-03-12T11:00:00.00+05:30","total_confirmed"],"value":73}, {"key":["2020-03-12T18:00:00.00+05:30","total_confirmed"],"value":74}, {"key":["2020-03-13T10:00:00.00+05:30","total_confirmed"],"value":75}, {"key":["2020-03-13T22:15:00.00+05:30","total_confirmed"],"value":79}, {"key":["2020-03-14T09:00:00.00+05:30","total_confirmed"],"value":83}, {"key":["2020-03-14T16:55:00.00+05:30","total_confirmed"],"value":84}, {"key":["2020-03-15T08:55:00.00+05:30","total_confirmed"],"value":93}, {"key":["2020-03-15T12:00:00.00+05:30","total_confirmed"],"value":107}, {"key":["2020-03-15T17:00:00.00+05:30","total_confirmed"],"value":107}, {"key":["2020-03-15T23:30:00.00+05:30","total_confirmed"],"value":110}, {"key":["2020-03-16T16:00:00.00+05:30","total_confirmed"],"value":114} ]}
Cases at various levels by report_time.
{"rows":[ {"key":["2020-03-10T12:00:00.00+05:30","confirmed_foreign"],"value":16}, {"key":["2020-03-10T12:00:00.00+05:30","confirmed_indian"],"value":31}, {"key":["2020-03-10T12:00:00.00+05:30","cured"],"value":0}, {"key":["2020-03-10T12:00:00.00+05:30","death"],"value":0}, {"key":["2020-03-11T17:30:00.00+05:30","confirmed_foreign"],"value":16}, {"key":["2020-03-11T17:30:00.00+05:30","confirmed_indian"],"value":44}, {"key":["2020-03-11T17:30:00.00+05:30","cured"],"value":0}, {"key":["2020-03-11T17:30:00.00+05:30","death"],"value":0}, {"key":["2020-03-12T11:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-12T11:00:00.00+05:30","confirmed_indian"],"value":56}, {"key":["2020-03-12T11:00:00.00+05:30","cured"],"value":0}, {"key":["2020-03-12T11:00:00.00+05:30","death"],"value":0}, {"key":["2020-03-12T18:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-12T18:00:00.00+05:30","confirmed_indian"],"value":57}, {"key":["2020-03-12T18:00:00.00+05:30","cured"],"value":3}, {"key":["2020-03-12T18:00:00.00+05:30","death"],"value":0}, {"key":["2020-03-13T10:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-13T10:00:00.00+05:30","confirmed_indian"],"value":58}, {"key":["2020-03-13T10:00:00.00+05:30","cured"],"value":3}, {"key":["2020-03-13T10:00:00.00+05:30","death"],"value":1}, {"key":["2020-03-13T22:15:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-13T22:15:00.00+05:30","confirmed_indian"],"value":62}, {"key":["2020-03-13T22:15:00.00+05:30","cured"],"value":10}, {"key":["2020-03-13T22:15:00.00+05:30","death"],"value":2}, {"key":["2020-03-14T09:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-14T09:00:00.00+05:30","confirmed_indian"],"value":66}, {"key":["2020-03-14T09:00:00.00+05:30","cured"],"value":10}, {"key":["2020-03-14T09:00:00.00+05:30","death"],"value":2}, {"key":["2020-03-14T16:55:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-14T16:55:00.00+05:30","confirmed_indian"],"value":67}, {"key":["2020-03-14T16:55:00.00+05:30","cured"],"value":10}, {"key":["2020-03-14T16:55:00.00+05:30","death"],"value":2}, {"key":["2020-03-15T08:55:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-15T08:55:00.00+05:30","confirmed_indian"],"value":76}, {"key":["2020-03-15T08:55:00.00+05:30","cured"],"value":9}, {"key":["2020-03-15T08:55:00.00+05:30","death"],"value":2}, {"key":["2020-03-15T12:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-15T12:00:00.00+05:30","confirmed_indian"],"value":90}, {"key":["2020-03-15T12:00:00.00+05:30","cured"],"value":9}, {"key":["2020-03-15T12:00:00.00+05:30","death"],"value":2}, {"key":["2020-03-15T17:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-15T17:00:00.00+05:30","confirmed_indian"],"value":90}, {"key":["2020-03-15T17:00:00.00+05:30","cured"],"value":10}, {"key":["2020-03-15T17:00:00.00+05:30","death"],"value":2}, {"key":["2020-03-15T23:30:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-15T23:30:00.00+05:30","confirmed_indian"],"value":93}, {"key":["2020-03-15T23:30:00.00+05:30","cured"],"value":13}, {"key":["2020-03-15T23:30:00.00+05:30","death"],"value":2}, {"key":["2020-03-16T16:00:00.00+05:30","confirmed_foreign"],"value":17}, {"key":["2020-03-16T16:00:00.00+05:30","confirmed_indian"],"value":97}, {"key":["2020-03-16T16:00:00.00+05:30","cured"],"value":13}, {"key":["2020-03-16T16:00:00.00+05:30","death"],"value":2} ]}
I do have an API. It's open and accessible. The response is same as parsed JSON (mohfw.json). Hence I suggest you too wget/download it from Github and host it on your own server.
Comment here if you have any questions. You can also participate in DataMeet discussion about #covid19. It's more active.
Hi Thejesh, hope you’re safe. I’m a journalist with The Times of India. I wanted to reach out to you for a story. please share your contact details.