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.
/api/lookupQuery 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | 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""}/api/ogGenerate a dynamic Open Graph image with WHOIS details. Internally queries /api/lookup and renders a card-style summary. Returns a PNG image.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | Optional | — | Domain name, IP, ASN, or CIDR to look up and display. Alias: q |
| w | number | Optional | 1200 | Image width in pixels (200-4096) |
| h | number | Optional | 630 | Image height in pixels (200-4096) |
| theme | string | Optional | light | Color theme: "light" or "dark" |
Example Request
curl "https://your-domain.com/api/og?query=google.com&theme=dark" -o og.pngPreview
/api/og?query=google.com
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