URL parser: parse, canonicalize and extract the registrable domain (eTLD+1)
URL parser: parse and canonicalise a URL, and extract its registrable domain using the Public Suffix List — the part an agent needs to decide whether two URLs belong to the same owner. Returns scheme, host, port, path, decoded query parameters and fragment, the public suffix, the registrable domain (eTLD+1), the subdomain, whether the suffix is ICANN or private, plus a canonical form with default port, dot-segments and percent-encoding normalised. unicode_host uses WHATWG/UTS 46 (non-strict).
Output (data): canonical, scheme, username (string|null, null without userinfo), host (string|null; null for absolute URLs with no host such as mailto:, urn:, data: and file:///, which parse per WHATWG with path holding everything after the scheme; for those public_suffix, registrable_domain, subdomain, host_type and unicode_host are null and suffix_source is none), port (null when default), path, fragment (string|null, null without a fragment), query [{key, value}], public_suffix (string|null, null for IP hosts), registrable_domain (eTLD+1; string|null, null when public_suffix is null or the host is the suffix itself), subdomain (string|null, null when there is none), suffix_source (icann|private|none), host_type (domain|ipv4|ipv6|idn; null without a host), unicode_host (string|null, null when the host is not an IDN).
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Sources: public-suffix-list a179a48c465e818cfd8d626691cb317985da87fb (published 2026-09-24, MPL-2.0). Echoed in meta.sources.
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#code-url
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/code/url
- Auth: none declared
Query parameters
Absolute URL, or a bare hostname (https:// assumed). Accepted: an absolute URL, or a hostname.
Base URL to resolve url against as a relative reference. Accepted: an absolute URL.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.