MOVED TO ANOTHER LOCATION
Please use novelcovid from now on.
No worries though -> Same code, same maintainer, just the official repository.
Installation
Using NPM:
npm i -s covidapi
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. Other wrappers use node-fetch, which is way slower.
Usage
All shown examples use Promises but can also await/async to fetch data using covidapi.
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
Countries
// this prints api // 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
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
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