New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

indian-postalcode-details

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

indian-postalcode-details

A simple Node.js utility to get **city** and **state** from an Indian **PIN code**, powered by the India Post API.

latest
npmnpm
Version
1.0.4
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

🇮🇳 indian-postalcode-details

A simple Node.js utility to get city and state from an Indian PIN code, powered by the India Post API.

✨ Features

  • Get city & state using just a PIN code
  • Fast and lightweight
  • Uses official India Post API
  • Easy to integrate

Installation

npm install indian-postalcode-details

##

const { getCityStateFromPincode } = require('indian-postalcode-details');

(async () => {
  const result = await getCityStateFromPincode('560001');
  console.log(result);
})();

---

## Output:

{
  "city": "Bengaluru",
  "state": "Karnataka"
}


---

## API

getCityStateFromPincode(pincode)

| Parameter | Type     | Description             |
| --------- | -------- | ----------------------- |
| `pincode` | `string` | 6-digit Indian PIN code |


---

## Returns a Promise that resolves to:

{ city: 'City Name', state: 'State Name' }

---
## Error Handling

If the PIN code is invalid or the API fails:

throw new Error('Invalid PIN code' or 'Failed to fetch data');

---
## 🔗 Powered By
 India Post API

---

## 📝 License
MIT © 2025 Abhinav Anand

Keywords

pincode

FAQs

Package last updated on 27 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts