Minhap APIcatastro.minhap.es ↗
Access Spanish cadastral property data via 10 endpoints covering provinces, municipalities, streets, parcels, coordinates, and cadastral references from catastro.minhap.es.
What is the Minhap API?
The Catastro Spain API exposes 10 endpoints covering the full hierarchy of Spanish cadastral data — from provinces and municipalities down to individual property records. Use get_cadastral_data_by_reference to retrieve construction details and plot data for a specific 20-character cadastral reference, or get_cadastral_reference_by_coordinates to resolve a longitude/latitude pair to a parcel identity. All 48 Spanish provinces and their municipalities are addressable.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/1318ad15-a565-4322-835b-10630ef5af75/get_provinces' \ -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 catastro-minhap-es-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: Spanish Cadastre API — property lookup by reference, address, and coordinates."""
from parse_apis.Spanish_Cadastre__Catastro__API import (
Catastro,
StreetType,
SpatialReferenceSystem,
PropertyNotFound,
)
client = Catastro()
# List all Spanish provinces
for prov in client.provinces.list(limit=5):
print(f"Province: {prov.name} (code: {prov.cpine})")
# List municipalities in a province
for muni in client.municipalities.list(provincia="MADRID", limit=3):
print(f"Municipality: {muni.name}, cp={muni.cp}")
# Search streets by name in a municipality
for street in client.streets.list(provincia="MADRID", municipio="MADRID", nom_via="MAYOR", tipo_via=StreetType.CALLE, limit=3):
print(f"Street: {street.tv} {street.nv} (code: {street.cv})")
# Find cadastral records by address
record = client.cadastral_records.by_address(provincia="MADRID", municipio="MADRID", nom_via="MAYOR", numero="1", tipo_via=StreetType.CALLE, limit=1).first()
if record:
print(f"Property: {record.address}, Use: {record.use}, Area: {record.area} m2")
# Get parcel centroid coordinates from the record
coord = record.coordinates()
print(f"Centroid: lon={coord.xcen}, lat={coord.ycen}, SRS={coord.srs}")
# Re-fetch the full record by its cadastral reference
try:
full = client.cadastral_records.get(refcat=record.refcat)
print(f"Full record: {full.address}, built: {full.year_built}")
except PropertyNotFound as exc:
print(f"Not found: {exc}")
# Find nearby parcels by coordinates
for parcel in client.cadastral_records.nearby(coor_x="-3.70325", coor_y="40.41669", srs=SpatialReferenceSystem.EPSG_4258, limit=3):
print(f"Nearby: {parcel.address}, distance={parcel.distance}m")
print("exercised: provinces.list / municipalities.list / streets.list / cadastral_records.by_address / record.coordinates / cadastral_records.get / cadastral_records.nearby / PropertyNotFound")
Returns all Spanish provinces with their INE codes and names. No parameters required. The full list contains 48 provinces plus autonomous cities.
No input parameters required.
{
"type": "object",
"fields": {
"prov": "array of provinces with cpine (INE code) and np (name)",
"count": "integer total number of provinces"
}
}About the Minhap API
Geographic hierarchy
get_provinces returns all 48 Spanish provinces with their INE codes (cpine) and names. From there, get_municipalities accepts a provincia name and an optional municipio filter to narrow results, returning each municipality's name (nm), locat, and loine fields. get_streets then drills into a municipality using tipo_via (e.g. CL for calle, AV for avenida, PZ for plaza) and an optional nom_via name fragment, returning street records with tv (type) and nv (name) inside each dir object. get_street_numbers completes the address resolution by returning cadastral reference parts (pc) for a specific house number on a named street.
Property lookup
Three endpoints return full unprotected cadastral records (bico) depending on what identifier you have. get_cadastral_data_by_address accepts street address components — numero, nom_via, and optional planta, puerta, escalera, bloque — and may return multiple records for multi-unit buildings via the rcdnp array. get_cadastral_data_by_reference takes the full 20-character refcat and returns property identification (bi), plot data (finca), and construction details (lcons). get_cadastral_data_by_parcel targets rural land using poligono and parcela numbers within a named province and municipality, returning subparcel data in lspr.
Coordinate lookups
get_cadastral_reference_by_coordinates accepts coor_x (longitude) and coor_y (latitude) with an optional srs parameter (EPSG:4258 or EPSG:4326) and returns the parcel's cadastral reference parts (pc), geographic position (geo), and a human-readable address description (ldt). The reverse — get_coordinates_by_cadastral_reference — takes a 14-character refcat and returns the centroid coordinates (xcen, ycen) of the parcel. get_nearby_cadastral_references returns a list of parcels close to a given coordinate pair, including distances (dis) for each result in the lpcd array.
Data scope and limitations
All data reflects the public, unprotected layer of the Spanish Catastro. Protected data — such as ownership names, tax valuations, and certain protected-use classifications — is not returned by any endpoint. The get_cadastral_data_by_parcel endpoint returns an upstream_error when the polygon/parcel combination does not exist in the registry. Coordinate lookups similarly return an error when no parcel exists at the specified location.
The Minhap API is a managed, monitored endpoint for catastro.minhap.es — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when catastro.minhap.es 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 catastro.minhap.es 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?+
- Resolve a Spanish street address to its 20-character cadastral reference for property due diligence.
- Geocode a cadastral reference to centroid coordinates using
get_coordinates_by_cadastral_referencefor map plotting. - Build a municipality browser that lists all streets in a town using
get_streetswithtipo_viafilters. - Identify all cadastral units in a multi-unit building via the
rcdnparray fromget_cadastral_data_by_address. - Find nearby parcels around a GPS point using
get_nearby_cadastral_referenceswith distance values fromdis. - Validate rural land parcel identifiers by querying
get_cadastral_data_by_parcelwith polygon and parcel numbers. - Enumerate all municipalities in a Spanish province by looping through results from
get_municipalitiesfiltered byprovincia.
| 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 catastro.minhap.es have an official developer API?+
What does `get_cadastral_data_by_reference` return compared to `get_cadastral_data_by_address`?+
get_cadastral_data_by_reference takes the full 20-character refcat and returns structured bico data including property identification (bi), plot data (finca), and construction records (lcons) with counts in cucons and cucul. get_cadastral_data_by_address resolves from street components and may return multiple records (one per unit) in the rcdnp array when the building has several cadastral units — each with its own rc reference.Does the API return property ownership names or tax valuations?+
Does the coordinate lookup support arbitrary projection systems beyond EPSG:4258 and EPSG:4326?+
srs parameter on get_cadastral_reference_by_coordinates, get_coordinates_by_cadastral_reference, and get_nearby_cadastral_references accepts EPSG:4258 and EPSG:4326 only. Other CRS codes such as UTM projections are not supported by these endpoints. You can fork the API on Parse and revise it to add coordinate transformation logic for other projections before or after the lookup.How specific can the street search be in `get_streets`?+
get_streets requires provincia and municipio in uppercase and accepts optional tipo_via (e.g. CL, AV, PZ, PJ) and nom_via as a name fragment. It returns a callejero object with a calle array, each entry containing a dir object with tv (type) and nv (name), plus a dirine field. The control.cuca field tells you how many streets matched. There is no pagination parameter — large municipalities may return many records in a single response.