India API

Docs › Places and transport

Pincodes API

Pincode to post office, district and state.

Every post office in the Department of Posts directory, with its district, state, postal division and coordinates.

Base URL https://api.dharun.devNo API key600 requests a minuteThis page as Markdown

Post offices for a pincode

GET/v1/pincode/{pincode}

Returns the district and state of the pincode and every post office that uses it.

ParameterDescription
pincodepath, requiredSix-digit pincode.

curl

curl "https://api.dharun.dev/v1/pincode/637001"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/pincode/637001");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/pincode/637001", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Response, with lists and long text shortened

{
  "data": {
    "pincode": "637001",
    "district": "Namakkal",
    "stateCode": "TN",
    "state": "Tamil Nadu",
    "offices": [
      {
        "name": "Namakkal H.O",
        "type": "Head Office",
        "delivery": true,
        "division": "Namakkal",
        "region": "Western Region, Coimbatore",
        "circle": "Tamilnadu",
        "district": "Namakkal",
        "stateCode": "TN",
        "state": "Tamil Nadu",
        "latitude": 11.2155833,
        "longitude": 78.1702778
      },
      {
        "name": "Namakkal Bazaar S.O",
        "type": "Post Office",
        "delivery": false,
        "division": "Namakkal",
        "region": "Western Region, Coimbatore",
        "circle": "Tamilnadu",
        "district": "Namakkal",
        "stateCode": "TN",
        "state": "Tamil Nadu",
        "latitude": 11.2240556,
        "longitude": 78.1703333
      },
      {
        "name": "Namakkal Fort S.O",
        "type": "Post Office",
        "delivery": false,
        "division": "Namakkal",
        "region": "Western Region, Coimbatore",
        "circle": "Tamilnadu",
        "district": "Namakkal",
        "stateCode": "TN",
        "state": "Tamil Nadu",
        "latitude": 11.238,
        "longitude": 78.166
      }
    ]
  },
  "meta": {
    "source": {
      "name": "All India Pincode Directory",
      "url": "https://www.data.gov.in/resource/all-india-pincode-directory-till-last-month",
      "licence": "Government Open Data License - India (GODL)",
      "version": "23760720 bytes",
      "retrieved": "2026-10-13",
      "attribution": "Contains data from the All India Pincode Directory, Department of Posts, published on data.gov.in under the Government Open Data License - India."
    }
  }
}

Search post offices

GET/v1/pincode

Find post offices by the start of their name, by the start of a pincode, or list a district.

ParameterDescription
qqueryStart of a post office name (2+ characters) or start of a pincode.
statequeryState code or name, for example TN or Tamil Nadu.
districtqueryExact district name.
limitqueryResults per page, 1 to 100.
offsetqueryResults to skip.

curl

curl "https://api.dharun.dev/v1/pincode?q=namakkal&state=TN"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/pincode?q=namakkal&state=TN");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/pincode?q=namakkal&state=TN", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Response, with lists and long text shortened

{
  "data": [
    {
      "pincode": "637001",
      "name": "Namakkal Bazaar S.O",
      "type": "Post Office",
      "delivery": false,
      "division": "Namakkal",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.2240556,
      "longitude": 78.1703333
    },
    {
      "pincode": "637003",
      "name": "Namakkal District Court Buildings S.O",
      "type": "Post Office",
      "delivery": false,
      "division": "Namakkal",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.2497338,
      "longitude": 78.1265014
    },
    {
      "pincode": "637001",
      "name": "Namakkal Fort S.O",
      "type": "Post Office",
      "delivery": false,
      "division": "Namakkal",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.238,
      "longitude": 78.166
    }
  ],
  "meta": {
    "total": 4,
    "limit": 20,
    "offset": 0,
    "source": {
      "name": "All India Pincode Directory",
      "url": "https://www.data.gov.in/resource/all-india-pincode-directory-till-last-month",
      "licence": "Government Open Data License - India (GODL)",
      "version": "23760720 bytes",
      "retrieved": "2026-10-13",
      "attribution": "Contains data from the All India Pincode Directory, Department of Posts, published on data.gov.in under the Government Open Data License - India."
    }
  }
}

Post offices near a point

GET/v1/pincode/near

Post offices within a radius of a latitude and longitude, nearest first, with the distance. Positions come from the Department of Posts and some are approximate.

ParameterDescription
latquery, requiredLatitude in decimal degrees.
lngquery, requiredLongitude in decimal degrees.
radiusqueryKilometres, 1 to 50. Default 5.
limitqueryResults, 1 to 100. Default 10.

curl

curl "https://api.dharun.dev/v1/pincode/near?lat=11.2189&lng=78.1674&radius=5"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/pincode/near?lat=11.2189&lng=78.1674&radius=5");
const body = await response.json();
if (!response.ok) throw new Error(body.error.message);
console.log(body.data);

Python

import requests

response = requests.get("https://api.dharun.dev/v1/pincode/near?lat=11.2189&lng=78.1674&radius=5", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])

Response, with lists and long text shortened

{
  "data": [
    {
      "pincode": "636142",
      "name": "Mullukurichi S.O",
      "type": "Post Office",
      "delivery": true,
      "division": "Salem East",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.2155833,
      "longitude": 78.1702778,
      "distanceKm": 0.48
    },
    {
      "pincode": "637001",
      "name": "Namakkal H.O",
      "type": "Head Office",
      "delivery": true,
      "division": "Namakkal",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.2155833,
      "longitude": 78.1702778,
      "distanceKm": 0.48
    },
    {
      "pincode": "637411",
      "name": "Semmedu S.O",
      "type": "Post Office",
      "delivery": true,
      "division": "Namakkal",
      "region": "Western Region, Coimbatore",
      "circle": "Tamilnadu",
      "district": "Namakkal",
      "stateCode": "TN",
      "state": "Tamil Nadu",
      "latitude": 11.2155833,
      "longitude": 78.1702778,
      "distanceKm": 0.48
    }
  ],
  "meta": {
    "total": 20,
    "limit": 10,
    "offset": 0,
    "source": {
      "name": "All India Pincode Directory",
      "url": "https://www.data.gov.in/resource/all-india-pincode-directory-till-last-month",
      "licence": "Government Open Data License - India (GODL)",
      "version": "23760720 bytes",
      "retrieved": "2026-10-13",
      "attribution": "Contains data from the All India Pincode Directory, Department of Posts, published on data.gov.in under the Government Open Data License - India."
    },
    "note": "Positions come from the Department of Posts directory, where about one office in ten has none and some are approximate. The nearest office is not always the one…"
  }
}

Data source

All India Pincode Directory, 23760720 bytes. Retrieved 2026-10-13. Licence: Government Open Data License - India (GODL). Contains data from the All India Pincode Directory, Department of Posts, published on data.gov.in under the Government Open Data License - India.

Guides

Fill city and state from a pincode in a web form

Using an AI assistant? Connect the MCP server and it can call this API by itself.