Logo

Plansafe Global COVID-19 Data

A free set of simple APIs for current and historical global COVID-19 data.

Get any territory's COVID-19 data.

operational 52 ms new
https://www.plansafe.xyz/api/v1.2/covid/global

Request parameters

country (string)
state (string)
month (integer)
day (integer)
year (integer)

Note: If no state is provided, data for all states in the country will be returned.

Note: If no date is provided, the latest data (March 10, 2023) will be returned.

Response fields

country Name of the country
state Name of the state
date Date at which data was reported to source
fatality_ratio_pct Fatality rate as a percentage of the infected
per_100k Incidence rate per 100,000 people (scaled for the state)
total_confirmed_cases Total confirmed COVID-19 cases in the state
total_deaths Total COVID-19 deaths in the state
total_recovered Total COVID-19 recoveries in the state
active_cases Current number of active COVID-19 cases in the state

Get a territory's COVID-19 status in words.

operational
https://www.plansafe.xyz/api/v1.2/covid/global/words

Request parameters

country (string)
state (string)
month (integer)
day (integer)
year (integer)

Note: If no date is provided, the latest data (March 10, 2023) will be returned.

Response fields

words A couple sentences summarizing the COVID-19 situation in the state/territory.

Example requests/responses

COVID-19 data for Tamil Nadu, India as of March 10, 2023

GET https://www.plansafe.xyz/api/v1.2/covid/global?country=india&state=tamil%20nadu
LIVE 52 ms
{
"active_cases": 3557074,
"country": India,
"date": 2023-03-10 04:21:03,
"fatality_ratio_pct": 1.058350437523278,
"per_100k": 4618.530939379494,
"state": Tamil Nadu,
"total_confirmed_cases": 3595123,
"total_recovered":
"total_deaths": 38049
}

Jan. 1, 2021 COVID-19 data for Hubei, China

GET https://www.plansafe.xyz/api/v1.2/covid/global?country=china&state=hubei&month=1&day=1&year=2021

COVID-19 data for all states in India as of March 10, 2023

GET https://www.plansafe.xyz/api/v1.2/covid/global?country=india

Sample implementations

Python

import requests
url = "https://www.plansafe.xyz/api/v1.2/covid/india"
params = {"state":"tamil nadu"}
res = requests.get(url, params=params)
res.json()

JavaScript

let api_endpoint = new URL('https://www.plansafe.xyz/api/v1.2/covid/india');
api_endpoint.search = new URLSearchParams({
 state: "tamil nadu",
});

fetch(api_endpoint)
 .then(function(response) {
  if(response.ok) {
   response.json().then(function(data) {
    console.log(data)
   });
  } else {
   console.log("response failed");
  }
 });

What is this API for?

If you want comprehensive COVID-19 data for any territory in the world, this API suite can help your efforts. You can leverage this API to gain information from any day about a territory's COVID-19 situation. In addition, other endpoints enable you to get up-to-date regional trends for case counts, infection rates, and more. Get the latest (or historical) COVID-19 trends, numbers, and summaries to your application in no time. Happy building.

Sources

Data is consolidated from a multitude of individual territory, state, and county dashboards as well as the COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University. In addition, data is sourced from the Center for Disease Control (CDC) as well as other sources on the web. Learn more about sources in our data explanation page.

Version history

v1.2 (2/21/2021) - moved to query parameters only

v1.1 (1/24/2021) - changed endpoint (considerable speed improvements due to caching)

v1.0 (12/9/2020) - initial version

Read about it

Issues?