www.npmjs.com Open in urlscan Pro
2606:4700::6811:dfaf  Public Scan

URL: https://www.npmjs.com/package/novelcovid
Submission: On September 23 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

GET /search

<form id="search" method="GET" action="/search" class="_13c93d41 relative flex bg-transparent ph3 ph2 pv2 ph0-ns pv0-ns bt b--black-10 bn-ns">
  <div class="e82b10fd relative dde91b96">
    <div class="_2f299eeb nowrap flex"><span class="_705cdf4f db fl pl3 pr1"><svg width="15px" height="15px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" aria-hidden="true">
          <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
            <g stroke="#777777" stroke-width="1.3">
              <g>
                <path d="M13.4044,7.0274 C13.4044,10.5494 10.5494,13.4044 7.0274,13.4044 C3.5054,13.4044 0.6504,10.5494 0.6504,7.0274 C0.6504,3.5054 3.5054,0.6504 7.0274,0.6504 C10.5494,0.6504 13.4044,3.5054 13.4044,7.0274 Z"></path>
                <path d="M11.4913,11.4913 L17.8683,17.8683"></path>
              </g>
            </g>
          </g>
        </svg></span><input type="search" role="combobox" name="q" hotkeys="[object Object]" placeholder="Search packages" aria-label="Search packages" aria-controls="typeahead-list-439220" aria-expanded="false" aria-activedescendant=""
        inputref="[object Object]" autocomplete="off" class="_390acbc5 f5 fw3 black relative" value="" element="input"></div>
  </div><button type="submit" class="_0da775bb bn pv2 ph4 f6 white pointer bn pv2 ph4 f6 white pointer" aria-label="Search">Search</button><input type="hidden" name="csrftoken" value="a_kOZtJQ6_h2ECbERPxBjuxNBTLSkg_Ldz1-bycknKe">
</form>

Text Content

skip to:contentpackage searchsign in
❤
 * Pro
 * Teams
 * Pricing
 * Documentation

npm


Search
Sign UpSign In


NOVELCOVID


3.0.2 • Public • Published 3 years ago
 * Readme
 * Code Beta
 * 1 Dependency
 * 7 Dependents
 * 29 Versions


NOVELCOVID

(AKA COVIDAPI)

A JavaScript Wrapper for the novelCOVID API









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 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)


README


KEYWORDS

 * coronavirus
 * wrapper
 * api








PACKAGE SIDEBAR


INSTALL

npm i novelcovid


REPOSITORY

Gitgithub.com/NovelCOVID/node-api


HOMEPAGE

github.com/NovelCOVID/node-api#readme


DOWNLOADSWEEKLY DOWNLOADS

554


VERSION

3.0.2


LICENSE

WTFPL


UNPACKED SIZE

67.1 kB


TOTAL FILES

6


ISSUES

1


PULL REQUESTS

3


LAST PUBLISH

3 years ago


COLLABORATORS

 * 
 * 

Try on RunKit
Report malware


FOOTER


SUPPORT

 * Help
 * Advisories
 * Status
 * Contact npm


COMPANY

 * About
 * Blog
 * Press


TERMS & POLICIES

 * Policies
 * Terms of Use
 * Code of Conduct
 * Privacy