Giter Club home page Giter Club logo

cowin's Introduction

Cowin

A NodeJS wrapper of Cowin Public API. We can win Covid ๐Ÿค

Installation:

npm install cowin

Available methods:

  • getState - Get all states in India
  • getListofDistricts - Get get all the districts of state
  • findByPin - Get planned vaccination sessions on a specific date in a given pin
  • findByDistrict - Get planned vaccination sessions on a specific date in a given district
  • calendarByPin - Get planned vaccination sessions for 7 days from a specific date in a given pin,
  • calendarByDistrict - Get planned vaccination sessions for 7 days from a specific date in a given district

Referred to Cowin API Docs for more details.

Usage:

  • Import required modules
const {
    getStates,
    getListofDistricts,
    findByPin,
    findByDistrict,
    calendarByPin,
    calendarByDistrict
} = require('cowin')
  • Write asynchronous function
async function fireitup() { /* asynchronous */

    const allstates = await getStates()
    console.log(allstates)

    const alldistricts = await getListofDistricts(36) /* { state_id } */
    console.log(alldistricts)

    const calenderbypin = await calendarByPin(731204, '13-05-2021') /* { pincode, date } */
    console.log(calenderbypin)

    const calenderbydistrict = await calendarByDistrict(713, '13-05-2021') /* district_id, date */
    console.log(calenderbydistrict)

    const findbypin = await findByPin(731204, '13-05-2021') /* { pincode, date } */
    console.log(findbypin)

    const findbydistrict = await findByDistrict(713, '13-05-2021') /* district_id, date */
    console.log(findbydistrict)

}

fireitup()
  • Response will looks like
{
    status: true,
    result: [/* Results */]
}
  • Exception handling
{
    status: false,
    message: "Sorry that's an error"
}

Limitation:

APIs are subject to a rate limit of 100 API calls per 5 minutes per IP

Crafted with care by Tuhin ๐Ÿ’—

cowin's People

Contributors

tuhinpal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

cowin's Issues

403 in production

It works perfectly fine on development server but on deployment it always returns false.

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.