Docs / Places and transport

Villages and LGD codes API

Every state, district, sub-district and village of India with its LGD and Census 2011 codes, and village PIN codes.

The Local Government Directory (LGD) of the Ministry of Panchayati Raj gives every administrative unit a code that government systems use. Walk down from states to districts, sub-districts and villages, find a village by name or by PIN code, or look one up by its code. From data.gov.in, refreshed monthly; names in English and the local script.

Base URL https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as Markdown

States with their LGD codes

GET/v1/lgd/states

curl

curl "https://api.dharun.dev/v1/lgd/states?utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/lgd/states?utm_medium=docs");
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/lgd/states?utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Districts of a state

GET/v1/lgd/districts

ParameterDescription
statequery, requiredThe state's LGD code, such as 33 for Tamil Nadu.

curl

curl "https://api.dharun.dev/v1/lgd/districts?state=33&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/lgd/districts?state=33&utm_medium=docs");
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/lgd/districts?state=33&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Sub-districts (taluks, tehsils, mandals) of a district

GET/v1/lgd/subdistricts

ParameterDescription
districtquery, requiredThe district's LGD code.

curl

curl "https://api.dharun.dev/v1/lgd/subdistricts?district=580&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/lgd/subdistricts?district=580&utm_medium=docs");
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/lgd/subdistricts?district=580&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Villages by sub-district, PIN code or name

GET/v1/lgd/villages

One of subdistrict, pincode or q. Each village with its sub-district, district and state.

ParameterDescription
subdistrictqueryA sub-district's LGD code: all its villages.
pincodequerySix digits: the villages LGD lists under it.
qqueryThe start of a village's name, 3 to 80 characters; at most 100 answers.
statequeryWith q: only this state (LGD code).

curl

curl "https://api.dharun.dev/v1/lgd/villages?pincode=637001&utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/lgd/villages?pincode=637001&utm_medium=docs");
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/lgd/villages?pincode=637001&utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

A village by its LGD code

GET/v1/lgd/villages/{code}

ParameterDescription
codepath, requiredThe village's LGD code.

curl

curl "https://api.dharun.dev/v1/lgd/villages/634584?utm_medium=docs"

JavaScript

const response = await fetch("https://api.dharun.dev/v1/lgd/villages/634584?utm_medium=docs");
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/lgd/villages/634584?utm_medium=docs", timeout=10)
body = response.json()
if not response.ok:
    raise RuntimeError(body["error"]["message"])
print(body["data"])
Try it here

Change the values and send the request from your browser. Needs JavaScript.

Data source

Local Government Directory (LGD): districts, sub-districts, villages and their PIN codes, dba95b599bef. Retrieved 2026-11-11T17:17:28Z. Licence: Government Open Data License - India. Local Government Directory codes from the Ministry of Panchayati Raj, published on data.gov.in under the Government Open Data License - India.

Using an AI assistant? Connect the MCP server and it can call this API by itself. Want every endpoint on one bench? Open the playground.