Endpoints
Pincode API
Resolve an Indian PIN code to its state, district, city, post offices and localities.
GET /api/v1/pincode/{pincode}Request
curl "https://address.s2coder.com/api/v1/pincode/226010" \
-H "X-API-Key: YOUR_API_KEY"Response
{
"success": true,
"pincode": "226010",
"state": "Uttar Pradesh",
"district": "Lucknow",
"city": "Lucknow",
"division": "Lucknow",
"region": "Lucknow",
"circle": "Uttar Pradesh",
"latitude": 26.8467,
"longitude": 80.9462,
"localities": ["Gomti Nagar", "Vibhuti Khand", "Vishesh Khand"],
"offices": [
{
"name": "Gomti Nagar",
"type": "Sub Post Office",
"delivery_status": "Delivery",
"locality": "Gomti Nagar",
"latitude": 26.8467,
"longitude": 80.9462
}
]
}Fields
| Field | Description |
|---|---|
| state | Canonical state or union territory name. |
| district | Revenue district. |
| city | City or town. Falls back to the district when the two share a name. |
| division / region / circle | India Post administrative hierarchy. |
| localities | Every distinct locality name recorded under this PIN, sorted alphabetically. |
| offices | One entry per post office. A single PIN often covers several. |
| latitude / longitude | Centroid, taken from the first office with coordinates. May be null. |
Errors
| Status | When |
|---|---|
| 422 | The value is not a valid Indian PIN code — six digits starting with 1–8. |
| 404 | Valid format, but not present in the reference database. |
Caching
PIN code reference data changes rarely, so responses are cached server-side for 600 seconds. Caching them on your side too is safe and recommended — the payload for a given PIN is stable for months at a time.