DEV Community

Alexey D
Alexey D

Posted on

Domain WHOIS API: Get Registration, Expiry and Ownership Data in One Call

Domain WHOIS data is essential for many workflows: checking domain expiry before renewal, detecting ownership changes, finding nameservers, or monitoring competitor domains.

Most WHOIS lookups require command-line tools, manual queries, or expensive services. I built Domain WHOIS Lookup API — a simple REST endpoint that returns structured WHOIS data for any domain.

What it returns

Single POST request gives you:

  • Registrar — who registered the domain
  • Creation date — when the domain was registered
  • Expiry date — when it expires (with days-until-expiry counter)
  • Updated date — last update timestamp
  • Nameservers — DNS servers pointing to domain's host
  • Country — registrant country
  • IP address — resolved IP of the domain
  • Status codes — registration status (locked, active, etc)
  • Organization — registrant organization name

Quick start

Python

import requests

url = "https://domain-whois-lookup.p.rapidapi.com/whois"
headers = {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
}
payload = {"domain": "github.com"}

r = requests.post(url, json=payload, headers=headers)
print(r.json())
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "domain": "github.com",
  "registrar": "MarkMonitor, Inc.",
  "creation_date": "2007-10-09T18:20:50+00:00",
  "expiration_date": "2026-10-09T18:20:50+00:00",
  "days_until_expiry": 158,
  "name_servers": ["ns-1234.awsdns-12.com", ...],
  "country": "US",
  "org": "GitHub, Inc.",
  "ip_address": "140.82.113.4",
  "is_expired": false
}
Enter fullscreen mode Exit fullscreen mode

JavaScript

const response = await fetch("https://domain-whois-lookup.p.rapidapi.com/whois", {
  method: "POST",
  headers: {
    "X-RapidAPI-Key": "YOUR_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ domain: "example.com" })
});
const data = await response.json();
console.log(`Domain expires in ${data.days_until_expiry} days`);
Enter fullscreen mode Exit fullscreen mode

Use cases

  • Domain monitoring — track expiry dates for your portfolio
  • OSINT — research domain ownership and nameserver changes
  • Competitor analysis — monitor when competitors renew domains
  • Bulk audits — check 100s of domains for expiry or status changes
  • Infrastructure audits — verify nameserver configs automatically
  • Security — detect domain hijacking (sudden IP/nameserver changes)

Real example

Monitor your company domains and get alerted before expiry:

import requests
from datetime import datetime

domains = ["mycompany.com", "myproduct.io", "backup.net"]

for domain in domains:
    r = requests.post(url, json={"domain": domain}, headers=headers)
    data = r.json()

    if data["days_until_expiry"] < 30:
        print(f"⚠️ {domain} expires in {data['days_until_expiry']} days!")
    else:
        print(f"{domain} - {data['days_until_expiry']} days remaining")
Enter fullscreen mode Exit fullscreen mode

Pricing

Plan Price Rate limit
BASIC Free 50 req/hr
PRO $9.99/mo 1,000 req/hr
ULTRA $29.99/mo 10,000 req/hr

Try it

Domain WHOIS Lookup on RapidAPI

Free tier, no credit card required. Perfect for domain portfolios, SEO agencies, and security teams.


Built this because checking WHOIS data was scattered across multiple tools and services. One API call covers everything.

Questions? Use cases? Let me know in the comments.

Top comments (0)