Build on India’s geography
Turn any point into its state, district, sub-district, block, constituency and city ward, with the government’s LGD codes to join your data on. Query 182 open layers, or download them whole.
# Where is MG Road, Bengaluru? (the JSON answer, trimmed to names and codes)
curl "https://bharatlas.com/api/v1/locate?lat=12.9716&lng=77.5946"
state KARNATAKA State_LGD 29
district Bengaluru Urban dist_lgd 525 (Census 2011: 572)
sub-district Bengaluru North subdt_lgd 5542
block Bengaluru North block_lgd 5761
parliament Bangalore Central pc_id 2925
assembly Shivajinagar AC_ID 29162
ward Shantala Nagar LGD_WardCode 1302853
seismic zone Zone II
Ways to connect
The same data through several doors. Pick the one that fits your work.
REST API
JSON over HTTPS for apps, sites and scripts.
https://bharatlas.com/api/v1
MCP server
For Claude, ChatGPT, Gemini and other AI assistants: read layers and run collect maps. Set it up.
npx bharatlas-mcp@latest
Downloads
Whole layers as Parquet, PMTiles, GeoJSON, KML or Shapefile, linked from /layers/:id. 43,656 downloads so far.
collect API
The write side: make a map form, gather points, publish them to bharatlas. How it works.
Command line coming
The MCP package in a terminal: pipe in a CSV of points, get codes back.
Releases
Dated copies that never change, each with a code, a SHA-256 pin and a permanent address, so you can cite exactly what you used. Browse releases.
https://w3id.org/bharatlas
Quick start
Find the district for a point, then list the blocks in it.
curl
# 1. Which district is this point in?
curl "https://bharatlas.com/api/v1/locate?lat=12.9716&lng=77.5946&layers=lgd_districts" \
-H "User-Agent: my-app/1.0"
# 2. Every block in that district (dist_lgd 525)
curl "https://bharatlas.com/api/v1/layers/lgd_blocks/query?where=dist_lgd=525&select=block_name,block_lgd"
JavaScript
const base = "https://bharatlas.com/api/v1";
const here = await fetch(`${base}/locate?lat=12.9716&lng=77.5946&layers=lgd_districts`).then((r) => r.json());
const { dist_lgd } = here.results.boundaries[0].feature.properties; // 525
const blocks = await fetch(`${base}/layers/lgd_blocks/query?where=dist_lgd=${dist_lgd}`).then((r) => r.json());
Python, a whole layer locally
import duckdb, requests
layer = requests.get("https://bharatlas.com/api/v1/layers/lgd_blocks").json()["data"]
url = layer["downloads"]["parquet"]["url"] # all of India in one file
duckdb.sql(f"SELECT block_name, block_lgd FROM '{url}' WHERE dist_lgd = 525").show()
An AI assistant
# Claude Code, hosted server (read-only, no install)
claude mcp add --transport http bharatlas https://bharatlas.com/mcp
# then ask: "Which district and ward is 12.9716, 77.5946 in, and which blocks share that district?"
Codes to join on
Names change and are spelled many ways; codes don’t. Join your data to ours on the Local Government Directory (LGD) codes. The LGD layers also carry the Census 2011 codes, so older data joins too.
| Level | Layer | LGD code column | Example |
|---|---|---|---|
| State | lgd_states | State_LGD | 29, Karnataka |
| District | lgd_districts | dist_lgd | 525, Bengaluru Urban (Census 2011 dtcode11: 572) |
| Sub-district | lgd_subdistricts | subdt_lgd | 5542, Bengaluru North |
| Block | lgd_blocks | block_lgd | 5761, Bengaluru North |
| Village | lgd_villages | vil_lgd | 612833, Suradenpura |
| City ward | wards_bengaluru_bbmp_2022 | LGD_WardCode | 1302853, Shantala Nagar |
Constituencies carry the Election Commission’s ids: pc_id in lgd_parliament (2925, Bangalore Central) and AC_ID in lgd_assembly (29162, Shivajinagar).
We pass codes through exactly as the source publishes them and never renumber them.
Crosswalks: the Census 2011 to LGD crosswalk links each Census 2011 code to the current LGD codes at every level (state, district, sub-district, block, village) and says how it changed (1:1, split, merge), so data from before a unit was split still joins. It is a dated release, as CSV and Parquet.
Endpoints
All read-only, no key. Each is in the full reference below and in /api/v1/openapi.json for code generators, API tools and AI assistants.
GET /locate | Every boundary and zone at a point, including the city ward where we have one |
GET /nearby | Features from one layer within a radius, nearest first |
GET /ground | What is below a point: seismic zone, faults, rock, aquifer, groundwater, soil, subsidence, tunnels, in one call |
GET /surface | What is on the ground at a point: place, land, water, hazards, protected areas, access, services, in one call |
GET /layers | Every layer: search by theme, level, source |
GET /layers/:id | One layer: licence, attribution, download links |
GET /layers/:id/schema | Column names, types and values; read this before querying |
GET /layers/:id/query | Filter, select, group and total rows |
GET /layers/:id/export | The rows matching a filter, with their shapes, as GeoJSON, KML or CSV |
GET /layers/:id/locate | The feature of one layer at, or nearest to, a point |
GET /submissions | Community layers, queried the same way |
GET /releases | Dated releases, newest first, with each one’s SHA-256 pin and files |
Limits and promises
| What | Limit |
|---|---|
| Read endpoints | 120 requests a minute per IP |
/locate and /layers/:id/locate, /ground and /surface | 60 requests a minute per IP |
| Submissions (write) | 5 an hour, 20 a day per IP |
Over a limit you get 429 with a retry-after header. Cloudflare DDoS protection applies to all endpoints. Need a million points? Download the layer and join locally, or get in touch.
Is it up?
The website, the API and collect are checked every 5 minutes from outside. status.bharatlas.com shows each one now, its uptime over 90 days and past outages, also as JSON.
Name your app
Please send a User-Agent that names your app (for example my-app/1.0). We read it only to tell apps, AI tools and crawlers apart, so our counts of how each mode is used stay honest. We don't store it, and we don't track who you are. For each call we also keep how long it took, which Cloudflare data centre answered and, for the bharatlas MCP, its version number: never your IP or the point you asked about.
What stays the same
/api/v1 only grows: new fields may appear, but existing fields are never renamed or removed. A breaking change ships as /v2, announced here, and /v1 keeps working for at least 6 months after that. Every response carries an x-api-version: v1 header.
Licences and credit
We don’t relicense anything. Each layer keeps the licence its source published it under, and /layers/:id says which, with who to credit. Credit the source when you use a layer; a link to bharatlas is welcome too.
- 100CC0-1.0
- 16GODL-India
- 14CC-BY-4.0
- 14ODbL-1.0
- 13NRSC terms
- 8CC0-1.0 / CC-BY-4.0
- 7CC-BY-SA-2.5-IN
- 3MIT
- 2CC-BY-SA-4.0
- 1CC-BY-2.5-IN
- 1CDLA-Permissive-2.0 / Apache-2.0
- 1India-WRIS terms
- 1Unlicense
// GET /api/v1/layers/lgd_blocks
"licence": "CC0-1.0",
"attribution": {
"primary": { "name": "Local Government Directory", "url": "https://lgdirectory.gov.in/" },
"publisher": { "name": "yashveeeeeeer/india-geodata", "url": "https://github.com/yashveeeeeeer/india-geodata" }
}
Sponsor a layer
Need a layer that isn’t here: ward boundaries for your city, a scheme’s sites, a hazard map? Fund it, and we clean it, give it codes, keep it current and publish it openly for everyone, with your credit on the layer.
Built with bharatlas
mugilu
What the sky is doing over any place in India; names places with bharatlas boundaries.
yellide
India’s species, by district, keyed by bharatlas’ LGD codes.
Yours?
Built something on bharatlas? Tell us and we’ll add it here.
API reference
Every endpoint and parameter. Base URL: https://bharatlas.com/api/v1. The same in machine-readable form: /api/v1/openapi.json.
Layers
GET /api/v1/layers
List all curated layers with pagination and filters.
| Param | Type | Description |
|---|---|---|
category | string | Filter by category (e.g. boundaries, city-wards, environment) |
level | string | Filter by admin level (e.g. state, district) |
source | string | Filter by data source (e.g. LGD, OpenCity) |
realm | string | below (rocks, faults, minerals, aquifers, groundwater), ground (boundaries, wards, rivers, forests, roads, places) or air (cyclone tracks), as the layers page groups them; another value is a 400 naming these |
q | string | Text search (case-insensitive substring) across id, source, notes, category, level and tags |
limit | int | Results per page (default 100, max 500) |
offset | int | Skip N results (default 0) |
Each layer says its realm. A layer the point lookups read also says lookups: the section of /ground and of /surface that reads it, e.g. {"ground": "seismic", "surface": "hazards"} for seismic_zones.
curl https://bharatlas.com/api/v1/layers?category=city-wards&limit=5
curl https://bharatlas.com/api/v1/layers?realm=below
GET /api/v1/layers/:id
Single layer detail with download URLs, licence and attribution. A layer with a parquet file says where its schema is in schema_url (as do the layers in the list above).
curl https://bharatlas.com/api/v1/layers/lgd_states
GET /api/v1/layers/:id/schema
Column names, types, and values. Use this to discover what columns a layer has, and how its values are spelled, before querying. A column with at most 20 values lists them all in distinct_values. For curated layers the answer comes from stats baked over the whole file, so it also gives distinct_count (distinct values in the whole layer) and, for a column with 21 to 50 values, top_values with their row counts (left out when every value appears once, as in an id column); community layers are read from their parquet file at the time of the call. Nested columns (structs, lists, maps, such as Overture's names or addresses) are listed with type nested: you can select them, but not filter or group on them.
curl https://bharatlas.com/api/v1/layers/airports/schema
GET /api/v1/layers/:id/query
Query layer data with filters and grouping. Reads the parquet from R2 at runtime, no pre-computation needed. Works for curated and community layers. An unknown column in select, where, filter, group_by or sum is a 400 that lists the layer’s columns and names its schema, before any row is read. So is a where pair without =. A filter that matches nothing returns hints with the column’s values and a hint naming the layer’s schema. Answers are kept in the edge cache for up to an hour.
| Param | Type | Description |
|---|---|---|
select | string | Comma-separated column names to return |
where | string | Exact, case-insensitive match on flat columns: col1=val1,col2=val2. Or pass columns directly as params: ?state=KA&type=INTERNATIONAL (use this form when a value contains a comma). A nested column returns 400 with the list of flat columns. |
group_by | string | Group by column, returns value counts |
sum | string | With group_by: comma-separated numeric columns to total per group, returned as sums. Percentages are not additive, so sum the amounts and recompute shares. |
limit | int | Max rows (default 100, max 1000) |
include_centroid | bool | Adds _lat/_lng (bounding-box centre) to each row where the layer has bounding-box columns. Default true; pass false to leave them out. |
filter | JSON | Filters as a JSON list, for more than exact matches: [{"col":"sname","kind":"in","values":["KA","TN"]}]. Kinds: in (any of the values, case-insensitive), range (numeric min and/or max), search (case-insensitive substring q), bool (v). Combined with where: all must match. |
order_by | string | Reserved, not applied yet: rows come in file order. Accepted so it is never read as a column filter. |
format, estimate | string | Not used by /query (they belong to /layers/:id/export). Accepted so they are never read as column filters. |
# Airports in Bengaluru Urban district (the layer's own spelling; a miss returns hints with the values)
curl "https://bharatlas.com/api/v1/layers/airports/query?where=district=Bengaluru%20Urban&select=name,type"
# Forests by type, across India
curl "https://bharatlas.com/api/v1/layers/soi_forests/query?group_by=type"
# National parks vs wildlife sanctuaries
curl "https://bharatlas.com/api/v1/layers/gs_wildlife/query?group_by=category"
# Installed power capacity (MW) by plant type
curl "https://bharatlas.com/api/v1/layers/vedas_power_plants/query?group_by=layer&sum=inst_cap"
# Which blocks are in Bengaluru Urban (district LGD code 525)?
curl "https://bharatlas.com/api/v1/layers/lgd_blocks/query?where=dist_lgd=525&select=block_name,block_lgd"
# Hospitals in Karnataka or Kerala, counted per state (a filter for more than exact matches)
curl -G "https://bharatlas.com/api/v1/layers/nhp_hospitals/query" \
--data-urlencode 'filter=[{"col":"State","kind":"in","values":["Karnataka","Kerala"]}]' \
--data-urlencode 'group_by=State'
Columns with geometry data (geom, wkb_geometry) are excluded from results. Rows are read row group by row group, so memory stays small on any layer; time grows with layer size. Most layers answer in about a second; on the largest (Overture places, 4.8M rows) a filter or group_by over the whole table takes several seconds, so filter on low-cardinality columns where you can.
GET /api/v1/layers/:id/export
Every row matching a filter, with all its columns and its shape, as a file. Takes where and filter in the same forms as /query; a filter is required, since the whole layer is a download. At most 50,000 rows and an estimated 100 MB: above either the answer is 400 with the match count and the estimate, so narrow the filter or use the layer’s downloads. GeoJSON and KML also refuse matches spread over more than 1 GB of the layer’s shapes; CSV has no such limit and carries the bounding-box centre as _lat, _lng instead of the shape. An export that fails after it starts ends the connection without completing, so you see a failed download, never a short file.
| Param | Type | Description |
|---|---|---|
format | string | geojson (default), kml or csv |
estimate | string | 1: only the match count and each format’s estimated size, as JSON, without exporting |
where | string | Exact, case-insensitive matches: col1=val1,col2=val2 |
filter | JSON | As in /query: in, range, search and bool filters |
# How big would it be?
curl "https://bharatlas.com/api/v1/layers/lgd_villages/export?where=dist_lgd=525&estimate=1"
# Bengaluru Urban's villages as GeoJSON
curl -o villages.geojson "https://bharatlas.com/api/v1/layers/lgd_villages/export?where=dist_lgd=525&format=geojson"
Spatial
GET /api/v1/locate
Given a lat/lng, returns all polygon layers that contain that point: state, district, ward, pincode, forest, eco-zone, seismic zone, and more, each with its codes. The "where am I?" endpoint.
| Param | Type | Description |
|---|---|---|
lat | float * | Latitude (6 to 38, India bounding box) |
lng | float * | Longitude (68 to 98, India bounding box) |
layers | string | Comma-separated layer IDs to test, at most 25 (default: 13 admin and zone layers, plus the city ward layer covering the point). A retired id is tested as its successor; an id that is not a layer comes back in unknown_layers, and when none is a layer the answer is 400. |
zoom | int | Tile resolution 4-16 (default 14, auto-capped to layer max zoom). At 12 and above, the admin, ward and zone layers asked most are read from one merged index drawn from their full shapes |
curl "https://bharatlas.com/api/v1/locate?lat=12.97&lng=77.59"
Response groups results by category:
{
"point": { "lat": 12.97, "lng": 77.59 },
"results": {
"boundaries": [{
"layer_id": "lgd_states",
"level": "state",
"feature": {
"properties": { "STNAME": "KARNATAKA", "State_LGD": 29 }
}
}, {
"layer_id": "lgd_districts",
"level": "district",
"feature": {
"properties": { "dtname": "Bengaluru Urban", "dist_lgd": 525, "dtcode11": "572" }
}
}]
},
"queried_layers": ["lgd_states", "lgd_districts", ...],
"timing_ms": 450
}
GET /api/v1/layers/:id/locate
The feature of one layer that contains a point, or the nearest one: “which ward is this?”, or “the nearest airport”. Never cached.
| Param | Type | Description |
|---|---|---|
lat | float * | Latitude (6 to 38) |
lng | float * | Longitude (68 to 98) |
mode | string | auto (default: contains, then nearest), contains (point-in-polygon) or nearest (the closest feature, with distance_km and a compass bearing) |
zoom | int | Tile zoom for contains, 4 to 16 (default 14) |
radius_km | float | Search radius for nearest, 1 to 200 (default 25) |
When nothing contains the point and nothing is within the radius, feature is null with out_of_coverage: true.
# Which Bengaluru ward is this point in?
curl "https://bharatlas.com/api/v1/layers/wards_bengaluru_gba/locate?lat=12.9716&lng=77.5946"
# The nearest airport to a point
curl "https://bharatlas.com/api/v1/layers/airports/locate?lat=12.97&lng=77.59&mode=nearest&radius_km=100"
GET /api/v1/nearby
Find features from any layer near a point, nearest first. Works for points, polygons, and lines: points are measured to the point, lines and polygons to the nearest part of their shape (0 inside a polygon), with _lat, _lng that nearest point. _distance_to says which (point or shape, or centroid for the few layers without bounding-box columns, measured to each feature's centre); _approximate: true means a large radius on a dense layer was read from coarser map tiles, so distances are good to tens of metres and the count may be short.
Changed: lines and polygons used to be measured to their bounding-box centre, which put a river that passes 1.5 km away tens of km off, or outside the radius. Answers for line and polygon layers changed; point layers did not.
| Param | Type | Description |
|---|---|---|
lat | float * | Center latitude (6-38) |
lng | float * | Center longitude (68-98) |
layer | string * | Layer ID to search |
radius_km | float | Search radius in km (default 25, max 200) |
limit | int | Max results (default 20, max 100) |
# Reservoirs within 50km of Bengaluru
curl "https://bharatlas.com/api/v1/nearby?lat=12.97&lng=77.59&layer=wris_reservoirs&radius_km=50"
# Wildlife sanctuaries within 100km of Mysuru
curl "https://bharatlas.com/api/v1/nearby?lat=12.30&lng=76.65&layer=gs_wildlife&radius_km=100"
GET /api/v1/ground
What is below a point, in one call instead of a dozen locate and nearby calls. The answer has a one-line summary and sections:
- seismic: seismic zone (the BIS 2016 zonation), active faults within 50 km, GSI lineaments within 25 km and NRSC lineaments within 10 km (non-commercial), each by true distance to the line, recorded earthquakes within 50 km (the record ends in 2019)
- geology: rock type (GSI 1:50,000 lithology, and the 1:2 million map as a coarse fallback), landform (NRSC geomorphology, non-commercial), GSI exploration boreholes within 25 km
- resources: coal and hydrocarbon blocks (0 km when inside), critical minerals, mineral deposits, hot springs and oil or gas wells nearby
- groundwater: aquifer and stage of groundwater extraction (CGWB), groundwater prospects (NRSC, non-commercial), wells counted by the 2017-18 Minor Irrigation Census, the nearest groundwater quality samples (non-commercial), a permeability class (pervious, semi-pervious or impervious) from GLHYMPS 2.0, a global and coarse map, Atal Bhujal wells within 10 km with their latest pre- and post-monsoon water levels, and India-WRIS monitoring stations within 10 km (last depth, pre- and post-monsoon depth and year, 2015-2024 trend;
links.readingsis the full readings download) - soil: clay, sand, silt, pH, organic carbon, bulk density, CEC and nitrogen at 0-5, 5-15 and 15-30 cm, and the WRB soil group, from ISRIC SoilGrids 2.0 (250 m, Poggio et al. 2021, CC BY 4.0); the nearest Soil Health Card sample within 5 km
- subsidence: in the megacities it covers, the median vertical land motion (cm/yr, negative is sinking) of satellite points within 500 m
- underground: tunnels and buried pipelines or cables within 1 km, mine shafts, adits and caves within 5 km (OpenStreetMap)
- watershed: in rural areas, the CoRE Stack micro-watershed water balance and drought record; whether NDEM mapped the point as flooded between 1998 and 2022 (non-commercial)
Each entry names its layer_id and carries its credit (source and licence); a non-commercial layer says so with non_commercial and licence_notice. Units are in field names (clay_pct, distance_km) or in units. contains entries list the features holding the point; nearest entries give the count within radius_km and the nearest few. Each entry's status is found, none_within_radius (the layer covers the area, nothing is that close; radius_km: 0 on an all-India map, such as the NDEM flood extents, means the point is in none of its areas) or not_covered (the layer does not reach the point: subsidence is mapped for some cities only, Atal Bhujal wells for seven states, CoRE Stack for some rural tehsils). SoilGrids leaves out water and built-up land: there depths is null with a reason. Layers are read six at a time; a layer that could not be read in time (2.5 seconds from its turn, 4 seconds for the whole answer) is listed in unavailable and the rest still answer; that answer is not cached, so asking again usually completes it. Shares the locate limit (60 a minute).
| Param | Type | Description |
|---|---|---|
lat | float * | Latitude (6-38) |
lng | float * | Longitude (68-98) |
open_only | bool | true leaves out the non-commercial layers (listed in omitted_non_commercial) |
sections | string | Comma-separated sections to read (default all): seismic, geology, resources, groundwater, soil, subsidence, underground, watershed. An unknown one is a 400 naming the valid ones |
layers | string | Comma-separated layers to read, as well as any sections asked: any layer id the lookup reads (its lookups in /api/v1/layers) or soilgrids, the SoilGrids raster (section soil). A layer it does not read is a 400 naming the valid ones |
Ask for less when the question is narrow. With sections or layers only those are read: the same answer for them, sooner, with filter saying what was asked. ?sections=seismic answers "which seismic zone is this?"; ?sections=soil or ?layers=soilgrids the soil. Leave both out for a broad question. One section answers in about 0.1 to 0.25 seconds; soil, geology and groundwater read the most. All eight take about 0.3 to 0.5 seconds.
Every entry says its about: scale or resolution, the period its data describe (or "not dated by the source", where the source gives none) and the date we fetched it. This is screening information, not a site investigation: the answer's disclaimer says so. The answer is for the point snapped to about 100 m.
# What is under this plot in south-west Delhi?
curl "https://bharatlas.com/api/v1/ground?lat=28.525&lng=77.085"
# Only its seismic zone and soil
curl "https://bharatlas.com/api/v1/ground?lat=28.525&lng=77.085§ions=seismic,soil"
GET /api/v1/surface
What is on the ground at a point, in one call. Same conventions as /ground (credit, licence, about, status, open_only, summary, disclaimer); its sections:
- place: state, district, sub-district, block, constituencies, pincode, and the city ward (or the national ward map elsewhere)
- land: land cover (ESA WorldCover 2021, resampled to 30 m), elevation and slope (Copernicus DEM GLO-90, about 90 m), people per km2 (WorldPop 2020, about 100 m), CoRE Stack block land use (2023-24), land degradation (NRSC, non-commercial)
- climate: agro-climatic, agro-ecological, eco and biogeographic zones
- water: basin and sub-basin; the nearest river, water body, reservoir, dam, wetland and Ramsar site, each by true distance to its line or outline; Amrit Sarovar ponds; recorded floods and NDEM flood extents (non-commercial)
- hazards: seismic zone (BIS 2016), landslide hazard (non-commercial) and recorded landslides within 5 km, cyclone tracks within 100 km (non-commercial), coastal regulation zone
- protected: recorded forest, and the nearest protected area and wildlife corridor (0 km when inside)
- access: nearest national highway, railway station, metro or suburban station, airport and bus stop (bus stops exist only for some cities: elsewhere
not_covered) - services: nearest hospital or health facility from three sources (each named), nearest school, and the count of mapped places within 1 km
- infrastructure: nearest power line, power plant and water-supply facility, and the distance to India's outline (the coast, or a land border where that is nearer)
Raster entries carry values (field names carry units). For the air above the point, air points to the mugilu MCP server's conditions_at with the same coordinates.
| Param | Type | Description |
|---|---|---|
lat | float * | Latitude (6-38) |
lng | float * | Longitude (68-98) |
open_only | bool | true leaves out the non-commercial layers |
sections | string | Comma-separated sections to read (default all): place, land, climate, water, hazards, protected, access, services, infrastructure. An unknown one is a 400 naming the valid ones |
layers | string | Comma-separated layers to read, as well as any sections asked: any layer id the lookup reads (its lookups in /api/v1/layers), the rasters worldcover, dem and worldpop (section land), or a ward layer (section place; read even where it does not cover the point, then not_covered). A layer it does not read is a 400 naming the valid ones |
As on /ground, pass sections or layers for a narrow question: ?sections=place for the ward and admin units, ?layers=ir_stations for the nearest railway station, ?layers=dem for the elevation. One section answers in about 0.1 to 0.35 seconds; land (three rasters), water and place (with the ward layer) read the most. All nine read 30 to 100 files and take about 0.6 to 2 seconds.
# What is around this point in central Kolkata?
curl "https://bharatlas.com/api/v1/surface?lat=22.57&lng=88.36"
# Only the ward and admin units, and the nearest railway station
curl "https://bharatlas.com/api/v1/surface?lat=22.57&lng=88.36§ions=place&layers=ir_stations"
Admin units by code
For a point, use /locate. To find a unit by its LGD code, or list the units under one, query the LGD layers, e.g. /layers/lgd_districts/query?where=dist_lgd=525 (Bengaluru Urban) or /layers/lgd_blocks/query?where=dist_lgd=525 (its blocks).
Categories (themes) and levels
GET /api/v1/categories
List all categories with layer counts.
curl https://bharatlas.com/api/v1/categories
GET /api/v1/levels
List admin hierarchy levels in order (country, state, district, subdistrict, block, village, ...).
curl https://bharatlas.com/api/v1/levels
GET /api/v1/usage
How much each layer is used: downloads, and API calls that name the layer, split into api and mcp (the bharatlas MCP server). Crawlers are not counted. Add ?layer=<id> for one layer. Calls to the point lookups, which name no layer, are under endpoints (ground, surface) and in the totals.
curl "https://bharatlas.com/api/v1/usage?layer=lgd_districts"
Counts and Stats
GET /api/v1/layers/:id/counts
Deprecated. Retires on 22 December 2026; until then every answer carries Deprecation, Sunset and a Link to its replacement. Use /layers/:id/query?group_by=<col>, which gives the same counts for any column of any layer, with where, filter and sum. Without group_by, returns the total and lists the groupable columns; with filter_col and filter_val, the total of matching rows. With group_by, returns value-level counts for that column.
| Param | Type | Description |
|---|---|---|
group_by | string | Column name to group by (one listed in groupable_columns, e.g. zone) |
filter_col, filter_val | string | Count only rows whose filter_col equals filter_val (exact, case-insensitive), with or without group_by. An unknown column, or one of the two without the other, is a 400. |
# Count wards per zone in PCMC (the replacement)
curl https://bharatlas.com/api/v1/layers/wards_pcmc/query?group_by=zone
Downloads
GET /api/v1/downloads/counts
Download counts per layer and format, plus a grand total.
curl https://bharatlas.com/api/v1/downloads/counts
Community Submissions
GET /api/v1/submissions
List accepted community submissions.
| Param | Type | Description |
|---|---|---|
sort | string | recent (default) or useful |
category | string | Filter by category |
q | string | Search name and description |
limit | int | Results per page (default 20, max 100) |
offset | int | Skip N results |
GET /api/v1/submissions/:id
Single submission detail.
Releases
GET /api/v1/releases
Dated releases, newest first. A release code is bharatlas-<dataset>-<year>.<month> (e.g. bharatlas-cw-2026.11); it is never reused and its files never change. Cite it with its pin, <code>+sha256:<hex>, and its permanent address, https://w3id.org/bharatlas/<dataset>/<year>.<month>; https://w3id.org/bharatlas/<dataset>/latest leads to the newest. The same index is at /releases/index.json, and as pages at /releases.
curl https://bharatlas.com/api/v1/releases
Response Format
All endpoints return JSON. List endpoints wrap results in:
{ "data": [...], "total": N, "limit": 100, "offset": 0 }
Detail endpoints wrap in:
{ "data": { ... } }
Errors return:
{ "error": "Not found", "status": 404 }
Rate limits and what stays the same across versions: Limits and promises.
Download Formats
Each layer may offer up to 5 formats. Use the downloads object from /api/v1/layers/:id to get direct URLs:
| Format | Best for |
|---|---|
parquet | DuckDB, Pandas, R, Spark |
pmtiles | MapLibre, Leaflet, web maps |
geojson | QGIS, D3, Mapbox, general GIS |
kml | Google Earth |
shapefile | ArcGIS, legacy GIS tools |
collect API (write) stable
collect is the write side: design a map form, collect points from contributors, and submit approved points to bharatlas as a layer (reviewed before it appears). It runs as a separate service with its own origin and auth, so it has its own section here rather than sitting under /api/v1 above.
Base URL: https://collect.bharatlas.com/api/collect/v1
Auth is a bearer token in the URL fragment of each share link (kept out of server logs); the field-definition contract is the public meta-schema at https://collect.bharatlas.com/schema/v1.json. Creating a map programmatically needs an API key (the anti-abuse gate) via the X-API-Key header, since there is no browser Turnstile.
| Method | Endpoint | What |
|---|---|---|
| POST | /collections | create a map (X-API-Key, or Turnstile in the browser); returns admin / collect / view links |
| GET | /collections/:id | map metadata + counts |
| PATCH | /collections/:id | edit settings (admin) |
| POST | /collections/:id/records | add one point (contributor) |
| GET | /collections/:id/records | records as GeoJSON, scoped by token |
| POST | /collections/:id/import | bulk import with a source + rights attestation (admin) |
| POST | /records/:id/moderate | approve / reject one point (admin) |
| POST | /collections/:id/publish | submit approved points to bharatlas for review (admin) |
# 1. Create a map (needs an API key; body follows the meta-schema)
curl -X POST https://collect.bharatlas.com/api/collect/v1/collections \
-H "X-API-Key: cak_..." -H "content-type: application/json" \
-d '{ ...map definition per /schema/v1.json... }'
# returns admin / collect / view links; each link's token lives in its URL fragment
# 2. Review incoming points (admin token from the returned admin link)
curl https://collect.bharatlas.com/api/collect/v1/collections/ID/records \
-H "authorization: Bearer adm_..."
# 3. Submit approved points to bharatlas for review (admin token)
# a maintainer approves the submission before it appears on bharatlas
curl -X POST https://collect.bharatlas.com/api/collect/v1/collections/ID/publish \
-H "authorization: Bearer adm_..."
Field contributors add points from the browser via the shared collect link (Turnstile-gated), so that step is a tap, not a curl. Or drive the whole flow from an LLM: the bharatlas MCP (npx bharatlas-mcp@latest) authors collect maps too. Register a share link with register_map and its token scope (view / collect / admin) sets what you can do.
Common questions
Do I need an API key to use the bharatlas API?
No. The API is public, read-only and CORS-enabled. No auth, no signup, no API key. Rate limit is 120 requests per minute per IP, 60/min for the locate endpoints. Please send a `User-Agent` that names your app (for example `my-app/1.0`). We read it only to tell apps, AI tools and crawlers apart, so our counts of how each mode is used stay honest. We don't store it, and we don't track who you are. The full description is at https://bharatlas.com/api/v1/openapi.json (OpenAPI 3.1).
How do I list all geo layers via the API?
GET https://bharatlas.com/api/v1/layers returns every curated layer with pagination. Optional filters: ?category=, ?level=, ?source=, ?q= for full-text search.
How do I find what state or district a coordinate is in?
GET https://bharatlas.com/api/v1/locate?lat=12.97&lng=77.59 runs point-in-polygon across 13 admin and zone layers (plus the city ward layer covering the point) in a single call. Returns state, district, ward, pincode, seismic zone, eco-zone and more, with LGD codes to join on.
How do I find features near a point?
GET https://bharatlas.com/api/v1/nearby?lat=12.97&lng=77.59&layer=wris_reservoirs&radius_km=50 finds features from any layer within a radius. Works for points, polygons and lines: points are measured to the point, lines and polygons to the nearest part of their shape (0 inside a polygon).
How do I find what is below a point (soil, rock, groundwater, seismic zone)?
GET https://bharatlas.com/api/v1/ground?lat=28.525&lng=77.085 returns the subsurface profile of a point in one call: seismic zone, nearby active faults and recorded earthquakes, rock type, aquifer and permeability, groundwater wells and quality, soil properties at three depths from ISRIC SoilGrids 2.0 (CC BY 4.0) and the nearest Soil Health Card sample, ground subsidence in megacities, and tunnels and buried utilities nearby. Each part names its source, licence, scale and year, with a one-line summary.
How do I find what is on the ground at a point (land, water, hazards, access)?
GET https://bharatlas.com/api/v1/surface?lat=28.525&lng=77.085 returns, in one call: the admin units, ward and pincode; land cover (ESA WorldCover), elevation and slope (Copernicus DEM) and population density (WorldPop 2020); climate zones; the river basin, nearest river, water body, dam and wetland, and flood history; hazards; forests and protected areas; the nearest highway, station, airport and bus stop; the nearest hospital and school; and the nearest power line and plant. Each part names its source, licence, scale and year. For the air above the point it points to the mugilu MCP (conditions_at).
How do I query a layer with column filters?
GET https://bharatlas.com/api/v1/layers/:id/query?where=col=val&select=col1,col2&group_by=col. Reads parquet directly from R2 at runtime. Call /schema first to discover column names.
What download formats does bharatlas support?
Up to 5 formats per layer: parquet (DuckDB, Pandas, R, Spark), pmtiles (web maps), geojson (QGIS, D3), kml (Google Earth) and shapefile (ArcGIS). Use /api/v1/layers/:id to get direct download URLs.
How do I connect an LLM to the bharatlas API?
Use the bharatlas MCP server: add bharatlas-mcp to your MCP client config and run npx -y bharatlas-mcp@latest. Connects Claude, GPT, Gemini or any MCP-compatible LLM to query the layers (schema-first querying, spatial joins) and, with a collect share link, to author your own maps.
How do I collect map data from the field with a shared form?
Use collect (collect.bharatlas.com), the write side. Design a small form, share a link, and anyone who has it adds points from their phone with no account. You review incoming points, then publish the approved ones to bharatlas, where a curator approves the submission before it appears. API base: https://collect.bharatlas.com/api/collect/v1.
How do I manage or publish a collect map from an LLM?
Create the map online at collect.bharatlas.com (no account, no key), then use the bharatlas MCP (npx bharatlas-mcp@latest): register_map with a share link. The link scope sets what you can do: view reads and exports published points, collect adds in the browser, admin can edit, moderate, import and publish. The link is the credential, so no API key is needed for maps you made online.
How do I create a collect map programmatically?
POST https://collect.bharatlas.com/api/collect/v1/collections with an X-API-Key header (the anti-abuse gate; the browser flow uses Turnstile instead). It returns admin, collect and view links whose tokens live in the URL fragment. Then GET /collections/:id/records to review and POST /collections/:id/publish to submit approved points to bharatlas for review (a maintainer approves before it appears). Or from an LLM: the bharatlas MCP (npx bharatlas-mcp@latest) authors collect maps too, register your share link with register_map then moderate and publish.
Where do published collect maps show up?
As community submissions, once a curator approves them. GET https://bharatlas.com/api/v1/submissions lists approved submissions, and the read MCP tool list_submissions surfaces them to an LLM. An approved collect map is queryable via /api/v1/layers/:id/query like any other layer.
For LLMs
Use the bharatlas MCP server (npx bharatlas-mcp@latest) to connect Claude, GPT, Gemini, or any MCP-compatible LLM directly to this API. Its tools come with built-in instructions: read tools (schema-first querying, spatial joins, multi-source awareness, and point lookups: what is below and on the ground at a point) plus 9 for authoring collect maps.