{"id":19272666,"url":"https://github.com/disease-sh/node-api","last_synced_at":"2025-04-21T22:31:46.530Z","repository":{"id":44209711,"uuid":"245088529","full_name":"disease-sh/node-api","owner":"disease-sh","description":"A JavaScript API Wrapper for NovelCOVID/API","archived":false,"fork":false,"pushed_at":"2023-03-04T18:05:07.000Z","size":228,"stargazers_count":61,"open_issues_count":4,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-01T16:13:27.368Z","etag":null,"topics":["coronavirus","data","javascript","library","open-source","wrapper"],"latest_commit_sha":null,"homepage":"https://npmjs.com/novelcovid","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/disease-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-05T06:41:59.000Z","updated_at":"2025-03-18T06:24:05.000Z","dependencies_parsed_at":"2024-06-18T16:48:02.808Z","dependency_job_id":"89b441b6-b162-4af3-a5c6-cc2a55602891","html_url":"https://github.com/disease-sh/node-api","commit_stats":null,"previous_names":["novelcovid/node-api"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disease-sh%2Fnode-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disease-sh%2Fnode-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disease-sh%2Fnode-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/disease-sh%2Fnode-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/disease-sh","download_url":"https://codeload.github.com/disease-sh/node-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250144054,"owners_count":21382139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coronavirus","data","javascript","library","open-source","wrapper"],"created_at":"2024-11-09T20:37:40.076Z","updated_at":"2025-04-21T22:31:46.196Z","avatar_url":"https://github.com/disease-sh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\t\u003ch1\u003eNovelCovid\u003c/h1\u003e\n\t\u003ch6\u003e(aka covidapi)\u003c/h6\u003e\n\t\u003cstrong\u003e \u003ci\u003eA JavaScript Wrapper for the \u003ca href=\"https://disease.sh\"\u003enovelCOVID API\u003c/a\u003e\u003c/i\u003e\u003c/strong\u003e\u003cbr\u003e\u003cbr\u003e\n\n![GitHub top language](https://img.shields.io/github/languages/top/disease-sh/node-api)\n![Snyk Vulnerabilities for npm scoped package](https://img.shields.io/snyk/vulnerabilities/npm/novelcovid)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/novelcovid/node-api)\n![GitHub last commit](https://img.shields.io/github/last-commit/disease-sh/node-api)\u003cbr\u003e\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/novelcovid)\n![npm](https://img.shields.io/npm/dw/novelcovid)\u003cbr\u003e\n![GitHub issues](https://img.shields.io/github/issues-raw/disease-sh/node-api)\n![License](https://img.shields.io/github/license/disease-sh/node-api)\n![Profile visits](https://badges.pufler.dev/visits/disease-sh/node-api)\n\n\u003c/div\u003e\n\u003cbr\u003e\n\n## Disclaimer\nThis wrapper is only for COVID-19 related data from the [Open Disease API](https://disease.sh).\n\n## Installation\n\n[![NPM](https://nodei.co/npm/novelcovid.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/novelcovid/)\n\nUsing NPM:\n\n```bash\nnpm i -s novelcovid\n```\n\n## Remarks\n\nThis wrapper uses the '@aero/centra' package to send requests.\nIt is way faster than any other request package other than 'http.request' package.\n\nThe **allowNull** parameter is now available for the `all`, `countries`, `continents`, `states` and `gov` endpoints. \n\n## Usage\n\nAll shown examples use Promises but can also await/async to fetch data using NovelCovid.\n\n### Add to project \n\n```js\nconst api = require('novelcovid');\n\n// you can choose which URL to use, this will not change the behaviour of the API\napi.settings({\n    baseUrl: 'https://disease.sh' | 'https://api.caw.sh' | 'https://corona.lmao.ninja'\n})\n```\n\n### Summary\n\n```js\n// this prints a summary of global data\napi.all().then(console.log)\n\n// this prints a summary of global data with yesterdays data\napi.yesterday.all().then(console.log)\n\n// this prints a summary of global data with data from two days ago\napi.twoDaysAgo.all().then(console.log)\n```\n\n### Countries\n\n```js\n// this prints an array of call infected countries\napi.countries().then(console.log) \n\n// this prints an array of call infected countries sorted by cases\napi.countries({sort:'cases'}).then(console.log) \n\n// this prints a specified country\napi.countries({country:'austria'}).then(console.log) \n\n// this prints an array of specified countries\napi.countries({country:['austria','china']}).then(console.log) \n```\n\n### Yesterday (Countries)\n\n```js\n// this prints an array of all infected countries with yesterdays data\napi.yesterday.countries().then(console.log)\n\n// this prints an array of all infected countries with yesterdays data sorted by todays cases\napi.yesterday.countries({sort:'cases'}).then(console.log)\n\n// this prints a specified country with yesterdays data\napi.yesterday.countries({country:'austria'}).then(console.log)\n\n// this prints an array of specified countries with yesterdays data\napi.yesterday.countries({country:['austria','china']}).then(console.log)\n```\n\n### Two Days Ago (Countries)\n\n```js\n// this prints an array of all infected countries with data from two days ago\napi.twoDaysAgo.countries().then(console.log)\n\n// this prints an array of all infected countries with data from two days ago sorted by todays cases\napi.twoDaysAgo.countries({sort:'cases'}).then(console.log)\n\n// this prints a specified country with data from two days ago\napi.twoDaysAgo.countries({country:'austria'}).then(console.log)\n\n// this prints an array of specified countries with data from two days ago\napi.twoDaysAgo.countries({country:['austria','china']}).then(console.log)\n```\n\n### Continents\n\n```js\n// this prints an array of all infected continents\napi.continents().then(console.log) \n\n// this prints an array of all infected continents sorted by cases\napi.continents({sort:'cases'}).then(console.log) \n\n// this prints a specified continent\napi.continents({continent:'europe'}).then(console.log)\n```\n\n### Yesterday (Continents)\n\n```js\n// this prints an array of all infected continents with yesterdays data\napi.yesterday.continents().then(console.log)\n\n// this prints an array of all infected continents with yesterdays data sorted by todays cases\napi.yesterday.continents({sort:'cases'}).then(console.log)\n\n// this prints a specified continent with yesterdays data\napi.yesterday.continents({continent:'europe'}).then(console.log)\n```\n\n### Two Days Ago (Continents)\n\n```js\n// this prints an array of all infected continents with data from two days ago\napi.twoDaysAgo.continents().then(console.log)\n\n// this prints an array of all infected continents with data from two days ago sorted by todays cases\napi.twoDaysAgo.continents({sort:'cases'}).then(console.log)\n\n// this prints a specified continent with data from two days ago\napi.twoDaysAgo.continents({continent:'europe'}).then(console.log)\n```\n\n### States\n\n```js\n// this prints an array of US states and their data\napi.states().then(console.log)\n\n// this prints an array of US states and their data sorted by cases\napi.states({sort:'cases'}).then(console.log)\n\n// this prints a specified state and its data\napi.states({state:'michigan'}).then(console.log)\n\n// this prints an array of specified states and their data\napi.states({state:['michigan','new york']}).then(console.log)\n```\n\n### Yesterday (States)\n\n```js\n// this prints an array of US states with yesterdays data\napi.yesterday.states().then(console.log)\n\n// this prints an array of US states with yesterdays data sorted by cases\napi.yesterday.states({sort:'cases'}).then(console.log)\n\n// this prints a specified state with yesterdays data\napi.yesterday.states({state:'michigan'}).then(console.log)\n\n// this prints an array of specified states with yesterdays data\napi.yesterday.states({state:['michigan','new york']}).then(console.log)\n```\n\n### JHUCSSE\n\n```js\n// this prints an array of infected countries\napi.jhucsse.all().then(console.log)\n\n// this prints an array of infected US counties \napi.jhucsse.counties().then(console.log)\n\n// this prints an array of infected provinces of a specified US county \napi.jhucsse.counties({county:'abbeville'}).then(console.log)\n\n// this prints an object with the counties provinces as arrays\napi.jhucsse.counties({county:['abbeville','acadia']}).then(console.log)\n```\n\n### Historical\n\n```js\n// this prints the global timeline\napi.historical.all().then(console.log)\n\n// this prints the global timeline for the last 10 days (use -1 to get all data)\napi.historical.all().then(console.log)\n\n// this prints an array of infected countries and their timeline\napi.historical.countries().then(console.log)\n\n// this prints a specified country and its timeline\napi.historical.countries({country:'china'}).then(console.log)\n\n// this prints a specified country and its timeline for the last 10 days (use -1 to get all data)\napi.historical.countries({country:'china', days:10}).then(console.log)\n\n// this prints a specified province of a specified country and its timeline\napi.historical.countries({country:'china', province:'hubei'}).then(console.log)\n\n// this prints a specified province of a specified country and its timeline\napi.historical.countries({country:'china', province:['hubei','anhui']}).then(console.log)\n```\n\n### New York Times Data (USA)\n\n```js\n// this prints a timeline of data from the US\napi.nyt.usa().then(console.log)\n\n// this prints an array of timelines of all infected US states\napi.nyt.states().then(console.log)\n\n// this prints a timeline of a specified US state\napi.nyt.states({state:'illinois'}).then(console.log)\n\n// this prints an array of timelines all infected US counties\napi.nyt.counties().then(console.log)\n\n// this prints an array of timelines of states of a specified US county\napi.nyt.counties({county:'cook'}).then(console.log)\n```\n\n### Mobility Data (Apple)\n\n```js\n// this prints a list of available country names\napi.apple.countries().then(console.log)\n\n// this prints a list of available subregions for a specified country\napi.apple.subregions('austria').then(console.log)\n\n// this prints mobility data for a specified subregion of a country, all is used to query total data\napi.apple.mobilityData({country:'austria', subregion:'all'}).then(console.log)\n\n// this prints mobility data for multiple specified subregions of a country\napi.apple.mobilityData({country:'austria', subregion:['vienna', 'salzburg']}).then(console.log)\n```\n\n### Official Government Data\n\n```js\n// this prints a list of available country names\napi.gov().then(console.log)\n\n// this prints the data for a specified country\napi.gov('austria').then(console.log)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdisease-sh%2Fnode-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdisease-sh%2Fnode-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdisease-sh%2Fnode-api/lists"}