Convert Figma logo to code with AI

disease-sh logoAPI

API for Current cases and more stuff about COVID-19 and Influenza

2,459
638
2,459
8

Top Related Projects

🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!

2,459

API for Current cases and more stuff about COVID-19 and Influenza

29,136

Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE

1,227

JSON time-series of coronavirus cases (confirmed, deaths and recovered) per country - updated daily

Quick Overview

The disease-sh/API repository is an open-source project that provides a comprehensive API for accessing global disease data, including COVID-19 statistics. It aggregates data from multiple reliable sources and offers endpoints for retrieving up-to-date information on various diseases, their spread, and related statistics.

Pros

  • Offers a wide range of data endpoints for different diseases and regions
  • Regularly updated with the latest information from reliable sources
  • Well-documented API with clear usage instructions
  • Supports multiple output formats (JSON, XML, CSV)

Cons

  • Dependent on external data sources, which may occasionally lead to inconsistencies
  • Limited historical data for some endpoints
  • May experience high traffic during disease outbreaks, potentially affecting response times

Code Examples

// Fetching global COVID-19 data
const axios = require('axios');

axios.get('https://disease.sh/v3/covid-19/all')
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
# Retrieving country-specific COVID-19 data
import requests

country = 'USA'
response = requests.get(f'https://disease.sh/v3/covid-19/countries/{country}')
data = response.json()
print(data)
# Getting vaccine coverage data
require 'net/http'
require 'json'

url = URI('https://disease.sh/v3/covid-19/vaccine/coverage/countries?lastdays=30')
response = Net::HTTP.get(url)
data = JSON.parse(response)
puts data

Getting Started

To start using the disease-sh API, follow these steps:

  1. Choose an endpoint from the API documentation: https://disease.sh/docs/
  2. Make a GET request to the desired endpoint using your preferred programming language or tool
  3. Parse the response (usually in JSON format) to access the data

Example using cURL:

curl -X GET "https://disease.sh/v3/covid-19/all" -H "accept: application/json"

For more detailed information and advanced usage, refer to the official documentation.

Competitor Comparisons

🦠 A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!

Pros of coronavirus-tracker-api

  • Simpler architecture, potentially easier to set up and maintain
  • Focuses specifically on COVID-19 data, which may be beneficial for targeted use cases
  • Provides historical data out of the box

Cons of coronavirus-tracker-api

  • Less actively maintained compared to API
  • Fewer data sources and less comprehensive global coverage
  • Limited additional features beyond basic COVID-19 statistics

Code Comparison

coronavirus-tracker-api:

@app.route("/v2/locations")
def locations():
    # ... (code to fetch and return location data)

API:

app.get("/v3/covid-19/countries", async (req, res) => {
  const { allowNull } = req.query;
  const countries = await getCountries(allowNull);
  res.send(countries);
});

Both repositories provide APIs for COVID-19 data, but API offers a more comprehensive solution with additional features and data sources. coronavirus-tracker-api is simpler and more focused on basic COVID-19 statistics, while API covers a broader range of health-related data and has more active development. The code snippets show similar route handling approaches, with API using Express.js and coronavirus-tracker-api using Flask.

2,459

API for Current cases and more stuff about COVID-19 and Influenza

Pros of API

  • More comprehensive documentation
  • Wider range of data sources and endpoints
  • Active community support and contributions

Cons of API

  • Potentially higher complexity for simple use cases
  • May require more setup and configuration

Code Comparison

API:

const api = require('novelcovid');
api.countries().then(console.log);

API>:

const axios = require('axios');
axios.get('https://disease.sh/v3/covid-19/countries').then(console.log);

Summary

API offers a more feature-rich and well-documented solution for accessing COVID-19 and other disease-related data. It provides a wider range of endpoints and data sources, making it suitable for complex applications. The active community support ensures regular updates and improvements.

API>, on the other hand, appears to be a simpler alternative, potentially easier to integrate for basic use cases. It may require less setup and configuration, making it a good choice for quick prototypes or smaller projects.

The code comparison shows that API provides a dedicated package for easier integration, while API> relies on standard HTTP requests using libraries like axios.

Ultimately, the choice between the two repositories depends on the specific requirements of your project, such as the depth of data needed, ease of integration, and long-term maintenance considerations.

29,136

Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE

Pros of COVID-19

  • Provides raw, detailed data at the county level for the United States
  • Offers historical data dating back to the beginning of the pandemic
  • Maintained by a reputable academic institution (Johns Hopkins University)

Cons of COVID-19

  • Data is primarily in CSV format, requiring additional processing for use in applications
  • Updates may be less frequent compared to API-based solutions
  • Limited to COVID-19 data only, not covering other diseases

Code Comparison

COVID-19 (CSV data example):

Province_State,Country_Region,Last_Update,Confirmed,Deaths,Recovered
New York,US,2023-04-15 04:21:05,6597277,74519,
California,US,2023-04-15 04:21:05,11980461,100187,

API (JSON response example):

{
  "country": "USA",
  "cases": 33002524,
  "deaths": 589703,
  "recovered": 25641517,
  "updated": 1619395261979
}

The COVID-19 repository provides raw CSV data, while the API offers structured JSON responses, making it easier to integrate into applications. The API also provides a more comprehensive set of disease-related data beyond just COVID-19, and offers real-time updates through its API endpoints. However, the COVID-19 repository may be preferred for researchers or analysts who need access to granular, historical data in a format suitable for data analysis tools.

1,227

JSON time-series of coronavirus cases (confirmed, deaths and recovered) per country - updated daily

Pros of covid19

  • Simpler and more focused API, specifically for COVID-19 data
  • Lightweight and easy to integrate into projects
  • Provides data in a JSON format that's ready for use in JavaScript applications

Cons of covid19

  • Limited to COVID-19 data only, while API offers a broader range of disease information
  • Less frequent updates compared to API's real-time data
  • Fewer data points and less granular information than API

Code Comparison

covid19:

import { getCountry } from "https://pomber.github.io/covid19/timeseries.json"
const data = await getCountry("US")
console.log(data[data.length - 1])

API:

const axios = require('axios');
const api = axios.create({ baseURL: 'https://disease.sh/v3/covid-19' });
const response = await api.get('/countries/USA');
console.log(response.data);

The covid19 repository provides a simpler interface for fetching COVID-19 data, while API offers a more comprehensive and flexible approach for accessing various disease-related information. covid19 is ideal for quick integration in JavaScript projects focused solely on COVID-19, whereas API is better suited for applications requiring broader health data and more frequent updates.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Logo

DockerHub Downloads GitHub contributors ESLint Tests GitHub top language GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests Visits

Welcome to disease.sh - An open API for disease-related statistics

InformationDiscord
This API provides a big range of detailed information about multiple viruses. From COVID19 global data overviews to city/region specific mobility data, and data on the current outbreak of Influenza. We also provide official government data for some countries, more to be added soon.

The core-team currently consists of 4 people from 4 different countries working hard to keep this up and running, but it's an open-source project, so if you want, come help us!
Discord server

Check out our homepage and sign up for our newsletter here

Recommended by Postman

Disease.sh is recommended by Postman here

Run in Postman

Run through databar.ai

If you don't know how to use APIs, you can use disease.sh without code through the databar.ai platform.

Run without code

Documentation

Disease.sh Documentation can be found here

Installation

Without Docker

Redis

  1. Download redis from https://redis.io/topics/quickstart
  2. Start redis server using redis-server

Project

  1. Fork and clone the git repository
  2. In the new folder you will find a example.env file, duplicate it and rename it to .env only.
  3. in the new .env file, change REDIS_HOST to localhost
  4. Change the env variables to fit your environment (leave them blank for default values)
  5. In one window run redis-server
  6. Run npm ci to install the packages
  7. In another window run npm run start:dev
  8. Open your browser and navigate to localhost:{PORT} (PORT being the port specified in your .env file)
  9. You should now see the APIs landing page

With docker-compose

  1. Fork and clone the git repository
  2. In the new folder you will find a example.env file, duplicate it and rename it to .env only.
  3. Change the env variables to fit your environment (leave them blank for default values)
  4. Run npm run docker-start-dev to run the local version of the API with Docker
  5. Run npm run docker-start to run the published version of the API with Docker

Recommended Javascript Wrapper

Version Size Downloads

For further support, you can join our discord server! More Tutorials can be found there too! https://discord.gg/cEDxzfW

Showcases (Awesome-NovelCOVID)

Did you build a project with our API? We now offer an "awesome-list" for you to add your projects into so people can find out about them!

You can find it here.

Sources:

https://www.worldometers.info/coronavirus/

https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series

https://github.com/nytimes/covid-19-data

https://github.com/ActiveConclusion/COVID19_mobility

https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html

https://github.com/pcm-dpc/COVID-19

https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Situationsberichte/Gesamt.html

https://info.gesundheitsministerium.at/

https://www.mohfw.gov.in/

https://covid19.ncdc.gov.ng/

https://github.com/openZH/covid_19/

https://coronavirus.data.gov.uk

https://covid19.go.id

https://datadashboard.health.gov.il/COVID-19/general

Contributing

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Ethan Winters

🐛

Julian Pufler

💻

Himanshu Rathore

💻

apollyon600

📖

James Shelley

👀

Ryan Harlow

🐛

Ali Tas

🐛

Walter Corrales

💻

Ahmad Awais ⚡️

📖

MrAugu

🐛

Ayyan Lewis

🐛

Ben Sommer

🐛 💻

Luis De Anda

📖

Oluka Denis

🐛

Kodjo Laurent Egbakou

📖

Juan Sebastián Marulanda Sánchez

💻

Collin-St

💻

MarvelDC

📖

Zentreaxᴰᵉᵛ

💻

comster

💻

License

FOSSA Status

NPM DownloadsLast 30 Days