Domain Parser Public Suffix List eTLD 1 IDN API
Free tier included · ToolsSplitting a hostname into "the part you can set cookies on" and "the part you can't" is a problem every analytics, security and email team hits. Naive splitting on the last dot breaks the moment you meet `shop.example.co.uk`, `myrepo.github.io` or `foo.bar.ck`. The correct answer requires a Public Suffix List implementation that honours wildcard rules (`*.ck`) and exception rules (`!www.ck`) — and a list that is actually bundled, not fetched at runtime.
This API is that parser. `GET /parse` returns the TLD and SLD labels, the matched public suffix, the registrable domain (eTLD+1), the subdomain and whether the matching rule came from the ICANN or the PRIVATE section of the list. `GET /idn` decodes punycode to Unicode and encodes back, using the same WHATWG / UTS #46 implementation browsers use, so `xn--e1afmkfd.xn--p1ai` round-trips correctly.
Who it's for: analytics teams attributing traffic to the right eTLD+1, email validators rejecting sign-ups from disposable-hosting subdomains, security tooling grouping alerts by registrable domain, and ad-tech doing cookie-safety checks before setting a domain attribute.
Why this one: it is fully offline and stateless — the PSL ships inside the image, no external calls, no database, no request logs. Responses are small and fast, and hostnames are processed without storing them.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | /parse | Parse an ASCII hostname against the Public Suffix List: labels, public suffix, registrable domain (eTLD+1), subdomain and ICANN/PRIVATE section. |
GET | /idn | Decode or encode a domain in one call: accepts punycode or Unicode, returns both forms. |
GET | /to-punycode | Convert a Unicode domain to its ASCII/punycode form, ready for /parse or for DNS. |
Quick start
curl -X GET "https://domain.p.rapidapi.com/parse?domain=shop.example.co.uk" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: domain.p.rapidapi.com"
FAQ
How many requests can I make, and is there a rate limit?
Free gives 1,000 calls per month at up to 1,000 per hour; Pro gives 20,000/month at 5,000/hour; Ultra gives 200,000/month at 20,000/hour.
Do you log or store the domains I send?
No. The service is stateless: the Public Suffix List is bundled into the image, there is no database and no request logging, and nothing is retained between calls.
Why does `/parse` return 422 for `пример.рф`?
`/parse` works on ASCII hostnames only. Call `/to-punycode` (or `/idn`) first and pass the resulting `xn--…` form. The 422 body contains that hint.
Why is `registrable_domain` null for some hosts?
Under strict PSL rules a hostname that is itself a public suffix, or a single-label host like `localhost`, has no registrable domain. That is correct behaviour, not an error.
Try Domain Parser Public Suffix List eTLD 1 IDN free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI