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.
https://api.dharun.devNo key needed for most600 units a minute, 3000 with a free keyThis page as MarkdownStates 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
| Parameter | Description |
|---|---|
statequery, required | The 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
| Parameter | Description |
|---|---|
districtquery, required | The 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.
| Parameter | Description |
|---|---|
subdistrictquery | A sub-district's LGD code: all its villages. |
pincodequery | Six digits: the villages LGD lists under it. |
qquery | The start of a village's name, 3 to 80 characters; at most 100 answers. |
statequery | With 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}
| Parameter | Description |
|---|---|
codepath, required | The 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.