All Projects → disease-sh → node-api

disease-sh / node-api

Licence: WTFPL License
A JavaScript API Wrapper for NovelCOVID/API

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-api

firebase-db-wrapper-swift
An easy-to-use wrapper for Firebase's Realtime Database
Stars: ✭ 16 (-74.6%)
Mutual labels:  wrapper
raylib-nelua
Raylib wrapper to nelua language
Stars: ✭ 27 (-57.14%)
Mutual labels:  wrapper
Covid-19-analysis
Analysis with Covid-19 data
Stars: ✭ 49 (-22.22%)
Mutual labels:  coronavirus
JDSP4Linux
An audio effect processor for PipeWire and PulseAudio clients
Stars: ✭ 192 (+204.76%)
Mutual labels:  wrapper
coinmarketcap-api
CoinMarketCap API wrapper for node
Stars: ✭ 111 (+76.19%)
Mutual labels:  wrapper
with-wrapper
React HOC for wrapper components.
Stars: ✭ 35 (-44.44%)
Mutual labels:  wrapper
restique
A wrapper around restic with profiles
Stars: ✭ 43 (-31.75%)
Mutual labels:  wrapper
fireREST
Python library for interacting with Cisco Firepower Management Center REST API
Stars: ✭ 47 (-25.4%)
Mutual labels:  wrapper
China CoronaVirus Data Miner
Collects officially published daily stats for the corona-virus (China only) 收集新冠状病毒中国每日疫情数据,精确到地级
Stars: ✭ 24 (-61.9%)
Mutual labels:  coronavirus
COVID-19-AI
Collection of AI resources to fight against Coronavirus (COVID-19)
Stars: ✭ 25 (-60.32%)
Mutual labels:  coronavirus
covid-19-self-assessment
The tool takes the public through a series of questions to inform those who are concerned they may have contracted COVID-19.
Stars: ✭ 31 (-50.79%)
Mutual labels:  coronavirus
TLightFileStream
Implements a lightweight, high-performance, non-allocating advanced-record-based wrapper around the SysUtils file handling routines as an alternative to Classes.TFileStream.
Stars: ✭ 21 (-66.67%)
Mutual labels:  wrapper
RT-Thread-wrapper-of-uCOS-II
RT-Thread操作系统的uCOS-II兼容层:让基于uC/OS-II操作系统开发的应用层无感地迁移到RT-Thread操作系统 | A wrapper which can make codes developed by uCOS-II APIs directly run on RT-Thread
Stars: ✭ 24 (-61.9%)
Mutual labels:  wrapper
align covid
Coronavirus time series aligned by number of cases, not date.
Stars: ✭ 22 (-65.08%)
Mutual labels:  coronavirus
coronavirus
covid-19 data in J
Stars: ✭ 15 (-76.19%)
Mutual labels:  coronavirus
aarogya seva
A beautiful 😍 covid-19 app with self - assessment and more.
Stars: ✭ 118 (+87.3%)
Mutual labels:  coronavirus
SharpPhysFS
Managed wrapper for the PhysFS library
Stars: ✭ 14 (-77.78%)
Mutual labels:  wrapper
Mega-index-heroku
Mega nz heroku index, Serves mega.nz to http via heroku web. It Alters downloading speed and stability
Stars: ✭ 165 (+161.9%)
Mutual labels:  wrapper
coronavirusrd
Web app to show information about the current cases of COVID 19 in Dominican Republic
Stars: ✭ 13 (-79.37%)
Mutual labels:  coronavirus
uniswap-python
🦄 The unofficial Python client for the Uniswap exchange.
Stars: ✭ 533 (+746.03%)
Mutual labels:  wrapper

NovelCovid

(aka covidapi)
A JavaScript Wrapper for the novelCOVID API

GitHub top language Snyk Vulnerabilities for npm scoped package GitHub package.json version GitHub last commit
npm bundle size npm
GitHub issues License Profile visits


Disclaimer

This wrapper is only for COVID-19 related data from the Open Disease API.

Installation

NPM

Using NPM:

npm i -s novelcovid

Remarks

This wrapper uses the '@aero/centra' package to send requests. It is way faster than any other request package other than 'http.request' package.

The allowNull parameter is now available for the all, countries, continents, states and gov endpoints.

Usage

All shown examples use Promises but can also await/async to fetch data using NovelCovid.

Add to project

const api = require('novelcovid');

// you can choose which URL to use, this will not change the behaviour of the API
api.settings({
    baseUrl: 'https://disease.sh' | 'https://api.caw.sh' | 'https://corona.lmao.ninja'
})

Summary

// this prints a summary of global data
api.all().then(console.log)

// this prints a summary of global data with yesterdays data
api.yesterday.all().then(console.log)

// this prints a summary of global data with data from two days ago
api.twoDaysAgo.all().then(console.log)

Countries

// this prints an array of call infected countries
api.countries().then(console.log) 

// this prints an array of call infected countries sorted by cases
api.countries({sort:'cases'}).then(console.log) 

// this prints a specified country
api.countries({country:'austria'}).then(console.log) 

// this prints an array of specified countries
api.countries({country:['austria','china']}).then(console.log) 

Yesterday (Countries)

// this prints an array of all infected countries with yesterdays data
api.yesterday.countries().then(console.log)

// this prints an array of all infected countries with yesterdays data sorted by todays cases
api.yesterday.countries({sort:'cases'}).then(console.log)

// this prints a specified country with yesterdays data
api.yesterday.countries({country:'austria'}).then(console.log)

// this prints an array of specified countries with yesterdays data
api.yesterday.countries({country:['austria','china']}).then(console.log)

Two Days Ago (Countries)

// this prints an array of all infected countries with data from two days ago
api.twoDaysAgo.countries().then(console.log)

// this prints an array of all infected countries with data from two days ago sorted by todays cases
api.twoDaysAgo.countries({sort:'cases'}).then(console.log)

// this prints a specified country with data from two days ago
api.twoDaysAgo.countries({country:'austria'}).then(console.log)

// this prints an array of specified countries with data from two days ago
api.twoDaysAgo.countries({country:['austria','china']}).then(console.log)

Continents

// this prints an array of all infected continents
api.continents().then(console.log) 

// this prints an array of all infected continents sorted by cases
api.continents({sort:'cases'}).then(console.log) 

// this prints a specified continent
api.continents({continent:'europe'}).then(console.log)

Yesterday (Continents)

// this prints an array of all infected continents with yesterdays data
api.yesterday.continents().then(console.log)

// this prints an array of all infected continents with yesterdays data sorted by todays cases
api.yesterday.continents({sort:'cases'}).then(console.log)

// this prints a specified continent with yesterdays data
api.yesterday.continents({continent:'europe'}).then(console.log)

Two Days Ago (Continents)

// this prints an array of all infected continents with data from two days ago
api.twoDaysAgo.continents().then(console.log)

// this prints an array of all infected continents with data from two days ago sorted by todays cases
api.twoDaysAgo.continents({sort:'cases'}).then(console.log)

// this prints a specified continent with data from two days ago
api.twoDaysAgo.continents({continent:'europe'}).then(console.log)

States

// this prints an array of US states and their data
api.states().then(console.log)

// this prints an array of US states and their data sorted by cases
api.states({sort:'cases'}).then(console.log)

// this prints a specified state and its data
api.states({state:'michigan'}).then(console.log)

// this prints an array of specified states and their data
api.states({state:['michigan','new york']}).then(console.log)

Yesterday (States)

// this prints an array of US states with yesterdays data
api.yesterday.states().then(console.log)

// this prints an array of US states with yesterdays data sorted by cases
api.yesterday.states({sort:'cases'}).then(console.log)

// this prints a specified state with yesterdays data
api.yesterday.states({state:'michigan'}).then(console.log)

// this prints an array of specified states with yesterdays data
api.yesterday.states({state:['michigan','new york']}).then(console.log)

JHUCSSE

// this prints an array of infected countries
api.jhucsse.all().then(console.log)

// this prints an array of infected US counties 
api.jhucsse.counties().then(console.log)

// this prints an array of infected provinces of a specified US county 
api.jhucsse.counties({county:'abbeville'}).then(console.log)

// this prints an object with the counties provinces as arrays
api.jhucsse.counties({county:['abbeville','acadia']}).then(console.log)

Historical

// this prints the global timeline
api.historical.all().then(console.log)

// this prints the global timeline for the last 10 days (use -1 to get all data)
api.historical.all().then(console.log)

// this prints an array of infected countries and their timeline
api.historical.countries().then(console.log)

// this prints a specified country and its timeline
api.historical.countries({country:'china'}).then(console.log)

// this prints a specified country and its timeline for the last 10 days (use -1 to get all data)
api.historical.countries({country:'china', days:10}).then(console.log)

// this prints a specified province of a specified country and its timeline
api.historical.countries({country:'china', province:'hubei'}).then(console.log)

// this prints a specified province of a specified country and its timeline
api.historical.countries({country:'china', province:['hubei','anhui']}).then(console.log)

New York Times Data (USA)

// this prints a timeline of data from the US
api.nyt.usa().then(console.log)

// this prints an array of timelines of all infected US states
api.nyt.states().then(console.log)

// this prints a timeline of a specified US state
api.nyt.states({state:'illinois'}).then(console.log)

// this prints an array of timelines all infected US counties
api.nyt.counties().then(console.log)

// this prints an array of timelines of states of a specified US county
api.nyt.counties({county:'cook'}).then(console.log)

Mobility Data (Apple)

// this prints a list of available country names
api.apple.countries().then(console.log)

// this prints a list of available subregions for a specified country
api.apple.subregions('austria').then(console.log)

// this prints mobility data for a specified subregion of a country, all is used to query total data
api.apple.mobilityData({country:'austria', subregion:'all'}).then(console.log)

// this prints mobility data for multiple specified subregions of a country
api.apple.mobilityData({country:'austria', subregion:['vienna', 'salzburg']}).then(console.log)

Official Government Data

// this prints a list of available country names
api.gov().then(console.log)

// this prints the data for a specified country
api.gov('austria').then(console.log)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].