Giter VIP home page Giter VIP logo

api's Introduction

All Contributors

Join our Server!

Discord server

API

API for Current cases and more stuff about COVID-19 or the Novel Coronavirus Strain https://corona.lmao.ninja/

Endpoints

GET Request Output
https://corona.lmao.ninja/all Returns all total cases, recovery, and deaths.
https://corona.lmao.ninja/countries Returns data of all countries that has COVID-19
https://corona.lmao.ninja/countries?sort={parameter} Returns data of each country sorted by the parameter
https://corona.lmao.ninja/countries/{country-name} Returns data of a specific country. If an exact name match is desired pass ?strict=true in the query string
https://corona.lmao.ninja/states Returns all United States of America and their Corona data
https://corona.lmao.ninja/jhucsse Return data from the Johns Hopkins CSSE Data Repository (Provinces and such)
https://corona.lmao.ninja/historical Get historical data from the start of 2020. (JHU CSSE GISand Data)
https://corona.lmao.ninja/historical/{country-name} Get historical data from the start of 2020 for a specific country. (JHU CSSE GISand Data)

API Tutorial

Tutorial Made By Apollo#6000

Packages Needed novelcovid

Step 1: Install novelcovid

npm i novelcovid

Step 2: Use either .getAll() or .getCountry() function to retrieve the given data.

// We define the package
let covid = require('novelcovid');

// In this case we will be using .getAll()
// If you would like a .getCountry() tutorial, feel free to join our support server

let data = covid.getAll();
console.log(data);

/* Returns 
{ cases: 220877,
  deaths: 8988,
  recovered: 85782,
  updated: 1584612112774 }
*/

Step 3: Once we have called the API, we can access the data that was given!

let covid = require('novelcovid');

// IMPORTANT: Inorder to access the data, we will need to create an async function.

(async () => {
    let data = await covid.getAll();

    // Since we are using an async function, we need to return the data.
    return console.log(`
    Total Cases: ${data.cases}
    Total Deaths: ${data.deaths}
    Total Recovered: ${data.recovered}
    Last Updated on: ${data.updated}`);
})();

Note Since data.updated returns milliseconds, you can do new Date(data.updated) as it returns an ISO Date

You can read more about new Date() here

For further support, you can join our discord server! More Tutorials can be found there too! https://discord.gg/EvbMshU

Source:

https://www.worldometers.info/coronavirus/

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


EliteDaMyth

๐Ÿ’ป

Ethan Winters

๐Ÿ›

dicedtomato

๐Ÿ’ป

apollyon600

๐Ÿ“–

This project follows the all-contributors specification. Contributions of any kind welcome!

api's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.