This API provides updated real-time data on coronavirus cases from the worldometers page and other important websites, provided by the most reputable organizations and statistical offices in the world.
🚨 Important Information 🚨
If you notice that I make and publish many updates / versions in the api, it is due to all the data that is reaching the public. This helps me create a more complete API, with accurate data.
In turn, I have created a website to demonstrate the capabilities that this API has when using it to create web applications. I have only created it for demonstration, so it will serve as a prototype.
How contagious is the COVID19? (Ro)The attack rate or transmissibility (how rapidly the disease spreads) of a virus is indicated by its reproductive number (Ro, pronounced R-nought or r-zero), which represents the average number of people to which a single infected person will transmit the virus.
WHO's estimated (on Jan. 23) Ro to be between 1.4 and 2.5.
Other studies have estimated a Ro between 3.6 and 4.0, and between 2.24 to 3.58.
Preliminary studies had estimated Ro to be between 1.5 and 3.5.
An outbreak with a reproductive number of below 1 will gradually disappear.
For comparison, the Ro for the common flu is 1.3 and for SARS it was 2.0.
Fatality Rate (case fatality ratio or CFR) of the COVID19See full details:COVID19 Fatality Rate
The novel coronavirus' case fatality rate has been estimated at around 2%, in the WHO press conference held on January 29, 2020 . However, it noted that, without knowing how many were infected, it was too early to be able to put a percentage on the mortality rate figure.
A prior estimate had put that number at 3%.
Fatality rate can change as a virus can mutate, according to epidemiologists.
For comparison, the case fatality rate for SARS was 10%, and for MERS 34%.
Symptoms of the novel coronavirus (2019-nCoV) may appear in as few as 2 days or as long as 14 (estimated ranges vary from 2-10 days, 2-14 days, and 10-14 days, see details), during which the virus is contagious but the patient does not display any symptom (asymptomatic transmission).
🎉 COVID19 API - UPDATED v1.2.1
Fixed a bug related to the getDeaths() function, this because now the worldometers website data had to be parsed directly from the table element.
Cases detected by the states, regions, or Communities of each country. For future updates this list may increase. List updated today 04/19/2020
PluginManager.getGermanyCasesByRegion()
PluginManager.getSwedenCasesByRegion()
PluginManager.getSlovakiaCasesByDistrict()
PluginManager.getPortugalCasesByRegion()
PluginManager.getPolandCasesByRegion()
PluginManager.getPalestineCasesByRegion()
PluginManager.getNorwayCasesByRegion()
PluginManager.getBrazilCasesByRegion()
PluginManager.getAlgeriaCasesByRegion()
Data Provided by ICNL The International Center for Not-for-Profit Law
Public data of each country, with updated data in real time.
The problem with this function is that the data takes a little time to display, this is due to the large amount of data that is added to COVID-19 google spreadsheets.
According to information it is possible that the data is moved due to the large amount of data on the page. Eventually any changes I will be aware of.
Since the data is not well parsed I leave you a table referencing the properties:
Object Properties
A = Province/State
B = date
C = Case Type
D = Cases
E = Long
F = Lat
D = Difference
H = Last Update Date
{
"53065":"Argentina",
"A":"",
"B":"2020-03-15",
"C":"Confirmed",
"D":"45",
"E":"-63.6167",
"F":"-38.4161",
"G":"11",
"H":"2020-03-16 12:08:25"
},
{
"53065":"Armenia",
"A":"",
"B":"2020-01-22",
"C":"Confirmed",
"D":"0",
"E":"45.0382",
"F":"40.0691",
"G":"0",
"H":"2020-03-16 12:08:25"
},
PluginManager.getTestsInUS()
Reporting public health labs are 48 state public health labs (AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, SD, TN, TX, VT, WA, WI, WV and WY), New York City, USAF, and 9 California counties.
Non-respiratory specimens were excluded. For state public health labs, the date represents the date of sample collection, if available, or the date tested. For CDC labs, the date represents the date specimen was received at CDC.
Age, Sex, Existing Conditions of COVID-19 Cases and Deaths
PluginManager.getFatalityRateByAge()
Age of Coronavirus Deaths - COVID-19 Fatality Rate by AGE
Death Rate = (number of deaths / number of cases) = probability of dying if infected by the virus (%). This probability differs depending on the age group. The percentages shown below do not have to add up to 100%, as they do NOT represent share of deaths by age group. Rather, it represents, for a person in a given age group, the risk of dying if infected with COVID-19.
*Death Rate = (number of deaths / number of cases) = probability of dying if infected by the virus (%). The percentages do not have to add up to 100%, as they do NOT represent share of deaths by age group.
[
[
{
'0':'AGE',
'1':'DEATHRATEconfirmedcases',
'2':'DEATHRATEallcases'
},
{'0':'80+yearsold','1':'21.9%','2':'14.8%'},
{'0':'70-79yearsold','1':'','2':'8.0%'},
{'0':'60-69yearsold','1':'','2':'3.6%'},
{'0':'50-59yearsold','1':'','2':'1.3%'},
{'0':'40-49yearsold','1':'','2':'0.4%'},
{'0':'30-39yearsold','1':'','2':'0.2%'},
{'0':'20-29yearsold','1':'','2':'0.2%'},
{'0':'10-19yearsold','1':'','2':'0.2%'},
{'0':'0-9yearsold','1':'','2':'nofatalities'}
]
]
PluginManager.getFatalityRateBySex()
Sex ratio - COVID-19 Fatality Rate by SEX
Death Rate = (number of deaths / number of cases) = probability of dying if infected by the virus (%). This probability differs depending on sex. When reading these numbers, it must be taken into account that smoking in China is much more prevalent among males. Smoking increases the risks of respiratory complications.
Death Rate = (number of deaths / number of cases) = probability of dying if infected by the virus (%). The percentages do not have to add up to 100%, as they do NOT represent share of deaths by sex.
[
[
{
'0':'SEX',
'1':'DEATHRATEconfirmedcases',
'2':'DEATHRATEallcases'
},
{'0':'Male','1':'4.7%','2':'2.8%'},
{'0':'Female','1':'2.8%','2':'1.7%'}
]
]
Pre-existing medical conditions (comorbidities)
Patients who reported no pre-existing ("comorbid") medical conditions had a case fatality rate of 0.9%. Pre-existing illnesses that put patients at higher risk of dying from a COVID-19 infection are:
PluginManager.getFatalityRateByComorbidities()
COVID-19 Fatality Rate by COMORBIDITY
Death Rate = (number of deaths / number of cases) = probability of dying if infected by the virus (%). This probability differs depending on pre-existing condition. The percentage shown below does NOT represent in any way the share of deaths by pre-existing condition. Rather, it represents, for a patient with a given pre-existing condition, the risk of dying if infected by COVID-19.
The 177 countries where COVID-19 has spread and reported
[
[
{
"Country":"China",
"Cases":"80,928",
"Deaths":"3,245",
"Region":"Asia"
},
{
"Country":"Italy",
"Cases":"35,713",
"Deaths":"2,978",
"Region":"Europe"
},
{
"Country":"Iran",
"Cases":"18,407",
"Deaths":"1,284",
"Region":"Asia"
},
{
"Country":"Spain",
"Cases":"17,147",
"Deaths":"767",
"Region":"Europe"
},
{
"Country":"Germany",
"Cases":"13,632",
"Deaths":"33",
"Region":"Europe"
},
{
"Country":"United States",
"Cases":"9,479",
"Deaths":"155",
"Region":"North America"
},
//.....
]
]
Travel Health Notices
PluginManager.getTravelHealthNotices()
Department of State Safety and Security Alerts
Types of Notices
Warning Level 3 (Red):Avoid all non-essential travel to this destination. The outbreak is of high risk to travelers and no precautions are available to protect against the identified increased risk.
Alert Level 2 (Yellow):Practice enhanced precautions for this destination. The Travel Health Notice describes additional precautions added, or defines a specific at-risk population.
Watch Level 1 (Green): Practice usual precautions for this destination, as described in the Travel Health Notice and/or on the destination page. This includes being up-to-date on all recommended vaccines and practicing appropriate mosquito avoidance.
{
"data":{
"travelHealthNotices":{
"warning":[
{
"title":"COVID-19 in Malaysia",
"date":"March 18, 2020",
"summary":"Malaysia is experiencing widespread ongoing transmission of respiratory illness caused by the novel coronavirus (COVID-19). CDC recommends that travelers avoid all nonessential travel to Malaysia."
},
//.....
],
"alert":[
{
"title":"Global COVID-19 Outbreak Notice",
"date":"March 16, 2020",
"summary":"Ongoing community transmission of respiratory illness caused by the novel (new) coronavirus (COVID-19) is occurring globally. Older adults and people of any age with serious chronic medical conditions should consider postponing nonessential travel. "
},
//.....
],
"watch":[
{
"title":"Dengue in the Americas",
"date":"March 17, 2020",
"summary":"Dengue is a risk in many parts of Central and South America, Mexico, and the Caribbean. Some countries are reporting increased numbers of cases of the disease. Travelers to the Americas can protect themselves by preventing mosquito bites.\n"
Name: Name of the facility, same as Definitive Healthcare data.
Hospital Type: Hospital Type from Definititve Healthcare data. See Hospital Types.
Address, Address_2, City, State, Zipcode, County, Latitude, Longitude: Location information from the Definitive Healthcare data.
Staffed All Beds: Number of hospital beds of all types typically set up and staffed for inpatient care as reported/estimated in selected facility or area.
Staffed ICU Beds: Number of ICU beds typically set up and staffed for intensive inpatient care as reported/estimated in selected facility or area.
Licensed All Beds: Number of hospital beds of all types licensed for potential use in selected facility or area.
All Bed Occupancy Rate: % of hospital beds of all types typically occupied by patients in selected facility or area.
ICU Bed Occupancy Rate: % of ICU beds typically occupied by patients in selected facility or area.
CCM_ID: Unique identifier for the facility. Matches the Definitive Healtchare ID until new facilities are added or other datasets are brought in.
DH-OBJECTID: The OBJECTID in the Definitive Healthcare dataset for this facility.
HCRIS-Provider Number: The Provider Number from the HCRIS reports (also matches the PROVIDER_NUMBER field in the facility information).
[
{
table:[
{
"Name":"Ascension St Vincent Carmel (FKA St Vincent Carmel Hospital)",
Aggregated facility capacity information by County
Name: Name of the facility, same as Definitive Healthcare data.
Hospital Type: Hospital Type from Definititve Healthcare data. See Hospital Types*
Address, Address_2, City, State, Zipcode, County, Latitude, Longitude: Location information from the Definitive Healthcare data.*
Staffed All Beds: Number of hospital beds of all types typically set up and staffed for inpatient care as reported/estimated in selected facility or area
Staffed ICU Beds: Number of ICU beds typically set up and staffed for intensive inpatient care as reported/estimated in selected facility or area
Licensed All Beds: Number of hospital beds of all types licensed for potential use in selected facility or area
All Bed Occupancy Rate: % of hospital beds of all types typically occupied by patients in selected facility or area*
ICU Bed Occupancy Rate: % of ICU beds typically occupied by patients in selected facility or area*
CCM_ID: Unique identifier for the facility. Matches the Definitive Healtchare ID until new facilities are added or other datasets are brought in.
DH-OBJECTID: The OBJECTID in the Definitive Healthcare dataset for this facility.
HCRIS-Provider Number: The Provider Number from the HCRIS reports (also matches the PROVIDER_NUMBER field in the facility information).
Per Capita Information: There are additional per-capita fields in the regional datasets:
Population: Population of this region, sourced by the US Census Bureau 2018 county population estimates.
Population (20+): Population of people aged 20 years or older.
Population (65+): Population of people aged 65 years or older.
Staffed All Beds [Per 1000 People], Staffed All Beds [Per 1000 Adults (20+)], Staffed All Beds [Per 1000 Elderly (65+)], etc.: The Staffed All Beds, Staffed ICU Beds, and Licensed All Beds fields per capita of the population described.
[
[
{
table:[
{
"State":"AL",
"Population":"44153.0",
"CountyName":"Chilton",
"StaffedAllBeds":"26.0",
"StaffedICUBeds":"6.0",
"LicensedAllBeds":"30.0",
"AllBedOccupancyRate":"0.29",
"ICUBedOccupancyRate":"0.1",
"Population_20_plus":"32683.0",
"Population_65_plus":"7411.0",
"StaffedAllBedsPer1000People":"0.589",
"StaffedAllBedsPer1000Adults20_plus":"0.796",
"StaffedAllBedsPer1000Elderly65_plus":"3.508",
"StaffedICUBedsPer1000People":"0.136",
"StaffedICUBedsPer1000Adults20_plus":"0.184",
"StaffedICUBedsPer1000Elderly65_plus":"0.81",
"LicensedAllBedsPer1000People":"0.679",
"LicensedAllBedsPer1000Adults20_plus":"0.918",
"LicensedAllBedsPer1000Elderly65_plus":"4.048"
},
{
"State":"AL",
"Population":"12841.0",
"CountyName":"Choctaw",
"StaffedAllBeds":"25.0",
"StaffedICUBeds":"0.0",
"LicensedAllBeds":"25.0",
"AllBedOccupancyRate":"0.23",
"ICUBedOccupancyRate":"",
"Population_20_plus":"10028.0",
"Population_65_plus":"2953.0",
"StaffedAllBedsPer1000People":"1.947",
"StaffedAllBedsPer1000Adults20_plus":"2.493",
"StaffedAllBedsPer1000Elderly65_plus":"8.466",
"StaffedICUBedsPer1000People":"0.0",
"StaffedICUBedsPer1000Adults20_plus":"0.0",
"StaffedICUBedsPer1000Elderly65_plus":"0.0",
"LicensedAllBedsPer1000People":"1.947",
"LicensedAllBedsPer1000Adults20_plus":"2.493",
"LicensedAllBedsPer1000Elderly65_plus":"8.466"
},
//.....
]
}
],
]
Johns Hopkins - Coronavirus Resource Center (CSSE COVID-19 Dataset)
This is the data for the 2019 Novel Coronavirus Visual Dashboard operated by the Johns Hopkins University Center for Systems Science and Engineering (JHU CSSE). Also, Supported by ESRI Living Atlas Team and the Johns Hopkins University Applied Physics Lab (JHU APL).
PluginManager.getJohnsHopkinsDataDailyReport()
[
[
{
table:[
{
"Province_State":"South Carolina",
"Country_Region":"US",
"Last_Update":"2020-03-26 23:48:35",
"Lat":"34.22333378",
"Long_":"-82.46170658",
"Confirmed":"3",
"Deaths":"0",
"Recovered":"0",
"Active":"0",
"Combined_Key":"Abbeville, South Carolina, US"
},
{
"Province_State":"Louisiana",
"Country_Region":"US",
"Last_Update":"2020-03-26 23:48:35",
"Lat":"30.295064899999996",
"Long_":"-92.41419698",
"Confirmed":"3",
"Deaths":"0",
"Recovered":"0",
"Active":"0",
"Combined_Key":"Acadia, Louisiana, US"
},
//.....
]
}
]
]
PluginManager.downloadReportsToCSV()
Download report of all cases confirmed by each country in CSV formatIt will download the file to the Desktop directory with the name reports.csv
You should execute the function as follows
awaitPluginManager.downloadReportsToCSV();
⚠️Section in process, once I have a large number of countries with the data I will be updating the library.
🌎 Cases detected by the states, regions, or Communities of each country
"notes":"Please stop using the \"total\" field. Use \"totalTestResults\" instead.",
"hash":"2f85c0f1a7ae3339571cb9ca079718611f5f35c8"
},
{
"state":"AL",
"positive":3611,
"positiveScore":1,
"negativeScore":1,
"negativeRegularScore":0,
"commercialScore":1,
"grade":"B",
"score":3,
"negative":18058,
"pending":null,
"hospitalizedCurrently":null,
"hospitalizedCumulative":437,
"inIcuCurrently":null,
"inIcuCumulative":189,
"onVentilatorCurrently":null,
"onVentilatorCumulative":119,
"recovered":null,
"lastUpdateEt":"4/13 00:00",
"checkTimeEt":"4/13 09:46",
"death":95,
"hospitalized":437,
"total":21669,
"totalTestResults":21669,
"posNeg":21669,
"fips":"01",
"dateModified":"2020-04-13T04:00:00Z",
"dateChecked":"2020-04-13T13:46:00Z",
"notes":"Please stop using the \"total\" field. Use \"totalTestResults\" instead.",
"hash":"aad3ca84c754906faa48f4bbf062b23c5e0ce9e3"
},
]
}
]
]
Germany
PluginManager.getGermanyCasesByRegion()
[
[
{
"table":[
{
"region":"Baden-Württemberg",
"infectedCount":26543,
"deceasedCount":872
},
{
"region":"Bayern",
"infectedCount":36027,
"deceasedCount":1
},
{
"region":"Berlin",
"infectedCount":4945,
"deceasedCount":84
},
//.....
]
}
]
]
Sweden
PluginManager.getSwedenCasesByRegion()
[
[
{
"table":[
{
"region":"Blekinge",
"infectedCount":43,
"deathCount":2,
"intensiveCareCount":3
},
{
"region":"Dalarna",
"infectedCount":429,
"deathCount":63,
"intensiveCareCount":30
},
{
"region":"Gävleborg",
"infectedCount":357,
"deathCount":36,
"intensiveCareCount":23
},
//.....
]
}
]
]
Slovakia
PluginManager.getSlovakiaCasesByDistrict()
[
[
{
"table":[
{
"attributes":{
"NAME":"Okresy Bratislava",
"hospitalizovani_so_symptomami":2,
"intenzivna_starostlivost":0,
"celkom_hospitalizovani":2,
"domaca_izolacia":10,
"miesto_liecenia_nezverejnene":13,
"celkom_sucasne_pozitivni":192,
"pozitivni_predch_den":188,
"novi_pozitivni":4,
"vyzdraveni":0,
"mrtvi":0,
"celkom_pozitivni":192,
"vykonane_testy":0
}
},
{
"attributes":{
"NAME":"Pezinok",
"hospitalizovani_so_symptomami":0,
"intenzivna_starostlivost":0,
"celkom_hospitalizovani":0,
"domaca_izolacia":0,
"miesto_liecenia_nezverejnene":1,
"celkom_sucasne_pozitivni":89,
"pozitivni_predch_den":88,
"novi_pozitivni":1,
"vyzdraveni":0,
"mrtvi":0,
"celkom_pozitivni":89,
"vykonane_testy":0
}
},
{
"attributes":{
"NAME":"neuvedený",
"hospitalizovani_so_symptomami":0,
"intenzivna_starostlivost":0,
"celkom_hospitalizovani":0,
"domaca_izolacia":0,
"miesto_liecenia_nezverejnene":0,
"celkom_sucasne_pozitivni":53,
"pozitivni_predch_den":53,
"novi_pozitivni":0,
"vyzdraveni":0,
"mrtvi":0,
"celkom_pozitivni":53,
"vykonane_testy":0
}
},
//.....
]
}
]
]
Portugal
PluginManager.getPortugalCasesByRegion()
{
"data":[
{
"table":[
{
"region":"PORTO",
"cases":1059
},
{
"region":"LISBOA",
"cases":1038
},
{
"region":"VILA NOVA DE GAIA",
"cases":1035
},
]
}
]
}
Poland
PluginManager.getPolandCasesByRegion()
{
"data":[
{
"table":[
{
"region":"dolnoslaskie",
"infectedCount":1014,
"deceasedCount":30
},
{
"region":"kujawsko-pomorskie",
"infectedCount":406,
"deceasedCount":16
},
{
"region":"lubelskie",
"infectedCount":308,
"deceasedCount":10
},
//.....
]
}
]
}
Palestine
PluginManager.getPalestineCasesByRegion()
{
"data":[
{
"table":[
{
"region":"Qatanna",
"cases":49
},
{
"region":"Bethlehem",
"cases":38
},
{
"region":"Biddu",
"cases":34
},
{
"region":"Artas",
"cases":14
},
//.....
]
}
]
}
Norway
PluginManager.getNorwayCasesByRegion()
{
"data":[
{
"table":[
{
"region":"Agder",
"infectedCount":287
},
{
"region":"Innlandet",
"infectedCount":412
},
{
"region":"Møre og Romsdal",
"infectedCount":118
},
]
}
]
}
Brazil
PluginManager.getBrazilCasesByRegion()
{
"data":[
{
"table":[
{
"state":"AC",
"cases":142
},
{
"state":"AL",
"cases":132
},
{
"state":"AP",
"cases":393
},
//.....
]
}
]
}
Algeria
PluginManager.getAlgeriaCasesByRegion()
{
"data":[
{
"table":[
{
"region":"BLIDA",
"cases":669
},
{
"region":"ALGER",
"cases":445
},
{
"region":"ORAN",
"cases":153
},
{
"region":"SETIF",
"cases":111
},
//.....
]
}
]
}
Data Provided by ICNL The International Center for Not-for-Profit Law
COVID-19 Civic Freedom Tracker
This tracker monitors government responses to the pandemic that affect civic freedoms and human rights, focusing on emergency laws.
PluginManager.getCivicFreedomTracker()
[
[
{
"table":[
{
"country":"Albania",
"title":"Normative Act",
"description":"The normative act, issued by the government without parliamentary approval per Article 101 of Albania's Constitution, provides for fines to be levied on anyone who violates measures to contain the coronavirus. Among other provisions, participating in or organizing a political, social, or cultural gathering is subject to a fine of 5 million lek (40,000 Euros). (See primary source or citation here)",
"type":"order",
"date":"15 Mar 2020",
"issue":"Assembly"
},
{
"country":"Algeria",
"title":"Ban on Public Gatherings",
"description":"President Abdelmadjid Tebboune bans all protests, marches, demonstrations, and other mass gatherings, due to the coronavirus epidemic. His order also closes all public spaces suspected of being a hub for the virus. (See primary source or citation here)",
"type":"order",
"date":"17 Mar 2020",
"issue":"Assembly"
},
{
"country":"Angola",
"title":"Decree No. 82/20 on a State of Exception to Prevent and Control the Covid-19 Pandemic",
"description":"The presidential decree declares a nationwide \"state of exception.\" The decree grants the government power to limit individuals' freedom of movement and assembly, requisition private property, and forcibly confine people deemed likely to transmit COVID-19. (See primary source or citation here)",
"type":"order",
"date":"27 Mar 2020",
"issue":"Assembly, Emergency"
},
{
"country":"Argentina",
"title":"No. 297 of 2020 on Preventative and Mandatory Social Isolation",
"description":"The decree mandates that all individuals self-isolate at their homes with minimal exceptions, in order to combat the spread of the coronavirus. The decree also prohibits gatherings of persons for any reason. According to the decree, the Ministry of Security will place permanent controls on public roads and routes as it deems necessary to limit movement and enforce compliance. (See primary source or citation here)",
COVID19 API is an open source project licensed by MIT with continuous development. If you want me to continue maintaining this library and you are interested in continuing to use it, you can help me with a monetary help in the following link:
These are projects that take a lot of effort and time to maintain. So with your help I will be more motivated to continue maintaining the COVID19 API project.
This is just a personal project created for study / demonstration purpose and to simplify my working life, it may or may
not be a good fit for your project(s).
❤️ Show your support
Please ⭐️ this repository if you like it or this project helped you!
Feel free to open issues or submit pull-requests to help me improving my work.