Get Covid-19 case count or death data.
Returns Covid-19 case counts or deaths by country, administrative region, or US county, as a series or a single-day snapshot. Either `date` or `country` must be set.
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v1/covid19"
});
console.log(output);Query parameters
Date to retrieve single-day snapshot. Must be in the form of YYYY-MM-DD (e.g. 2022-01-01). Either date or country must be set.
Country name (case insensitive). Either date or country must be set.
Administrative region (also known as state or province in many countries) name (case insensitive). Must be used in conjunction with country. If not set, countries with data broken down by administrative regions will return separate data for each region.
County name for US states (case insensitive). For United States data only. Must be used in conjunction with country (United States) and region (e.g. California).
Type of data to retrieve. Must be either cases or deaths. If not set, cases will be used by default. (Allowed: cases, deaths)