# Duo Data Utilities – IDN Converter & IDNA2008 Validator

> Duo Data Utilities – IDN Converter & IDNA2008 Validator is a paid API for AI agents from api.duoleads.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-10-02).

Converts internationalised domain names between Unicode and ASCII punycode, validates each label against IDNA2008 rules, and returns both forms with a per-label breakdown and the first rule violated.

## Facts

- Endpoint: GET https://api.duoleads.com/v1/code/idn?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/duo-data-utilities-idn-converter-idna2008-validator-71f568af
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KcPg_-ABInHa-1oSXNY2H

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 duo-data-utilities-idn-converter-idna2008-validator-71f568af
```

Example prompt: Can you convert 'bücher.example' to its ASCII punycode form and validate each label against IDNA2008 rules, giving me both the unicode and ASCII versions?

## When to prefer this

Choose this endpoint when you need to convert between Unicode and punycode domain representations, validate IDN labels against IDNA2008 (strict) or UTS 46 transitional rules, or get a per-label breakdown of IDNA compliance. Prefer this over generic string utilities because it specifically handles the IDNA2008 standard, the Public Suffix List is handled by a sibling endpoint, and it supports both directions of conversion plus detailed rule-violation reporting in a single call.

## Known failure modes

- Missing required 'domain' query parameter returns a validation error
- Domain label exceeds 63 characters returns invalid with length violation reason
- Domain contains disallowed code points returns invalid with the specific IDNA2008 violation
- Hyphen at positions 3 and 4 of a label triggers hyphen-hyphen rule violation
- Bidirectional rule violation returns invalid with bidi reason
- Strict IDNA2008 mode may reject labels that UTS 46 transitional mode would accept (e.g. ß)
- Malformed punycode input may return a parse error or invalid result

## How this service works

Convert internationalised domain names between Unicode and ASCII punycode in either direction, label by label, and validate each label against IDNA2008: length, leading and trailing hyphens, the hyphen-hyphen rule at positions 3 and 4, disallowed code points and bidirectional rules. Returns both forms, the per-label breakdown and the first rule violated. Strict mode is IDNA2008 (UTS 46 non-transitional); it may reject names /v1/code/url displays.

## Output

Returns a JSON object with the ASCII punycode form, Unicode form, overall validity flag, total label length, and an array of per-label objects each containing the ascii and unicode representations, label index, length, punycoded flag, validity, and the first IDNA rule reason violated (or null if valid). Metadata includes request ID, computation timestamp, price, and attribution to the Unicode IDNA mapping table.

## 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": [
      "domain"
     ],
     "properties": {
      "to": {
       "enum": [
        "ascii",
        "unicode",
        "both"
       ],
       "type": "string",
       "default": "both",
       "maxLength": 64,
       "description": "ascii, unicode or both (default). Validated only: the response always carries both forms."
      },
      "domain": {
       "type": "string",
       "maxLength": 512,
       "description": "Domain name in Unicode or punycode form."
      },
      "strict": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "default": "true",
       "maxLength": 64,
       "description": "true (default) applies IDNA2008 strictly; false uses UTS 46 transitional (IDNA2003-compatible) processing, which maps e.g. ß to ss; current browsers and /v1/code/url use non-transitional processing, so its output can differ from them."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "ok",
      "route",
      "version",
      "data",
      "meta"
     ],
     "properties": {
      "ok": {
       "const": true
      },
      "data": {
       "type": "object",
       "required": [
        "ascii",
        "unicode",
        "valid",
        "labels",
        "reason",
        "total_length"
       ],
       "properties": {
        "ascii": {
         "type": [
          "string",
          "null"
         ]
        },
        "valid": {
         "type": "boolean"
        },
        "labels": {
         "type": "array",
         "items": {
          "type": "object",
          "required": [
           "index",
           "unicode",
           "ascii",
           "length",
           "punycoded",
           "valid",
           "reason"
          ],
          "properties": {
           "ascii": {
            "type": [
             "string",
             "null"
            ]
           }
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "ascii": "xn--bcher-kva.example",
   "valid": true,
   "labels": [
    {
     "ascii": "xn--bcher-kva",
     "index": 0,
     "valid": true,
     "length": 13,
     "reason": null,
     "unicode": "bücher",
     "punycoded": true
    },
    {
     "ascii": "example",
     "index": 1,
     "valid": true,
     "length": 7,
     "reason": null,
     "unicode": "example",
     "punycoded": false
    }
   ],
   "reason": null,
   "unicode": "bücher.example",
   "total_length": 21
  },
  "meta": {
   "sources": [
    {
     "id": "unicode-idna-tables",
     "licence": "Unicode License v3",
     "version": "tr46 6.0.0 (UTS #46 IdnaMappingTable)",
     "published": "2026-09-29",
     "attribution": "Unicode IdnaMappingTable via the tr46 package (MIT); (c) Unicode, Inc."
    }
   ],
   "price_usd": "0.05",
   "disclaimer": "Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms",
   "request_id": "01K6B7Q4ZC8H3F2M9WXR5TYN0D",
   "computed_at": "2026-09-28T12:00:00.000Z",
   "deterministic": true
  },
  "route": "/v1/code/idn",
  "version": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/duo-data-utilities-idn-converter-idna2008-validator-71f568af/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.duoleads.com](https://www.zero.xyz/host/api.duoleads.com/llms.txt)
