NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

Covid-19 API

The Covid-19 API provides current and historical Covid-19 data for every country in the world. Available data includes confirmed case counts and deaths, and is updated everyday.

(4.3)

From 3,620 users

1,800+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
364ms385ms432ms662ms1042ms

Didn't find what you were looking for? Suggest an improvement


/v1/covid19 GET

https://api.api-ninjas.com/v1/covid19

Returns either a time series of Covid-19 case counts/deaths for a country/region or a single-day snapshot of every country in the world (see parameters).

Parameters

Either date or country must be set.

  • date  optional

    Date to retrieve single-day snapshot. Must be in the form of YYYY-MM-DD (e.g. 2022-01-01).

  • country  optional

    Country name (case insensitive).

  • region  optional

    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  optional

    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  optional

    Type of data to retrieve. Must be either cases or deaths. If not set, cases will be used by default.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.

  • country

    Country name.

  • region

    Administrative region (state or province) name, if applicable.

  • cases

    Object with dates as keys, each containing total (total cases/deaths) and new (new cases/deaths for that day).

Sample Request Live Demo!

country

Try our APIs in the API playground

Sign up for a free API key to get started — no credit card required.

https://api.api-ninjas.com/v1/covid19?country=canada

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
[
    {
      country:"Canada",
      region:"Alberta",
      cases:{
        2020-01-22:{
          total:0,
          new:0
        },
        2020-01-23:{
          total:0,
          new:0
        },
        2020-01-24:{
          total:0,
          new:0
        },
        2020-01-25:{
          total:0,
          new:0
        },
        2020-01-26:{
          total:0,
          new:0
        }
      }
    },
    {
      country:"Canada",
      region:"British Columbia",
      cases:{
        2020-01-22:{
          total:0,
          new:0
        },
        2020-01-23:{
          total:0,
          new:0
        },
        2020-01-24:{
          total:0,
          new:0
        },
        2020-01-25:{
          total:0,
          new:0
        },
        2020-01-26:{
          total:0,
          new:0
        }
      }
    },
    "..."
]

Code Examples

1 2 curl -X GET "https://api.api-ninjas.com/v1/covid19?country=United%20States" \ -H "X-Api-Key: YOUR_API_KEY"

If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.

Frequently Asked Questions

  • Yes, but you must have a premium subscription. Commercial use of the Covid-19 API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.
  • The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.
  • The Covid-19 API returns current and historical confirmed case counts and death data for every country in the world, and is updated every day. You can retrieve either a full time series for a country or a single-day snapshot across all countries depending on which parameters you set.
  • Set the country parameter (case insensitive) to get a time series for that country, and add region for a specific state or province; otherwise countries with regional breakdowns return separate data per region. For United States data, you can drill down further by combining country (United States), region (e.g. California), and county. See the related Country API for country metadata.
  • Either date or country must be set; pass date in YYYY-MM-DD format (e.g. 2022-01-01) to get a single-day snapshot of every country. Use the type parameter set to cases or deaths to choose the metric, with cases as the default. Check error codes if a request is unsuccessful.
  • Each object in the returned JSON array includes country, an optional region, and a cases object keyed by date, where each date holds total (cumulative count) and new (count for that day). To explore other health-related datasets, see our full API catalog or the Hospitals API.