📦 Indian Pincode Library

This website is powered by the indian-pincode library - a high-performance, offline-first solution for Indian PIN code lookups. Instead of relying on external APIs, the library embeds the entire dataset directly into your application with highly optimized indexing.

🚀 Why This is Better Than an API

Most developers rely on external APIs for pincode lookups. This is often slow, unreliable, and subject to rate limits. Our library solves this by:

  • 100% Offline - No network requests, no API keys, no rate limits
  • Lightning Fast - Sub-millisecond lookups with optimized indexing
  • Always Available - No downtime, no dependency on third-party services
  • Cost Effective - No API costs, no usage limits
  • Privacy First - All data stays on your server
📦 Package Size Notice: This library is ~40MB (Node.js) and ~10MB (Python) due to the embedded comprehensive database of 19,000+ pincodes and 154,000+ post offices with geospatial data.

📚 Available Libraries

Choose your language to see installation and usage examples:

Installation

pip install indian-pincode

Usage

import indian_pincode as pincode

# 1. Validate a Pincode
print(pincode.validate("110001")) 
# Output: True

# 2. Get Details (State, District, Office)
details = pincode.lookup("110001")
print(details[0]['office_name']) 
# Output: "Connaught Place SO"
print(details[0]['district'])    
# Output: "NEW DELHI"
print(details[0]['state_name'])  
# Output: "DELHI"

# 3. Geospatial Search (Find nearby post offices)
# Find offices within 5km of Connaught Place (28.63, 77.21)
nearby = pincode.find_nearby(28.63, 77.21, radius_km=5)
print(nearby[0]['pincode']) 
# Output: "110001"
View on PyPI →

Installation

npm install @devzoy/indian-pincode

Usage

const pincode = require('indian-pincode');

// 1. Validate
console.log(pincode.validate("560095")); 
// Output: true

// 2. Lookup
pincode.lookup("560095").then(details => {
    console.log(details[0].office);   
    // Output: "Koramangala VI Bk SO"
    console.log(details[0].district); 
    // Output: "BANGALORE"
});

// 3. Find Nearby
pincode.findNearby(12.93, 77.62).then(res => {
    console.log(res[0].pincode); 
    // Output: "560095"
});
View on NPM →

📊 Data Source

All data is sourced from official India Post records and is regularly updated to ensure accuracy. The dataset includes:

  • 19,000+ PIN codes
  • 154,000+ post offices
  • Geospatial coordinates (latitude/longitude)
  • District, state, and division information
  • Office type and delivery status

🛠 Contributing

We welcome contributions! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on GitHub.

View on GitHub