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!
API for Current cases and more stuff about COVID-19 and Influenza
Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE
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:
- Choose an endpoint from the API documentation: https://disease.sh/docs/
- Make a GET request to the desired endpoint using your preferred programming language or tool
- 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.
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.
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.
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 designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Welcome to disease.sh - An open API for disease-related statistics
Check out our homepage and sign up for our newsletter here
Recommended by Postman
Disease.sh is recommended by Postman here
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.
Documentation
Disease.sh Documentation can be found here
Installation
Without Docker
Redis
- Download redis from https://redis.io/topics/quickstart
- Start redis server using
redis-server
Project
- Fork and clone the git repository
- In the new folder you will find a
example.env
file, duplicate it and rename it to.env
only. - in the new
.env
file, changeREDIS_HOST
to localhost - Change the env variables to fit your environment (leave them blank for default values)
- In one window run
redis-server
- Run
npm ci
to install the packages - In another window run
npm run start:dev
- Open your browser and navigate to
localhost:{PORT}
(PORT being the port specified in your.env
file) - You should now see the APIs landing page
With docker-compose
- Fork and clone the git repository
- In the new folder you will find a
example.env
file, duplicate it and rename it to.env
only. - Change the env variables to fit your environment (leave them blank for default values)
- Run
npm run docker-start-dev
to run the local version of the API with Docker - Run
npm run docker-start
to run the published version of the API with Docker
Recommended Javascript Wrapper
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://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_time_series
https://www.canada.ca/en/public-health/services/diseases/2019-novel-coronavirus-infection.html
https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Situationsberichte/Gesamt.html
Contributing
Contributors â¨
Thanks goes to these wonderful people (emoji key):
License
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!
API for Current cases and more stuff about COVID-19 and Influenza
Novel Coronavirus (COVID-19) Cases, provided by JHU CSSE
JSON time-series of coronavirus cases (confirmed, deaths and recovered) per country - updated daily
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot