node-cowin-api

npm install node-cowin-api

Usage no npm install needed!

<script type="module">
  import nodeCowinApi from 'https://cdn.skypack.dev/node-cowin-api';
</script>

README

🔗 Installation

npm install node-cowin-api

Available methods:

  • getStates - Get all states in India
  • getDistricts - Get get all the districts of state based on stateId
  • getByAppointmentListByPin - Get planned vaccination sessions on a specific date in a given pin

⚡️ Usage:

I have added all the Co-WIN public API methods except Authentication. Will be adding them ASAP, Maybe you can contribute too.

const { 
  getStates, 
  getDistricts, 
  getByAppointmentListByPin 
  } = require('node-cowin-api')
  • Write asynchronous function
async function getData() {
    const allStates = await getStates()
    console.log(allStates)
    const districts = await getDistricts(11)
    console.log(districts)
    const appointments = await getByAppointmentListByPin(360001, '30-07-2021')
    console.log(appointments)
}

getData()