API Documentation

v1.5

Next Whois provides a simple REST API for programmatic WHOIS/RDAP lookups and dynamic OG image generation. All endpoints are publicly accessible and require no authentication.

GET
/api/lookup

Query WHOIS/RDAP information for a domain, IP address, ASN, or CIDR range. RDAP and WHOIS are queried in parallel; structured fields prefer RDAP data, falling back to WHOIS. Both raw responses are included.

Parameters

ParameterTypeRequiredDefaultDescription
querystring
Required
—Domain name, IPv4/IPv6 address, ASN (e.g. AS13335), or CIDR range. Alias: q

Example Request

curl "https://your-domain.com/api/lookup?query=google.com"

Success Response

{
"status": true,
"time": 1.23,
"cached": false,
"source": "rdap",
"result": {
"domain": "google.com",
"registrar": "MarkMonitor Inc.",
"registrarURL": "http://www.markmonitor.com",
"ianaId": "292",
"whoisServer": "whois.markmonitor.com",
"creationDate": "1997-09-15T04:00:00Z",
"expirationDate": "2028-09-14T04:00:00Z",
"updatedDate": "2019-09-09T15:39:04Z",
"status": [
{ "status": "clientDeleteProhibited", "url": "..." },
{ "status": "clientTransferProhibited", "url": "..." }
],
"nameServers": ["ns1.google.com", "ns2.google.com", "ns3.google.com", "ns4.google.com"],
"dnssec": "unsigned",
"domainAge": 28,
"remainingDays": 945,
"rawWhoisContent": "Domain Name: GOOGLE.COM\nRegistry Domain ID: ...",
"rawRdapContent": "{\n \"objectClassName\": \"domain\",\n ...\n}"
}
}

Error Response

{
"status": false,
"time": 0.45,
"error": "No match for domain "EXAMPLE.INVALID""
}
GET
/api/og

Generate a dynamic Open Graph image with WHOIS details. Internally queries /api/lookup and renders a card-style summary. Returns a PNG image.

Parameters

ParameterTypeRequiredDefaultDescription
querystring
Optional
—Domain name, IP, ASN, or CIDR to look up and display. Alias: q
wnumber
Optional
1200Image width in pixels (200-4096)
hnumber
Optional
630Image height in pixels (200-4096)
themestring
Optional
lightColor theme: "light" or "dark"

Example Request

curl "https://your-domain.com/api/og?query=google.com&theme=dark" -o og.png

Preview

OG Image Preview

/api/og?query=google.com

Rate Limiting & Caching

Successful WHOIS lookup responses are cached server-side (Redis) and served with Cache-Control: s-maxage=3600, stale-while-revalidate=86400 headers.

Cached responses include "cached": true in the JSON body and report "time": 0.

Next Whois v1.5 · GitHub