Whois API
The Whois API retrieves domain registration information for any given domain using the WHOIS protocol.
For basic domain availability information, check out our Domain API instead.
From 5,265 users
Applications using this API
API Status
API Response Times
Average | P50 | P75 | P90 | P95 |
|---|---|---|---|---|
| 397ms | 423ms | 473ms | 853ms | 1232ms |
Similar APIs
Didn't find what you were looking for? Suggest an improvement
https://api.api-ninjas.com/v1/whois
Returns domain registration details (e.g. registrar, contact information, expiration date, name servers) for a given domain name.
Parameters
domainrequiredValid domain to check (e.g.
example.com). For top-level domains other than .com, a premium subscription is required.
Headers
X-Api-KeyrequiredAPI Key associated with your account.
Response
A JSON object with the following fields or an error if the request is unsuccessful. The exact set of fields returned varies by the domain's TLD and registrar — some fields below may be absent for a given domain, and some TLDs return additional fields such as emails.
domain_nameThe domain name that was queried.
registrarName of the domain registrar.
registrar_urlURL of the domain registrar. Not returned for all TLDs.
whois_serverWHOIS server used for the query. Not returned for all TLDs.
updated_dateUnix timestamp of when the domain was last updated.
creation_dateUnix timestamp of when the domain was created.
expiration_dateUnix timestamp of when the domain expires.
name_serversArray of name server hostnames.
dnssecDNSSEC status (e.g.,
signeddelegation).emailsContact email(s) from the WHOIS record. Returned only for some TLDs (e.g.
.org); not present for.com.is_euWhether the registrant country is an EU member state.
nullwhen the registrant country is not published — most registrars redact it, so this is unset for the majority of domains.is_eeaWhether the registrant country is in the European Economic Area.
nullwhen the registrant country is not published.is_sepaWhether the registrant country is in the Single Euro Payments Area.
nullwhen the registrant country is not published.registrant_privacyPremium onlyWhether the registrant's identity is hidden.
falsewhen a real registrant is published,truewhen the record is redacted or a privacy service stands in, andnullwhen no registrant record could be retrieved at all. This is the most useful field for checking whether a domain is owned by who you expect — a "hidden" answer is itself a signal.registrant_orgPremium onlyThe organisation that owns the domain, in its original casing (e.g.
Google LLC). Absent when the registrant is not published, or when a privacy service stands in — seeprivacy_service.privacy_servicePremium onlyName of the privacy or proxy provider standing in for the registrant, when one can be identified (e.g.
Domains By Proxy, LLC,Withheld for Privacy ehf). Absent when the registrar simply redacted the record without naming a provider. Note that several of these read like ordinary companies —DNStination Inc.andDomain Protection Services, Inc.are privacy services, not owners.registrant_countryPremium onlyRegistrant country as an ISO 3166-1 alpha-2 code (e.g.
US). Absent wheneverprivacy_serviceis set, because that address belongs to the privacy provider rather than to the registrant. Still returned for plainly redacted records, where registrars continue to publish the real country under ICANN policy.registrant_statePremium onlyRegistrant state or province (e.g.
CA). Absent wheneverprivacy_serviceis set, for the same reason asregistrant_country.registrant_namePremium onlyThe individual registrant's name. Rarely present: redaction of natural-person contact details is effectively universal post-GDPR, and this field was absent for every domain in our testing. Use
registrant_organdregistrant_privacyinstead; do not build on this field being returned.
Live Demo
Code Examples
curl -X GET "https://api.api-ninjas.com/v1/whois?domain=example.com" \
-H "X-Api-Key: YOUR_API_KEY"If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Frequently Asked Questions
Can I use the Whois API for commercial purposes?
Yes, but you must have a premium subscription. Commercial use of the Whois API is not permitted on the free tier. See our pricing page to choose a plan that fits your needs.How do I get an API key and start using the Whois API?
Sign up for a free account to instantly get your API key, then pass it in theX-Api-Keyheader on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.What happens if I exceed my quota for the month?
Your API requests will simply be denied once you hit your monthly quota — you will never be charged more than the plan you signed up for. To increase your quota, you can upgrade your plan any time on our pricing page.What happens if a request to the Whois API fails?
The API responds with a standard HTTP status code and a JSON error message describing the problem. See our error codes reference for the full list of codes and how to resolve each one, or contact support if you need help.What information does the Whois API return for a domain?
A single GET request to/v1/whoisreturns a JSON object with the domain'sregistrar,whois_server,name_serversarray,dnssecstatus, and Unix timestamps forcreation_date,updated_date, andexpiration_date. If the lookup is unsuccessful you'll receive an error instead, as described in our error codes reference.How do I look up a specific domain with the Whois API?
Pass the domain you want to check in the requireddomainquery parameter, for exampledomain=example.com. Note that domains with top-level domains other than .com require a premium subscription.What are some use cases for the Whois API?
You can use theregistrarandexpiration_datefields to monitor domain ownership and upcoming renewals, verify a domain'screation_datefor trust and fraud checks, or auditname_serversanddnssecconfiguration. For complementary domain data, pair it with the DNS Lookup API or the Domain API for availability.How is the Whois API different from the Domain API?
The Whois API retrieves registry details such asregistrar,name_servers, and registration dates via the WHOIS protocol, whereas the Domain API is geared toward basic domain availability. You can also explore related tools like the URL Lookup and MX Lookup APIs.
Explore API integration use cases for recommended APIs and workflow examples.