IDNA2008 / punycode conversion and domain-label validation
code_idnConvert 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. Price: $0.05 per successful call, paid over x402 (USDC on Base).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ascii, unicode or both (default). Accepted: ascii, unicode, both. | |
| domain | Yes | Domain name in Unicode or punycode form. Accepted: at most 512 characters. | |
| strict | No | 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. Accepted: true or false. |