NewConnect Claude, Gemini, ChatGPT, and other AI agents to API Ninjas via our MCP server

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.

(4.2)

From 5,265 users

1,000+

Applications using this API

API Status

Online - All Systems Operational

API Response Times

Average
P50
P75
P90
P95
397ms423ms473ms853ms1232ms

Didn't find what you were looking for? Suggest an improvement


/v1/whois GET

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

  • domain  required

    Valid domain to check (e.g. example.com). For top-level domains other than .com, a premium subscription is required.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Response

A JSON object with the following fields or an error if the request is unsuccessful.

  • domain

    The domain name that was queried.

  • registrar

    Name of the domain registrar.

  • whois_server

    WHOIS server used for the query.

  • updated_date

    Unix timestamp of when the domain was last updated.

  • creation_date

    Unix timestamp of when the domain was created.

  • expiration_date

    Unix timestamp of when the domain expires.

  • name_servers

    Array of name server hostnames.

  • dnssec

    DNSSEC status (e.g., signeddelegation).

Sample Request Live Demo!

domain

Try this endpoint live with a free API key

Instant access — no credit card required.

https://api.api-ninjas.com/v1/whois?domain=example.com

Headers

X-Api-KeyLog in or sign up to get your API Key

Sample Response

JSON
{
    domain_name:"example.com",
    registrar:"reserved-internet assigned numbers authority",
    whois_server:"whois.iana.org",
    updated_date:1628924504,
    creation_date:808372800,
    expiration_date:1660363200,
    name_servers:[
      "a.iana-servers.net",
      "b.iana-servers.net"
    ],
    dnssec:"signeddelegation"
}

Code Examples

1 2 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

  • 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.
  • Sign up for a free account to instantly get your API key, then pass it in the X-Api-Key header on every request. The documentation above includes ready-to-run examples in cURL, Python, JavaScript, Node.js, and more.
  • 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.
  • 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.
  • A single GET request to /v1/whois returns a JSON object with the domain's registrar, whois_server, name_servers array, dnssec status, and Unix timestamps for creation_date, updated_date, and expiration_date. If the lookup is unsuccessful you'll receive an error instead, as described in our error codes reference.
  • Pass the domain you want to check in the required domain query parameter, for example domain=example.com. Note that domains with top-level domains other than .com require a premium subscription.
  • You can use the registrar and expiration_date fields to monitor domain ownership and upcoming renewals, verify a domain's creation_date for trust and fraud checks, or audit name_servers and dnssec configuration. For complementary domain data, pair it with the DNS Lookup API or the Domain API for availability.
  • The Whois API retrieves registry details such as registrar, 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.