catastrogps
Official Python client for the Catastro GPS API: cadastral parcels in 29 European countries plus the Basque Country and Navarre (31 country and region codes) with one API key.
- Look up a parcel by its official cadastral reference or by coordinates, with the country detected for you.
- Turn a Spanish postal address in free text into a cadastral reference.
- Get the parcel outline (GeoJSON or a
[lat, lng]ring), and KML / GPX / DXF exports. - Solar (PVGIS) and agricultural context for parcels in Spain, Portugal, France, Italy and Germany.
- One dependency (
httpx), typed, Python 3.9+.
Free tier: 250 calls a month, forever. Failed lookups are not charged. Get a key at parcelgps.com/developers.
Install
pip install catastrogps
Quick start
from catastrogps import CatastroGPS
client = CatastroGPS("pk_live_your_key_here")
parcel = client.parcels.get("9872023VH5797S0001WX")
print(parcel["municipio"], parcel.get("superficieParcela"), parcel["latitud"], parcel["longitud"])
CatastroGPS() with no arguments reads CATASTROGPS_API_KEY from the environment. Use it as a context manager to close the connection pool:
with CatastroGPS() as client:
...
Examples
match = client.parcels.find_by_address("Calle Mallorca 213, Barcelona")
match["referenciaCatastral"]
in_warsaw = client.parcels.at_point(52.2297, 21.0122)
in_warsaw["referenciaCatastral"], in_warsaw.get("pais")
foral = client.parcels.get("<Navarre reference>", country="NA")
outline = client.parcels.geometry("9872023VH5797S", country="ES")
outline.get("geojson")
solar = client.parcels.solar("9872023VH5797S0001WX")
solar["kwh_year"]
kml_bytes = client.export.file("9872023VH5797S0001WX", "kml")
guess = client.resolve("05102200100005")
guess["candidates"]
client.last_quota
Responses are the API's data object as a dict, with the field names the API uses (refCatastral, municipio, superficieParcela…). See the API reference.
Errors
Every error is a CatastroGPSError with status, code and details:
from catastrogps import AmbiguousReferenceError, CoverageError, NotFoundError, QuotaExceededError
try:
client.parcels.get("05102200100005")
except AmbiguousReferenceError as error:
first = error.candidates[0]["country"]
client.parcels.get("05102200100005", country=first)
except (NotFoundError, CoverageError) as error:
print(error.message)
except QuotaExceededError:
print("Monthly quota used up")
Also available: AuthenticationError, ValidationError, RateLimitError, ServiceUnavailableError, ServerError, TimeoutError, NetworkError.
Timeouts, network errors, 429 rate limits and 502/503/504 are retried up to max_retries times (default 2) with exponential backoff. An exhausted monthly quota is never retried. Each attempt that reaches the API counts as a call.
Options
| Argument | Default | |
|---|---|---|
api_key |
CATASTROGPS_API_KEY |
Required |
base_url |
https://api.catastrogps.es |
|
timeout |
30.0 seconds |
Official cadastres can be slow |
max_retries |
2 |
|
http_client |
new httpx.Client |
Bring your own (proxies, tests with httpx.MockTransport) |
Coverage
| Code | Country / region | Reference | Coordinates | Notes |
|---|---|---|---|---|
ES |
Spain | ✅ | ✅ | Free-text address search |
PV · NA |
Basque Country · Navarre | ✅ | ✅ | Foral cadastres |
PT |
Portugal | Partial | ✅ | Digital cadastre is partial |
FR · IT |
France · Italy | ✅ | ✅ | |
DE |
Germany | Partial | Partial | All Länder except Bavaria |
AT CH LI BE NL LU |
Austria, Switzerland, Liechtenstein, Belgium, Netherlands, Luxembourg | ✅ | ✅ | |
PL CZ SK SI HR BG GR CY |
Poland, Czechia, Slovakia, Slovenia, Croatia, Bulgaria, Greece, Cyprus | ✅ | ✅ | |
DK NO FI IS EE LV LT IE |
Denmark, Norway, Finland, Iceland, Estonia, Latvia, Lithuania, Ireland | ✅ | ✅ | |
SE |
Sweden | ✅ | ✅ | Agricultural blocks, not property units |
UK |
United Kingdom | — | Scotland | England, Wales and Northern Ireland not yet |
Geometry is available wherever a reference works. Solar and agriculture: ES, PV, NA, PT, FR, IT, DE. Data comes live from each official source, so availability follows theirs.
Pricing
| Plan | Price | Calls / month |
|---|---|---|
| Free | €0, forever | 100 |
| Developer | €19 / month | 5,000 |
| Startup | €49 / month | 15,000 |
| Growth | €99 / month | 50,000 |
The same key works with the JavaScript SDK (npm install catastrogps) and the MCP server for AI agents (catastro-gps-mcp).
License
MIT
Metadata
Release files for catastrogps 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| catastrogps-1.0.1.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| catastrogps-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.7 kB
Release files / catastrogps-1.0.1.tar.gz
| Download URL | catastrogps-1.0.1.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
78ba6edbd827259ee6f7d9d2d5cb32e22208b5a8bd74b572b449a548341de97f
|
|
BLAKE2b-256 checksum How to use checksums |
2827d0c49289de2ebb89780415bf52d4eada1a005ab3584522f96b82d317e0fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / catastrogps-1.0.1-py3-none-any.whl
| Download URL | catastrogps-1.0.1-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
445a388de3b1423391dca95f4fa1ee5a1f43ed0315aa5f71f93397b3d580433b
|
|
BLAKE2b-256 checksum How to use checksums |
9e8c664418fcb3046750ecc636e600a2e0792ec917f73219229f32c1b4f0157d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|