DEV Community

Alexey D
Alexey D

Posted on

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

Need to know who owns a domain or when it expires? One API call gives you everything.

Domain WHOIS Lookup API

import requests

r = requests.post(
    "https://domainwhoislookup.p.rapidapi.com/whois",
    json={"domain": "github.com"},
    headers={"X-RapidAPI-Key": "YOUR_KEY", "Content-Type": "application/json"}
)
print(r.json())
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "domain": "github.com",
  "registrar": "MarkMonitor, Inc.",
  "creation_date": "2007-10-09T18:20:50",
  "expiration_date": "2026-10-09T18:20:50",
  "days_until_expiry": 157,
  "name_servers": ["ns1.p16.dynect.net"],
  "ip_address": "140.82.113.4",
  "is_expired": false,
  "org": "GitHub, Inc.",
  "country": "US"
}
Enter fullscreen mode Exit fullscreen mode

Monitor domain expiry

def check_expiry(domain):
    r = requests.post(
        "https://domainwhoislookup.p.rapidapi.com/whois",
        json={"domain": domain},
        headers={"X-RapidAPI-Key": "YOUR_KEY", "Content-Type": "application/json"}
    )
    days = r.json().get("days_until_expiry", 999)
    if days < 30:
        print(f"WARNING: {domain} expires in {days} days!")

check_expiry("yourdomain.com")
Enter fullscreen mode Exit fullscreen mode

JavaScript example

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

Use cases

  • Domain investors — monitor expiring domains for acquisition
  • SEO tools — check domain age (older = more SEO authority)
  • Security — flag newly registered domains (phishing risk)
  • SaaS platforms — validate custom domains before onboarding
  • Monitoring — get alerted before your own domains expire

Pricing

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

Domain WHOIS Lookup on RapidAPI — full data in under 2 seconds.

Top comments (0)