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.
From 3,620 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 364ms | 385ms | 432ms | 662ms | 1042ms |
Similar APIs
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.
dateoptionalDate to retrieve single-day snapshot. Must be in the form of
YYYY-MM-DD(e.g.2022-01-01).countryoptionalCountry name (case insensitive).
regionoptionalAdministrative 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.countyoptionalCounty name for US states (case insensitive). For United States data only. Must be used in conjunction with
country(United States) andregion(e.g.California).typeoptionalType of data to retrieve. Must be either
casesordeaths. If not set,caseswill be used by default.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON array of objects, each containing the following fields, or an error if the request is unsuccessful.
countryCountry name.
regionAdministrative region (state or province) name, if applicable.
casesObject with dates as keys, each containing
total(total cases/deaths) andnew(new cases/deaths for that day).
Sample Request Live Demo!
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=canadaHeaders
X-Api-KeyLog in or sign up to get your API KeySample Response
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
Can I use the Covid-19 API for commercial purposes?
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.How do I get an API key and start using the Covid-19 API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
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.What happens if a request to the Covid-19 API fails?
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.What does the Covid-19 API provide and how often is it updated?
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.How do I query data for a specific country, region, or county?
Set thecountryparameter (case insensitive) to get a time series for that country, and addregionfor 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 combiningcountry(United States),region(e.g.California), andcounty. See the related Country API for country metadata.How do I get a single-day snapshot or retrieve death data instead of cases?
Eitherdateorcountrymust be set; passdateinYYYY-MM-DDformat (e.g.2022-01-01) to get a single-day snapshot of every country. Use thetypeparameter set tocasesordeathsto choose the metric, withcasesas the default. Check error codes if a request is unsuccessful.What fields does the Covid-19 API response include?
Each object in the returned JSON array includescountry, an optionalregion, and acasesobject keyed by date, where each date holdstotal(cumulative count) andnew(count for that day). To explore other health-related datasets, see our full API catalog or the Hospitals API.