Domain Parser (Public Suffix) API

Split a URL, e-mail or hostname into subdomain, registrable domain and public suffix (.com.vn, github.io) from the Public Suffix List; IDN, batch of 1000.

GETPOSThttps://apibox.io.vn/v1/domain-parse
Network & Validation▶ Try it online

Give a URL, a hostname or an e-mail address as domain and get its parts according to the Public Suffix List: public_suffix (com.vn, edu.vn, co.uk), the registrable domain (domain, eTLD+1, the level at which cookies and sites are scoped), subdomain, domain_without_suffix and tld. Private suffixes run by companies (github.io, workers.dev, blogspot.com…) are recognised: suffix_type is icann, private or unlisted, and for private suffixes domain_icann gives the domain under the ICANN rules only.

Internationalised domain names are converted both ways (hostname in punycode xn--…, hostname_unicode and domain_unicode), hostnames are checked against the length and character rules, IP addresses are detected, and localhost or internal names are flagged. POST domains (array or one per line, up to 1000) for a batch; group=true also groups the inputs by registrable domain, for example to count leads per company website.

The list is the Public Suffix List (publicsuffix.org, MPL-2.0) compiled in the tldts library; a weekly check compares it with the published list. Purely local: no DNS or WHOIS request. For homoglyph and phishing checks of IDNs use /v1/unicode-check.

Parameters

NameInTypeRequiredDefault
domainquery|bodystringnoA URL, hostname or e-mail address. Also accepted in the path: /v1/domain-parse/shop.abc.com.vn.
domainsbodyarraynoBatch: up to 1000 inputs (array, or separated by new lines, commas or spaces).
groupbody|querybooleannofalseWith domains: also group the inputs by registrable domain.

Example

curl "https://apibox.io.vn/v1/domain-parse?domain=https://shop.abc.com.vn/san-pham?id=1" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "input": "https://shop.abc.com.vn/san-pham?id=1",
  "hostname": "shop.abc.com.vn",
  "hostname_unicode": "shop.abc.com.vn",
  "valid": true,
  "is_ip": false,
  "is_idn": false,
  "is_localhost": false,
  "labels": 4,
  "tld": "vn",
  "public_suffix": "com.vn",
  "suffix_type": "icann",
  "domain": "abc.com.vn",
  "domain_unicode": "abc.com.vn",
  "domain_without_suffix": "abc",
  "subdomain": "shop",
  "source": "Public Suffix List (publicsuffix.org, MPL-2.0) via tldts"
}

Use cases

  • Group visits, leads or backlinks by website (registrable domain)
  • Decide cookie scope and same-site rules for a hostname
  • Extract the company domain from work e-mail addresses
  • Normalise and validate hostnames in crawler or allowlist configs

FAQ

Why is the domain of my-app.github.io not github.io?

github.io is a private public suffix: each user site is its own registrable domain. domain_icann shows github.io, the answer under ICANN rules only.

Does it check that the domain exists?

No. It only parses the name; use /v1/dns or /v1/whois to check registration and records.

How fresh is the suffix list?

It is the list shipped with the tldts library, checked weekly against publicsuffix.org and updated with it.

Related APIs

Start with 1,000 free requests every month. Get free API key →