Disclaimer
This wrapper is only for COVID-19 related data from the Open Disease API.
Installation
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 v2/all
, v2/countries
, v2/continents
, v2/states
and v2/gov
endpoints.
Usage
All shown examples use Promises but can also await/async to fetch data using NovelCovid.
Add to project
const api = ; // you can choose which URL to use, this will not change the behaviour of the APIapi
Summary
// this prints a summary of global dataapiall // this prints a summary of global data with yesterdays dataapiyesterdayall // this prints a summary of global data with data from two days agoapitwoDaysAgoall
Countries
// this prints an array of call infected countriesapi // this prints an array of call infected countries sorted by casesapi // this prints a specified countryapi // this prints an array of specified countriesapi
Yesterday (Countries)
// this prints an array of all infected countries with yesterdays dataapiyesterday // this prints an array of all infected countries with yesterdays data sorted by todays casesapiyesterday // this prints a specified country with yesterdays dataapiyesterday // this prints an array of specified countries with yesterdays dataapiyesterday
Two Days Ago (Countries)
// this prints an array of all infected countries with data from two days agoapitwoDaysAgo // this prints an array of all infected countries with data from two days ago sorted by todays casesapitwoDaysAgo // this prints a specified country with data from two days agoapitwoDaysAgo // this prints an array of specified countries with data from two days agoapitwoDaysAgo
Continents
// this prints an array of all infected continentsapi // this prints an array of all infected continents sorted by casesapi // this prints a specified continentapi
Yesterday (Continents)
// this prints an array of all infected continents with yesterdays dataapiyesterday // this prints an array of all infected continents with yesterdays data sorted by todays casesapiyesterday // this prints a specified continent with yesterdays dataapiyesterday
Two Days Ago (Continents)
// this prints an array of all infected continents with data from two days agoapitwoDaysAgo // this prints an array of all infected continents with data from two days ago sorted by todays casesapitwoDaysAgo // this prints a specified continent with data from two days agoapitwoDaysAgo
States
// this prints an array of US states and their dataapi // this prints an array of US states and their data sorted by casesapi // this prints a specified state and its dataapi // this prints an array of specified states and their dataapi
Yesterday (States)
// this prints an array of US states with yesterdays dataapiyesterday // this prints an array of US states with yesterdays data sorted by casesapiyesterday // this prints a specified state with yesterdays dataapiyesterday // this prints an array of specified states with yesterdays dataapiyesterday
JHUCSSE
// this prints an array of infected countriesapijhucsseall // this prints an array of infected US counties apijhucsse // this prints an array of infected provinces of a specified US county apijhucsse // this prints an object with the counties provinces as arraysapijhucsse
Historical
// this prints the global timelineapihistoricalall // this prints the global timeline for the last 10 days (use -1 to get all data)apihistoricalall // this prints an array of infected countries and their timelineapihistorical // this prints a specified country and its timelineapihistorical // this prints a specified country and its timeline for the last 10 days (use -1 to get all data)apihistorical // this prints a specified province of a specified country and its timelineapihistorical // this prints a specified province of a specified country and its timelineapihistorical
New York Times Data (USA)
// this prints a timeline of data from the USapinyt // this prints an array of timelines of all infected US statesapinyt // this prints a timeline of a specified US stateapinyt // this prints an array of timelines all infected US countiesapinyt // this prints an array of timelines of states of a specified US countyapinyt
Mobility Data (Apple)
// this prints a list of available country namesapiapple // this prints a list of available subregions for a specified countryapiapple // this prints mobility data for a specified subregion of a country, all is used to query total dataapiapple // this prints mobility data for multiple specified subregions of a countryapiapple
Official Government Data
// this prints a list of available country namesapi // this prints the data for a specified countryapi