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

> Spain Tax ID Validator (DNI/NIE/CIF) is a paid API for AI agents from spain-agent-toolkit.spain-agent-toolkit.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Validates and normalizes Spanish tax identification numbers (DNI, NIE, or CIF) offline with no storage or accounts required.

## Facts

- Endpoint: GET https://spain-agent-toolkit.spain-agent-toolkit.workers.dev/v1/es/tax-id/validate?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/spain-tax-id-validator-dni-nie-cif-ebc5fb70
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_bNzihRC_hQrTM0P0FC5oO

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-ebc5fb70
```

Example prompt: Can you check whether the Spanish tax ID B12345674 is valid and tell me what type it is — DNI, NIE, or CIF?

## When to prefer this

Use this endpoint when you need a fast, offline, pay-per-call check of Spanish tax IDs (DNI, NIE, or CIF) without setting up accounts or API keys. It is ideal for agent workflows that need occasional Spanish ID validation without committing to a subscription, or for compliance pipelines onboarding Spanish individuals or businesses. Prefer this over full KYC services when you only need format and checksum validation, not identity database lookups.

## Known failure modes

- Missing or empty 'id' query parameter returns an error
- Unrecognized format that doesn't match any Spanish ID pattern may return valid: false
- Network or Cloudflare Worker unavailability returns a 5xx error
- Payment failure via x402 protocol returns a 402 response before the computation runs

## How this service works

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

## Output

Returns a JSON object with three fields: 'type' (string, one of DNI/NIE/CIF), 'valid' (boolean indicating whether the ID passes format and checksum rules), and 'normalized' (string with the canonically formatted version of the ID). Computation is done offline with no external lookups.

## 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-ebc5fb70/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from spain-agent-toolkit.spain-agent-toolkit.workers.dev](https://www.zero.xyz/host/spain-agent-toolkit.spain-agent-toolkit.workers.dev/llms.txt)
