Gov APIgeoportal.mp.gov.in ↗
Access district, tehsil, and village boundaries, road networks, and forest data for Madhya Pradesh via 8 structured GeoJSON endpoints.
What is the Gov API?
This API exposes 8 endpoints covering geospatial data for Madhya Pradesh sourced from the NIC GIS server at geoportal.mp.gov.in. Use get_district_boundaries to retrieve polygon geometries for all 55 districts as GeoJSON FeatureCollections, or drill down to tehsil and village level with dedicated endpoints. Road network polylines, forest layer data, and the full administrative layer catalog are also available as structured JSON responses.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/8dea8cbf-95f7-4067-8148-06ef8f2ee39f/get_service_catalog' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace geoportal-mp-gov-in-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Madhya Pradesh Geoportal SDK — bounded, re-runnable."""
from parse_apis.madhya_pradesh_geoportal_api import (
MadhyaPradeshGeo,
DistrictNotFound,
)
client = MadhyaPradeshGeo()
# List all districts alphabetically (capped at 5).
for district in client.districts.list(limit=5):
print(district.name, district.lgd_code, district.state_code)
# Construct a district by name and get its boundary geometry.
bhopal = client.district(name="Bhopal")
boundary = bhopal.boundaries()
print(boundary.type, len(boundary.features))
# List subdistricts (tehsils) within the district.
for sdt in bhopal.subdistricts.list(limit=3):
print(sdt.id, sdt.properties)
# List village-level boundaries within the district.
village = bhopal.villages.list(limit=1).first()
if village:
print(village.id, village.geometry)
# List administrative GIS layers available.
layer = client.administrativelayers.list(limit=1).first()
if layer:
print(layer.id, layer.name, layer.geometry_type)
# Get road network data.
roads = client.roadnetworks.get()
print(roads.geometry_type, roads.display_field_name)
# Typed error handling for an invalid district name.
try:
bad = client.district(name="NonExistentDistrict")
bad.boundaries()
except DistrictNotFound as exc:
print(f"District not found: {exc.district_name}")
print("exercised: districts.list / district.boundaries / subdistricts.list / villages.list / administrativelayers.list / roadnetworks.get")
Fetches the root service catalog from the NIC GIS server listing all available MapServer services, folders, and the server version. No parameters required. Returns a single catalog object.
No input parameters required.
{
"type": "object",
"fields": {
"folders": "array of folder name strings",
"services": "array of service objects each with name (string) and type (string)",
"currentVersion": "float, the ArcGIS server version"
},
"sample": {
"data": {
"folders": [
"Hosted",
"MyServerFolder",
"nicstreet",
"school",
"Utilities"
],
"services": [
{
"name": "admin2024",
"type": "MapServer"
},
{
"name": "roadnetwork",
"type": "MapServer"
}
],
"currentVersion": 10.91
},
"status": "success"
}
}About the Gov API
Administrative Boundary Data
get_districts returns a flat list of all 55 districts in Madhya Pradesh, each record including dtname, stcode11, dtcode11, dist_lgd, and objectid. Results are sorted alphabetically. For polygon geometries, get_district_boundaries accepts an optional district_name parameter (case-insensitive) to filter to a single district or return all districts as a GeoJSON FeatureCollection in WGS84 (EPSG:4326). Subdistrict (Tehsil) polygons follow the same pattern via get_subdistrict_boundaries, which surfaces sdtname, dtname, and subdt_lgd per feature, capped at 200 features per response.
Village and Road Data
get_village_boundaries requires a district_name parameter and returns up to 100 village polygon features per call, each carrying vilname11, sdtname, dtname, vil_lgd, and block_name — enough to reconstruct the full administrative hierarchy from state down to village. Road network data comes from get_road_network, which returns the first 100 road features as esriGeometryPolyline objects with attributes including road type, name, class code, and length in meters, plus a fields array describing each attribute's name, type, and alias.
Service Catalog and Forest Layers
get_service_catalog queries the root NIC GIS server and returns currentVersion, a folders array, and a services array — useful for discovering what MapServer services are available before targeting specific layers. get_administrative_layers lists every layer in the admin2024 MapServer, including layer id, name, type, geometryType, and parentLayerId. Forest data is available through get_forest_data, which accepts an optional service_path parameter (defaulting to MP_Forest_Data/MapServer/0) and returns fields, features, and displayFieldName arrays.
The Gov API is a managed, monitored endpoint for geoportal.mp.gov.in — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when geoportal.mp.gov.in changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official geoportal.mp.gov.in API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Render district boundary maps of Madhya Pradesh using GeoJSON polygons from
get_district_boundaries. - Build an administrative hierarchy lookup from state to village using
dtname,sdtname, andvilname11fields. - Plot road networks on a map using polyline geometries and road class codes from
get_road_network. - Discover available GIS layers before querying by inspecting the
get_service_catalogandget_administrative_layersresponses. - Filter tehsil boundaries by parent district using the
district_nameparam inget_subdistrict_boundaries. - Cross-reference village LGD codes (
vil_lgd) with national Local Government Directory datasets. - Analyze forest coverage distribution across MP districts using layer data from
get_forest_data.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does geoportal.mp.gov.in have an official developer API?+
What does `get_village_boundaries` return, and is there a pagination option?+
get_village_boundaries returns up to 100 village polygon features per call for a given district, each with vilname11, sdtname, dtname, vil_lgd, and block_name properties. There is no pagination parameter exposed — the 100-feature cap is a fixed limit of the current endpoint. Districts with more than 100 villages will return a partial result set.