# Spain Reverse Geocoder (CartoCiudad/IGN)

> Spain Reverse Geocoder (CartoCiudad/IGN) is a paid API for AI agents from api.vextorium.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-13).

Returns the nearest address in Spain for a given lat/lon coordinate using the official CartoCiudad reverse geocoder, including street, number, postcode, municipality, INE code, province, region, and cadastral reference.

## Facts

- Endpoint: POST https://api.vextorium.com/geocodificar-inverso-es-pago?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-reverse-geocoder-cartociudad-ign-79676726
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5_Fwyu_eEtfug7Ly_jxx9

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability spain-reverse-geocoder-cartociudad-ign-79676726 -d '<json body>'
```

Example prompt: What is the official street address at coordinates 40.41652, -3.70378 in Spain? I need the full address including postcode, municipality, province, and cadastral reference.

## When to prefer this

Choose this endpoint when you need official, authoritative Spanish address data from IGN's CartoCiudad dataset, especially when you require cadastral references or INE codes alongside the street address. It is specifically scoped to Spain and provides richer administrative metadata than general-purpose geocoders like Google Maps or Nominatim.

## Known failure modes

- Coordinates outside Spain return no result or null fields
- Very remote or rural coordinates may return nearest road rather than a numbered address
- Coastal or sea coordinates will fail to match any address
- Malformed or out-of-range lat/lon values cause validation errors
- Temporary CartoCiudad API outages may cause upstream failures

## How this service works

Nearest address to coordinates in Spain with the official CartoCiudad reverse geocoder (IGN): street and number, postcode, municipality, INE code, province, region and cadastral reference.

## Output

A JSON object containing the resolved address details: latitude and longitude of the matched point, address type (tipo), street name (direccion), house number (numero), postal code (codigo_postal), municipality (municipio), INE municipal code (codigo_ine), province (provincia), autonomous community (comunidad), cadastral reference (referencia_catastral), and data source attribution (fuente: CartoCiudad IGN/CNIG CC BY 4.0).

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "lat",
      "lon"
     ],
     "properties": {
      "lat": {
       "type": "number"
      },
      "lon": {
       "type": "number"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": [
      "object",
      "null"
     ],
     "properties": {
      "lat": {
       "type": [
        "number",
        "null"
       ]
      },
      "lon": {
       "type": [
        "number",
        "null"
       ]
      },
      "tipo": {
       "type": [
        "string",
        "null"
       ]
      },
      "fuente": {
       "type": [
        "string",
        "null"
       ]
      },
      "numero": {
       "type": [
        "number",
        "null"
       ]
      },
      "comunidad": {
       "type": [
        "string",
        "null"
       ]
      },
      "direccion": {
       "type": [
        "string",
        "null"
       ]
      },
      "municipio": {
       "type": [
        "string",
        "null"
       ]
      },
      "provincia": {
       "type": [
        "string",
        "null"
       ]
      },
      "codigo_ine": {
       "type": [
        "string",
        "null"
       ]
      },
      "codigo_postal": {
       "type": [
        "string",
        "null"
       ]
      },
      "referencia_catastral": {
       "type": [
        "string",
        "null"
       ]
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lat": 40.41652681555059,
  "lon": -3.703787669080751,
  "tipo": "portal",
  "fuente": "CartoCiudad (IGN/CNIG, CC BY 4.0)",
  "numero": 7,
  "comunidad": "Comunidad de Madrid",
  "direccion": "PUERTA DEL SOL",
  "municipio": "Madrid",
  "provincia": "Madrid",
  "codigo_ine": "28079",
  "codigo_postal": "28012",
  "referencia_catastral": "0444101VK4704C"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-reverse-geocoder-cartociudad-ign-79676726/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.vextorium.com](https://www.zero.xyz/host/api.vextorium.com/llms.txt)
