The unacasa API and MCP server
The facts of every cadastral parcel in Spain in one call, with the source and the licence of every field. For programs through the REST API, and for AI assistants through the MCP server.
What it offers
- The facts of a parcel or of a cadastral unit: cadastre, buildings, quality and reforms, energy, climate, soil, hazards (floods), surroundings (services, transport, noise, views), planning, crops and the value estimates.
- Search over units, parcels, buildings and agency adverts, with filters per field, place, point and radius, drawn polygon, facets, summary and cursor.
- Places: municipalities, neighbourhoods, census sections, streets and addresses by name.
- Ready-made selections (
preset):building,buyer_home,climate,soil,hazards,farmland.
The key is the cadastral reference (14 characters). With a point or an address, the API finds the parcel and tells you which one it used.
Start in three steps
- Create an API key in your account. Open unacasa.es/account/, section API keys, and create a key with the permissions you need:
unacasa.readfor facts, search and places,unacasa.valuationfor the value estimates. The secret is shown once. An organisation can hold its own keys. - Request a token. The key is an OAuth 2.1 client of the server
auth.unacasa.es. A token is short-lived; request a new one when it expires.curl -s -X POST https://auth.unacasa.es/realms/unacasa/protocol/openid-connect/token \ -d grant_type=client_credentials \ -d client_id=CLIENT_ID -d client_secret=CLIENT_SECRET \ -d scope=unacasa.read - Call the API.
curl -s https://api.unacasa.es/facts/8960309VK3786B?preset=buyer_home \ -H "Authorization: Bearer ACCESS_TOKEN"
Without a token you can also try the API (routes /facts, /place-facts, /search and /places) and the MCP server: 20 calls a day per IP address. A token of a free account gives 100 a day (see limits). The catalogue (/fields, /presets) and the OpenAPI description (/openapi.json) do not count.
Routes
Base: https://api.unacasa.es. The full description is in the API reference and in openapi.json (OpenAPI 3).
| Route | What it returns | Scope |
|---|---|---|
| GET /facts/{refcat} | The facts of a parcel. Parameters fields, groups, preset, format=nested, lang. | unacasa.read |
| GET /facts?lat=&lon= | The facts of the parcel at a point or at an address (address=). | unacasa.read |
| GET /facts/unit/{unit_ref} | The facts of a cadastral unit (dwelling, shop, garage). | unacasa.read |
| GET /fields | The catalogue: 717 fields with group, type, unit, source and licence. | public |
| GET /presets | The named field selections. | public |
| GET /search | Search of unit, parcel, building or listing: filters, place, near, bbox, poly, q, sort, facets, summary, cursor. | unacasa.read |
| GET /search/fields | The filter fields of an entity, with their operators. | unacasa.read |
| GET /places | Places, streets and addresses by name. | unacasa.read |
| POST /mcp | The MCP server (see below), on mcp.unacasa.es. | OAuth |
The answer
One answer per parcel. Every field carries value, unit, source, source_url, licence, dataset_vintage and status (ok, absent, failed or forbidden). A layer that fails does not fail the call: its fields come back failed and the layer is named in partial_failures. With format=nested each layer arrives as one object.
{
"parcel": { "refcat": "8960309VK3786B", "lat": 40.430814, "lon": -3.721577,
"url": "https://unacasa.es/?p=8960309VK3786B" },
"fields": {
"climate.year.cdd18": {
"value": 660, "unit": "degree days", "type": "number", "status": "ok",
"source": "AEMET ROCIO_IBEB — rejilla diaria de precipitación y temperaturas (5 km, 1951-2022)",
"source_provider": "Agencia Estatal de Meteorología",
"source_url": "https://www.aemet.es/es/serviciosclimaticos/cambio_climat/datos_diarios?w=1",
"licence": "Autorizado el uso de la información y su reproducción citando a AEMET como autora de la misma",
"dataset_vintage": "1991-2020" }
},
"counts": { "ok": 1, "absent": 0, "failed": 0, "forbidden": 0 },
"partial_failures": []
}
MCP server for AI assistants
The MCP server exposes the same data as tools for Claude, ChatGPT and any client of the Model Context Protocol. Address: https://mcp.unacasa.es/mcp (streamable HTTP, JSON-RPC 2.0).
Connect it in Claude
- In claude.ai open Settings → Connectors → Add custom connector and paste
https://mcp.unacasa.es/mcp. - Claude registers itself with our identity server and sends you to
auth.unacasa.es. Log in with your unacasa account and accept the permissions it asks for (unacasa.read, andunacasa.valuationif you want the estimates). - The tools appear in the conversation. Ask, for example, "the figures of the Malasaña barrio in Madrid" (tool
get_place_facts: barrios, districts, municipalities, postal codes and streets, the same figures as their page), "the facts of parcel 8960309VK3786B" or "houses over 150 m² within 500 m of Calle de Alcalá 100, Madrid".
ChatGPT and other clients follow the same path: the server publishes its metadata at /.well-known/oauth-protected-resource and accepts dynamic client registration (RFC 7591) from the Claude and OpenAI domains.
Tools
| Tool | Input | Output |
|---|---|---|
find_parcel | address or lat + lon | cadastral reference, address, municipality, point |
get_parcel_facts | refcat, optional fields, groups, preset | the fields with their source |
get_unit_facts | unit_ref | the fields of a cadastral unit |
get_climate | refcat | normals, months, stations |
get_soil | refcat | soil: topsoil, water, 6 depths, soil group |
get_valuation | refcat | sale and rent estimates (unacasa.valuation) |
list_fields | optional group | the catalogue |
find_place | name, optional kind | places with the places above them |
search and search_fields | entity, filters, place, lat + lon + radius_m, bbox, q, sort, facets, summary, limit, cursor | count, rows, facets, summary, cursor |
More examples
Filters are query parameters named after the field: field=value (a comma list means "any of"), field.min, field.max, field.not, field.null=true|false, field.like for text. Flats of 80 m² or more, on a top or intermediate floor, facing south, within 2 km of the coast:
curl -s "https://api.unacasa.es/search?entity=unit&property_kind=FLAT&built_m2.min=80&floor_position=top,intermediate&facing=S,SE&coast_m.max=2000&limit=50" \
-H "Authorization: Bearer ACCESS_TOKEN"
Sale adverts of flats up to 300 000 € inside a place (the place_id comes from /places):
curl -s "https://api.unacasa.es/search?entity=listing&operation=SALE&listing_kind=FLAT&amount.max=300000&place=PLACE_ID&facets=municipality&summary=true" \
-H "Authorization: Bearer ACCESS_TOKEN"
The parcel of an address and its climate:
curl -s "https://api.unacasa.es/facts?address=Calle%20de%20Alcal%C3%A1%20100,%20Madrid&preset=climate" \
-H "Authorization: Bearer ACCESS_TOKEN"
The filter fields of the adverts:
curl -s "https://api.unacasa.es/search/fields?entity=listing" -H "Authorization: Bearer ACCESS_TOKEN"
The field names and their operators are in /fields and in /search/fields. Do not guess them: the catalogue changes with every new source.
Limits and terms
- Rate: 30 calls per second per IP address on the API, with bursts of 60; 10 per second on the MCP server. Above that the answer is
429. - Access levels (calls a day, values on 16/11/2026; each API call and each MCP tool call counts one): without an account, 20 per IP address; with a free account, 100; with the paid plan, no daily limit. Without an account, over the limit the answer is
401with the link to create the account (an MCP client then asks you to sign in); with an account,429until midnight in Madrid (Retry-After). Each answer carriesX-Quota-Tier,X-Quota-LimitandX-Quota-Remaining. - Keys: up to 20 active keys per owner. Revoke a key in your account and the tokens it issued stop working.
- Scopes: a call outside the scopes of the token answers
403 insufficient_scopeand names the missing scope. - Sources: every field names its source and its licence. If you publish the data, cite the source the field gives (Catastro, AEMET, IGN, INE and others).
- Use: the terms of use apply, in particular section 7 on the API. The value estimates are indicative and are not an appraisal.
- Contact: from your account, or at privacidad@unacasa.es.
OpenID discovery: https://auth.unacasa.es/realms/unacasa/.well-known/openid-configuration. MCP resource metadata: https://mcp.unacasa.es/.well-known/oauth-protected-resource.