# Spain Tax ID Validator (DNI/NIE/CIF)

> Spain Tax ID Validator (DNI/NIE/CIF) is a paid API for AI agents from es.redtapeapi.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-18).

Validates and normalizes a Spanish tax identifier (DNI, NIE, or CIF) and identifies its type

## Facts

- Endpoint: GET https://es.redtapeapi.com/v1/es/tax-id/validate?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-18
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-tax-id-validator-dni-nie-cif-0ae5490f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_yZ1KQsSaCPdhHRWaYufEo

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-tax-id-validator-dni-nie-cif-0ae5490f
```

Example prompt: Can you check whether B12345674 is a valid Spanish tax ID and tell me what type it is?

## When to prefer this

Use this endpoint when you need a lightweight, no-account, pay-per-call check of any Spanish fiscal identifier (DNI for individuals, NIE for foreign residents, CIF for companies). It is ideal for agent workflows that encounter Spanish tax IDs at runtime and need instant validation without maintaining API credentials. Prefer it over EU VIES-based checks for individual (non-VAT) Spanish IDs.

## Known failure modes

- Invalid or malformed ID string returns valid=false with type still identified where possible
- Missing required 'id' query parameter returns a 400-level error
- Ambiguous IDs that don't match any known Spanish format may return valid=false without a type
- Network or upstream service errors may return 5xx responses

## How this service works

Pay-per-call Spain and EU utilities for AI agents over x402 (USDC). No accounts, no API keys. Public open data, live official checks (EU VIES) and offline computation; nothing is stored.

## Output

A JSON object indicating whether the submitted ID is valid (boolean), its type (DNI, NIE, or CIF), and a normalized canonical form of the identifier (e.g. {"type":"CIF","valid":true,"normalized":"B12345674"}).

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "id"
     ],
     "properties": {
      "id": {
       "type": "string",
       "description": "The DNI, NIE or CIF"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "type": "CIF",
  "valid": true,
  "normalized": "B12345674"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/spain-tax-id-validator-dni-nie-cif-0ae5490f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from es.redtapeapi.com](https://www.zero.xyz/host/es.redtapeapi.com/llms.txt)
