Code Monkey home page Code Monkey logo

api's Introduction

COVID19-India API

Announcement

We have stopped capturing testing data at a district level. Please check the status of the API endpoints below.

  1. As of 13th August this repository and api.covid19india.org have been deprecated. We redirect api.covid19india.org to data.covid19india.org. Please refer to this repository for the latest endpoint.
  2. As of 13th August, all json endpoints except v4 endpoints have been deprecated. Please use the csv endpoints or refer to v4 endpoints

Files available

  • Aggregated sheets provide aggregated data at the district/state levels in csv format.
  • V4 json endpoints. These are the json apis that are used by the website to show all the statistics on the site. These can be used by developers and analysts who have knowledge of json parsing (recommended approach). All our v4 endpoints are actively developed and in use since this serves the frontend view Documentation for the same.
  • Latest data from the google sheet (10-20 minutes delayed) is available through the latest end-point. These are present under the raw files section below. (Not recommended since the number of files is huge and there is no additional information present in these as compared to the above mentioned endpoints.)

V4 JSON endpoints

Status Link to API Description
๐Ÿ’š https://api.covid19india.org/v4/min/timeseries.min.json Daily numbers across C,R,D and Tested per state (historical data).
๐Ÿ’š https://api.covid19india.org/v4/min/data.min.json Current day numbers across districts and states.
๐Ÿ’š https://api.covid19india.org/v4/min/data-all.min.json Per day numbers across districts and states - consider using timeseries in place of this. This is a huge file and is a mix of timeseries and data.min.json

Note: Please consider using the above endpoints for all your data needs. All the data we show on the website is fuelled by the above endpoints.

Aggregated Sheets (CSV)

Status Sheet Name Link to CSV Description
๐Ÿ’š case_time_series https://api.covid19india.org/csv/latest/case_time_series.csv India level timeseries for Confirmed, Recovered and Deceased cases
๐Ÿ’š states https://api.covid19india.org/csv/latest/states.csv Statewise timeseries of Confirmed, Recovered and Deceased numbers.
๐Ÿ’š districts https://api.covid19india.org/csv/latest/districts.csv Districtwise timeseries of Confirmed, Recovered and Deceased numbers.
๐Ÿ’š state_wise_daily https://api.covid19india.org/csv/latest/state_wise_daily.csv Statewise per day delta of Confirmed, Recovered and Deceased numbers.
๐Ÿ’š state_wise https://api.covid19india.org/csv/latest/state_wise.csv Statewise cumulative numbers till date.
๐Ÿ’š district_wise https://api.covid19india.org/csv/latest/district_wise.csv Districtwise Cumulative numbers till date.
๐Ÿ’š statewise_tested_numbers_data https://api.covid19india.org/csv/latest/statewise_tested_numbers_data.csv Number of tests conducted in each state, ventilators ,hospital bed occupany reported in state bulletins
๐Ÿ’š tested_numbers_icmr_data https://api.covid19india.org/csv/latest/tested_numbers_icmr_data.csv Number of tests reported by ICMR
๐Ÿ’š icmr_labs_statewise https://api.covid19india.org/csv/latest/icmr_labs_statewise.csv Number of Labs in each state as per ICMR
๐Ÿ’š sources_list https://api.covid19india.org/csv/latest/sources_list.csv List of sources that we are using.
๐Ÿ’š rtpcr_samples_collected http://api.covid19india.org/csv/latest/icmr_rtpcr_tests_daily.csv Number of RTPCR samples collected statewise in ICMR Application
๐Ÿ’š vaccine_doses_administered_statewise http://api.covid19india.org/csv/latest/vaccine_doses_statewise_v2.csv Number of vaccine doses administered statewise - Collected from MOHFW daily bulletin
๐Ÿ’š cowin_vaccine_data_statewise http://api.covid19india.org/csv/latest/cowin_vaccine_data_statewise.csv Key data points from CoWin database at a state level
๐Ÿ’š cowin_vaccine_data_districtwise http://api.covid19india.org/csv/latest/cowin_vaccine_data_districtwise.csv Key data points from CoWin database at a district level

Latest data from the google sheet (10-20 minutes delayed) is available through the latest end-point. These endpoints should be avoided unless none of the above endpoints work for you.

Raw Data

Status Sheet Name Link to CSV Description
๐Ÿ’š raw_data1 https://api.covid19india.org/csv/latest/raw_data1.csv Till Apr 19th
๐Ÿ’š raw_data2 https://api.covid19india.org/csv/latest/raw_data2.csv Apr 20th to Apr 26th
๐Ÿ’š raw_data3 https://api.covid19india.org/csv/latest/raw_data3.csv Apr 27th to May 9th
๐Ÿ’š raw_data4 https://api.covid19india.org/csv/latest/raw_data4.csv May 10th to May 23rd
๐Ÿ’š raw_data5 https://api.covid19india.org/csv/latest/raw_data5.csv May 24th to Jun 4th
๐Ÿ’š raw_data6 https://api.covid19india.org/csv/latest/raw_data6.csv Jun 05th to Jun 19th
๐Ÿ’š raw_data7 https://api.covid19india.org/csv/latest/raw_data7.csv Jun 20th to Jun 30th
๐Ÿ’š raw_data8 https://api.covid19india.org/csv/latest/raw_data8.csv Jul 01st to Jul 7th
๐Ÿ’š raw_data9 https://api.covid19india.org/csv/latest/raw_data9.csv Jul 08th to Jul 13th
๐Ÿ’š raw_data10 https://api.covid19india.org/csv/latest/raw_data10.csv Jul 14th to Jul 17th
๐Ÿ’š raw_data11 https://api.covid19india.org/csv/latest/raw_data11.csv Jul 18th to Jul 22nd
๐Ÿ’š raw_data12 https://api.covid19india.org/csv/latest/raw_data12.csv Jul 23th to Aug 06th
๐Ÿ’š raw_data13 https://api.covid19india.org/csv/latest/raw_data13.csv Aug 07th to Aug 21st
๐Ÿ’š raw_data14 https://api.covid19india.org/csv/latest/raw_data14.csv Aug 22nd to Sep 05th
๐Ÿ’š raw_data15 https://api.covid19india.org/csv/latest/raw_data15.csv Sep 06th to Sep 21st
๐Ÿ’š raw_data16 https://api.covid19india.org/csv/latest/raw_data16.csv Sep 22nd to Oct 08th
๐Ÿ’š raw_data17 https://api.covid19india.org/csv/latest/raw_data17.csv Oct 09th to Oct 26th
๐Ÿ’š raw_data18 https://api.covid19india.org/csv/latest/raw_data18.csv Oct 27th to Nov 12th
๐Ÿ’š raw_data19 https://api.covid19india.org/csv/latest/raw_data19.csv Nov 13th to Nov 30th
๐Ÿ’š raw_data20 https://api.covid19india.org/csv/latest/raw_data20.csv Dec 01st to Dec 19th
๐Ÿ’š raw_data21 https://api.covid19india.org/csv/latest/raw_data21.csv Dec 20th to Jan 08th
๐Ÿ’š raw_data22 https://api.covid19india.org/csv/latest/raw_data22.csv Jan 09th to Jan 31st
๐Ÿ’š raw_data23 https://api.covid19india.org/csv/latest/raw_data23.csv Feb 01st to Feb 27st
๐Ÿ’š raw_data24 https://api.covid19india.org/csv/latest/raw_data24.csv Feb 28th to Mar 31st
๐Ÿ’š raw_data25 https://api.covid19india.org/csv/latest/raw_data25.csv Apr 01st to Apr 20th
๐Ÿ’š raw_data26 https://api.covid19india.org/csv/latest/raw_data26.csv Apr 21st to May 04th
๐Ÿ’š raw_data27 https://api.covid19india.org/csv/latest/raw_data27.csv May 05th to May 17th
๐Ÿ’š raw_data28 https://api.covid19india.org/csv/latest/raw_data28.csv May 18th to Jun 02nd
๐Ÿ’š raw_data29 https://api.covid19india.org/csv/latest/raw_data29.csv Jun 03rd to Jun 19th
๐Ÿ’š raw_data30 https://api.covid19india.org/csv/latest/raw_data30.csv Jun 20th to Jul 06th
๐Ÿ’š raw_data31 https://api.covid19india.org/csv/latest/raw_data31.csv Jul 07th to Jul 27th
๐Ÿ’š raw_data32 https://api.covid19india.org/csv/latest/raw_data32.csv Jul 28th onwards

Note

  • Avoid using raw sheets. The only reason to use raw sheets would be to refer to demographics (rarely available) or to sources of numbers
  • Always try to use the aggregated numbers above as they have been treated for discrepancies

Contributing

  • If you notice issues, have questions or want to suggest enhancements, please raise an issue in the repo.

Quick Links

A more detailed note of the columns present in the data may be found in the json documentation

....................................................

api's People

Contributors

abhishekpednekar84 avatar anamritraj avatar aswaathb avatar bee-rickey avatar chickenpie347 avatar dependabot[bot] avatar gouenji-shuuya avatar grajin avatar jeethesh-kotian avatar jeremyphilemon avatar junaidbabu avatar myinnos avatar nishcthulhu avatar nithinkjoy-tech avatar rahulpandey1501 avatar rajeevtomar avatar ravindraten avatar ritwikranjan avatar rohitxsh avatar sachinkcrp avatar samirrana1011 avatar shikarishambujr avatar shuklaayush avatar siddharths2710 avatar sudev-chirappat avatar sudevschiz avatar sumitmckv avatar thecoducer avatar vinitshahdeo avatar vj1224 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

iOS Application based on this API

Hi Team,

I would like to create an iOS App using this API. I am seeking your permission to use this API for the app. I am willing to create it as part of covid19india project.

Data refresh strategy

I see a lot of data update commits.
What's the process ?? After the moderators confirm the reported case is correct, someone executes "pushthejson" script and then all the JSON are updated ??
If my understanding is correct here, may I help to improve this process if you guys feel that is needed?

The API response does not look like properly formatted JSON data?

There are no square brackets. Nor is this data properly iterable in JS via "key in" or any other method. I'm talking about state_district_wise. Not being able to access the keys numerically, say data[0] instead of typing data['Kerala'] is a problem when there is even more nested data, and no state-wise summary is available - in which case I would have reluctantly hard-coded the 28 values..

Or maybe I'm not knowledgeable enough, will appreciate some help.

In Rajasthan state there is a district "Pratapgarh" which is displayed like "Pratapgarh ".

Due to this, there is a problem in the live site. for details, please see the below points.
Describe the bug
In map patient count is not reflecting on 'Pratapgarh' district of Rajasthan

To Reproduce
Steps to reproduce the behavior:

Go to 'Rajasthan map and expand it'
Click on 'Pratapgarh district'
Scroll down to 'Rajasthan' under column State\UT
See the patient count
Expected behavior
A clear and concise description of what you expected to happen.

Map color of Pratapgarh should be changed (slight red)
It should show count as 2.

77844006-0a60d880-71c0-11ea-8170-1a6057470520

Is the API open ?

Can we use the data from api by giving proper credits to covid19india.org.

state_district_wise.json format update -> JSON array

I propose updating the JSON format to have a JSON array to make it simpler to parse it easily in a dynamic manner.

Current JSON format

{
	"Kerala": {
		"districtData": {
			"Thrissur": {
				"confirmed": 7,
				"lastupdatedtime": "",
				"delta": {
					"confirmed": 0
				}
			},
			"Alappuzha": {
				"confirmed": 2,
				"lastupdatedtime": "",
				"delta": {
					"confirmed": 0
				}
			}
		}
	},
	"Maharashtra": {
		"districtData": {
			"Pune": {
				"confirmed": 42,
				"lastupdatedtime": "",
				"delta": {
					"confirmed": 5
				}
			},
			"Mumbai": {
				"confirmed": 75,
				"lastupdatedtime": "",
				"delta": {
					"confirmed": 3
				}
			}
		}
	},
	"Unknown": {
		"districtData": {
			"Unknown": {
				"confirmed": 284,
				"lastupdatedtime": "",
				"delta": {
					"confirmed": 0
				}
			}
		}
	}
}

Proposed JSON format

{
	"districtWise": [
		{
			"state": "Maharashtra",
			"districtData": [
				{
					"districtName": "Pune",
					"confirmed": 42,
					"lastupdatedtime": "",
					"delta": {
					  "confirmed": 5
					}
				},
				{
					"districtName": "Mumbai",
					"confirmed": 75,
					"lastupdatedtime": "",
					"delta": {
					  "confirmed": 3
					}
				}
			]
		},
		{
			"state": "Kerala",
			"districtData": [
				{
					"districtName": "Thrissur",
					"confirmed": 7,
					"lastupdatedtime": "",
					"delta": {
					  "confirmed": 0
					}
				},
				{
					"districtName": "Alappuzha",
					"confirmed": 2,
					"lastupdatedtime": "",
					"delta": {
					  "confirmed": 0
					}
				}
			]
		},
		{
			"state": "Unknown",
			"districtData": [
				{
					"districtName": "Unknown",
					"confirmed": 284,
					"lastupdatedtime": "",
					"delta": {
					  "confirmed": 0
					}
				}
			]
		}
	]
}

Delta calculation not correct as it assumes all delta's are positive

  let currentStatus = row.currentstatus;
  if (currentStatus) {
    stat.confirmed += 1;
    switch (currentStatus) {
      case "Hospitalized":
        stat.active += 1;
        break;
      case "Recovered":
        stat.recovered += 1;
        break;
      case "Deceased":
        stat.deaths += 1;
        break;
    }

Eg: Total active cases in a state can go down, if no new case and more than one recovered case. Delta for "active" should be negative in this case and UI should show down arrow.

Right now its using "current status" value to increment each delta.

Relationship Extraction API Info Addition

What works for relationship extraction API

Code is here: https://github.com/NirantK/coronaIndia/blob/master/relationship_server.py

Relationship

What works

"Family of P13"
"Son of P12 and Daughter of P12"
"Friend of P12, P12, 14 and son of P13"

What doesn't work : Relationship without word of

"Friend: P12"
"Friends with P12"
"Wife of p12" #Expected P12 (throws error with small p)

Travel Places

What works

Travelled from Wuhan
Travel history Italy, Pune, Mumbai
Travlled from South Korea via Mumbai

Nationality

What works

Indian student studying in wuhan
Italian tourise

What doesn't work

Indian travelling with Italian tourist
# Will return Indian and Italian

API Details

API URL : http://coronatravelhistory.pythonanywhere.com/

Example request :

curl --header "Content-Type: application/json" --request POST --data '{"patients":[{"patientId":"1","notes":"Travelled from Italy"}]}' http://coronatravelhistory.pythonanywhere.com/

Python Example Request :

import requests

headers = {
    'Content-Type': 'application/json',
}

data = '{
    "patients": [
        {
            "patientId": "1",
            "notes": "Indian Student Travelled from Italy, Family Member of P13 Friend with P12"
        }
    ]
}'

response = requests.post('http://coronatravelhistory.pythonanywhere.com/', headers=headers, data=data)

Input Data Example :

{
    "patients": [
        {
            "patientId": "1",
            "notes": "Indian Student Travelled from Italy, Family Member of P13 Friend of P12"
        }
    ]
}

Returns :

{
    "patients": [
        {
            "1": {
                "nationality": [
                    "Indian"
                ],
                "place_attributes": [
                    {
                        "is_foreign": true,
                        "place": "Italy"
                    }
                ],
                "relationship": [
                    {
                        "link": "Family Member",
                        "with": [
                            "P13"
                        ]
                    },
                    {
                        "link": "Friend",
                        "with": [
                            "P12"
                        ]
                    }
                ],
                "travel": [
                    "Italy"
                ]
            }
        }
    ]
}

Expose Factoid sheet as an API

The Google Sheet has a "Factoid" sheet. Please commit that along with the automatic action. (Maybe a separate website_data.json)?

Add more documentation to the README

README can give more context regarding the details in the API

It can also mention a changelog as lot of data fields are getting added to the data.

Add Death_And_Recovery sheet as an API

Currently, details in the raw_data for death and recovery won't match the exact numbers because, most of the time we won't have the exact details which patient the news or bulletin is referring to.

So, we have created a separate sheet where this details are added.

It would be great if this sheet is provided as an API separately or as part of raw_data.

District names in API do not reflect actual districts in the Map

Refer to Issue #26 for such a similar case.
A similar trend is observed in other states as well.

As you can see below, the district name is "SHAHID BHAGAT SINGH NAGAR" in API as well as the left drop down of the state wise distribution. While the actual mapping on the Map does not have any district with this name, instead the actual district "SHAHEED BHAGAT SINGH NAGAR" on the map shoes 0 confirmed cases, which is not correct as per the API and latest data.

Can we find a way to improve the mapping system from API to the actual Map on the website?
Either by giving them unique IDs and keeping optional reference names as they arrive so that the actual ID and mapping does not change even after the API changes.

Screenshot from 2020-03-29 21-28-57

Enhancement on data listing

Add codes to states like : "state_code" : "DL" so that we can filter the data out.
Also the structure should be :
{"state" : "Delhi",
"state_code" : "DL",
"data" : [{
"name" : "East Delhi",
"confirmed_Cases" : 30
.
.
.
},
{
}
..
]
}

need help to use this api in a IOT display

I am trying to create a LED matrix and a 2line Display that will display the live data using ESP8266 microcontroller, Is there any way to just only get the total data like - total confirmed case, total recovered, etc via the API, cause it will be hard to decode that much data using small microcontrollers.

updating the /v2/state_district_wise.json format

Can we use the following json format :-
{
"Kerala": {
"districtData": {
"Thrissur": {
"confirmed": 12,
"active": 10, // new addition
"deaths": 0, // new addition
"recovered": 2, // new addition
"lastupdatedtime": "",
"delta": {
"confirmed": 0,
"active": 0, // new addition
"deaths": 0, // new addition
"recovered": 0 // new addition
}
}
}
This can help us track the number of active and recovered cases per city. We can display this info on the website.

Data mismatch with regarding statesv2

Data in main statesv2 api is different than that of maindashboard a new values of unknown states is getting processed including the unknown districts compared with data.json,raw_data for cities and statesv2 for daily deltas of districts

image

even when using single table same result while processing the api

image

in api url also same representation

image

Link to latest update source from each state

This issue is linked to covid19india/covid19india-react#558

Is your feature request related to a problem? Please describe.
No. It is a new feature which would help people like me who would like to know more about the update.

Describe the solution you'd like
In recent days, we see that each state government is mostly giving one update per day. It would be good if we could the link to the source of this update.

Invalid district "Vellorer" in Tamilnadu

Duplicate entry for the district "Vellore" is present and the name is given as Vellorer.

@JunaidBabu - From your previous comment, saw that the corresponding google sheet has to be corrected by removing this data. Thanks.

File: state_district_wise.json, Line: 508

Found Typo

There are Kasaragod and Kasargod in Kerala data in state_district_wise.json
You can ignore Kasargod.

Problem with /v2/state_district_wise.json

Can the format of state_district_wise be changed to the format same as in statewise to make it simpler to parse it easily in a dynamic manner.

Current Format

[
{
"state": "Kerala",
"districtData": [
{
"district": "Thrissur",
"confirmed": 12,
"lastupdatedtime": "",
"delta": {
"confirmed": 0
}
},
{
"district": "Alappuzha",
"confirmed": 3,
"lastupdatedtime": "",
"delta": {
"confirmed": 0
}
},

proposed format

{
"state": "Kerala",
"districtData": [
{
"district": "Thrissur",
"confirmed": 12,
"lastupdatedtime": "",
"delta": {
"confirmed": 0
}
},
{
"district": "Alappuzha",
"confirmed": 3,
"lastupdatedtime": "",
"delta": {
"confirmed": 0
}
},
{
"district": "Kasaragod",
"confirmed": 143,
"lastupdatedtime": "",
"delta": {
"confirmed": 0
}
},

Delta Not Consistent

Hello, we've just started consuming the API and everything was fine. From midnight, the delta has stopped showing. I saw the data.json and it turns out the statewise "total" delta is empty. Instead, now it's shown in "keyvalues". Why this change?

"key_values": [
		{
			"confirmeddelta": "0",
			"counterforautotimeupdate": "645",
			"deceaseddelta": "1",
			"lastupdatedtime": "31/03/2020 09:07:24",
			"recovereddelta": "1",
			"statesdelta": "0"
		}
	],
	"statewise": [
		{
			"active": "1165",
			"confirmed": "1347",
			"deaths": "44",
			"delta": {
				"active": 0, 
				"confirmed": 0, 
				"deaths": 0, 
				"recovered": 0 
			},
			"lastupdatedtime": "31/03/2020 09:07:24",
			"recovered": "138",
			"state": "Total"
		},

Reflect the new logic to calculate delta values into the API

Initial logic to calculate recovered and deceased delta from the raw data failed as the number of cases increased and it was getting tough to assign the aggregate number to individual patients.
We revoked that calculation and made those values 0.

#61
#45

We made changes in the process and logic and the correct daily delta for recovered and deaths are now available in the StateWise sheet. This need to the updated in the delta dictionary as before.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.