# Spanish Municipality Lookup by Name (CartoCiudad/IGN)

> Spanish Municipality Lookup by Name (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).

Finds Spanish municipalities or towns by name and returns INE code, province, autonomous community, and geographic coordinates using official CartoCiudad (IGN) data.

## Facts

- Endpoint: POST https://api.vextorium.com/municipio-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/spanish-municipality-lookup-by-name-cartociudad-ign-ae68d643
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_UxhqEa0f44k8708cPtbBc

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 spanish-municipality-lookup-by-name-cartociudad-ign-ae68d643 -d '<json body>'
```

Example prompt: Can you look up the official data for the Spanish municipality 'Zarautz' — I need its INE code, province, autonomous community, and coordinates?

## When to prefer this

Use this endpoint when you need official Spanish municipal data — INE codes, administrative hierarchy (province and autonomous community), and geographic coordinates — sourced from the authoritative CartoCiudad (IGN/CNIG) dataset. Prefer this over generic geocoders when you specifically need the INE code or need to verify Spain's official administrative classification. It also handles name disambiguation by returning multiple candidates.

## Known failure modes

- Name not found in CartoCiudad database — results array may be empty
- Ambiguous name returns multiple unrelated municipalities requiring manual disambiguation
- Misspelled or accented name may fail to match — input must be reasonably close to the official name
- Non-Spanish municipality names will not be found
- Network or payment errors may prevent the request from completing

## How this service works

Find a Spanish municipality or town by name: INE code, province, region and coordinates, with alternatives when several match. Official CartoCiudad (IGN) data.

## Output

Returns a JSON object with the query string, data source attribution (CartoCiudad/IGN, CC BY 4.0), and an array of matching results. Each result includes the place name (official), type (e.g. Municipio, población), province, autonomous community, INE code, and decimal latitude/longitude coordinates. Multiple results are returned when the name matches more than one location.

## 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": [
      "nombre"
     ],
     "properties": {
      "nombre": {
       "type": "string"
      }
     }
    },
    "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": {
      "fuente": {
       "type": [
        "string",
        "null"
       ]
      },
      "consulta": {
       "type": [
        "string",
        "null"
       ]
      },
      "resultados": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": [
         "null",
         "object"
        ],
        "properties": {
         "lat": {
          "type": [
           "null",
           "number"
          ]
         },
         "lon": {
          "type": [
           "null",
           "number"
          ]
         },
         "tipo": {
          "type": [
           "null",
           "string"
          ]
         },
         "nombre": {
          "type": [
           "null",
           "string"
          ]
         },
         "comunidad": {
          "type": [
           "null",
           "string"
          ]
         },
         "provincia": {
          "type": [
           "null",
           "string"
          ]
         },
         "codigo_ine": {
          "type": [
           "null",
           "string"
          ]
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "fuente": "CartoCiudad (IGN/CNIG, CC BY 4.0)",
  "consulta": "Zarautz",
  "resultados": [
   {
    "lat": 43.28416905310724,
    "lon": -2.16668338665575,
    "tipo": "poblacion",
    "nombre": "Zarautz, Zarautz",
    "comunidad": "País Vasco/Euskadi",
    "provincia": "Gipuzkoa",
    "codigo_ine": "20079"
   },
   {
    "lat": 43.23928748211347,
    "lon": -2.733328132386681,
    "tipo": "poblacion",
    "nombre": "Zarautz baserria / Caserío Zarautz, Zarautz baserria / Caserío Zarautz (Amorebieta-Etxano)",
    "comunidad": "País Vasco/Euskadi",
    "provincia": "Bizkaia",
    "codigo_ine": "48003"
   },
   {
    "lat": 43.27407366849084,
    "lon": -2.169209291542749,
    "tipo": "Municipio",
    "nombre": "Zarautz, Gipuzkoa",
    "comunidad": "País Vasco/Euskadi",
    "provincia": "Gipuzkoa",
    "codigo_ine": "20079"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spanish-municipality-lookup-by-name-cartociudad-ign-ae68d643/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)
