Provide current and historical ownership information on domains / IPs. Identify all connections between domains, registrants, registrars, and DNS servers.
WhoisXML API has released a Python script that tells you whether a domain’s top-level domain (TLD) (including multi-level TLDs like .co.uk) supports RDAP, WHOIS, both protocols, or neither, based on a reference TLD dataset.
The script is useful for anyone performing programmatic WHOIS lookups who wants to know in advance which protocol a TLD responds to. It works in two modes and requires a TLD reference CSV (which you can get from rdap.wxapros.com) as its first input:
- Single-domain mode: The script output has three data points — the domain, its TLD, and the protocol(s) supported.
- Batch mode: It reads a CSV file of domain names and writes the results to standard output (stdout) using the same data points (domain, TLD, protocol), making it easy to pipe results into downstream tools or workflows.
Knowing which protocol a TLD uses helps users set the rdap parameter correctly in their WhoisXML API calls, where 0 means auto-detect, 1 forces RDAP, and 2 forces WHOIS.
For more information about our scripts or to submit a script idea that suits your needs, please contact [email protected].
How the Script Can Help WhoisXML API Users
In response to the sunsetting of WHOIS port 43, WhoisXML API enhanced its WHOIS API with RDAP-ready features. With WHOIS API, you can either rely on automatic protocol selection or force a specific protocol using the rdap parameter.
However, RDAP support across TLDs remains uneven. As of May 5, 2026, WhoisXML API’s TLD RDAP Monitor detected that 59.8% of TLDs support both WHOIS and RDAP, while 23.1% support only RDAP. It’s also worth noting that TLDs that support both WHOIS and RDAP may return different data via different protocols, with requests over WHOIS often returning more details than those over RDAP.
Without checking first, users who force RDAP or rely on WHOIS-only workflows risk getting empty or incomplete results, with no clear indication why, leading to gaps in bulk workflows.
With the help of this script, WhoisXML API users can:
- Audit TLD coverage before building pipelines. Run your full domain list through the script to see which TLDs support which protocol. Domains that return
NO_DATAmay need a fallback strategy. - Catch RDAP-only TLDs early. Some newer gTLDs no longer respond to WHOIS queries on port 43. If your code sends WHOIS requests by default, those lookups may come back empty. The script flags those TLDs so you can adjust.
- Process domains at scale. Batch mode accepts a single-column CSV of domain names and prints results directly to the command line, so it fits into existing workflows without extra setup.
Access the latest version of the script on GitHub.