https://github.com/roshansuthar1105/pincode-address
Fetch Indian postal location details by PIN code using India Post’s public API — lightweight Node.js module with easy integration and a React demo.
https://github.com/roshansuthar1105/pincode-address
address api india location npm npm-package pincode pincode-address postal
Last synced: 5 months ago
JSON representation
Fetch Indian postal location details by PIN code using India Post’s public API — lightweight Node.js module with easy integration and a React demo.
- Host: GitHub
- URL: https://github.com/roshansuthar1105/pincode-address
- Owner: Roshansuthar1105
- License: mit
- Created: 2025-05-28T06:08:06.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-05-31T15:37:16.000Z (6 months ago)
- Last Synced: 2025-06-30T06:05:31.418Z (5 months ago)
- Topics: address, api, india, location, npm, npm-package, pincode, pincode-address, postal
- Language: JavaScript
- Homepage: https://pincode-address.netlify.app/
- Size: 16.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📦 pincode-address
[](https://www.npmjs.com/package/pincode-address)
[](https://www.npmjs.com/package/pincode-address)
[](LICENSE)
> A lightweight Node.js module to fetch Indian location details using a 6-digit PIN code via India Post’s public API.
---
## 🌐 Overview
`pincode-address` allows developers to retrieve detailed address data — including post office names, branch types, delivery status, district, state, and more — using a valid Indian PIN code.
Useful for:
- Auto-filling forms
- Validating delivery zones
- Enriching location-based features
---
## 🚀 Installation
```bash
npm install pincode-address
```
---
## 🔍 Live Demo
Try it live: [pincode-address.netlify.app](https://pincode-address.netlify.app)
🔹 Features:
- Input validation for 6-digit PIN codes
- Real-time fetch of address data
- User-friendly output format
- Built using React.js
---
## 📚 Usage
```js
const { getPincodeInfo } = require('pincode-address');
(async () => {
const info = await getPincodeInfo('302022');
console.log(info);
})();
```
### ✅ Example Output:
```json
[
{
"Name": "Bilwa",
"BranchType": "Branch Post Office",
"DeliveryStatus": "Delivery",
"District": "Jaipur",
"State": "Rajasthan",
"Country": "India",
"Pincode": "302022"
},
...
]
```
---
## 🧪 Input Validation
```js
await getPincodeInfo("123");
// ❌ Error: Invalid PIN code. It must be 6 digits.
```
---
## 📦 API Reference
### `getPincodeInfo(pincode: string): Promise`
| Parameter | Type | Description |
|-----------|----------|----------------------------------|
| `pincode` | `string` | A valid 6-digit Indian PIN code |
Returns:
- `Array` of post office objects, or
- `null` if no results are found
---
## 📄 License
Licensed under the [MIT License](LICENSE)
---
## 👤 Author
**Roshan Suthar**
📦 GitHub: [@Roshansuthar1105](https://github.com/Roshansuthar1105)
---
## 🛠️ Contributing
Contributions are welcome!
Feel free to fork the repo, create a branch, and submit a pull request.
> For major changes, please [open an issue](https://github.com/Roshansuthar1105/pincode-address/issues) first to discuss your ideas.
---
## 🐛 Reporting Issues
Found a bug or issue?
Please report it here → [GitHub Issues](https://github.com/Roshansuthar1105/pincode-address/issues)
---
## 💡 Like this package?
Give it a ⭐ on [GitHub](https://github.com/Roshansuthar1105/pincode-address) and share it with your network!