Skip to content
Identification & Data Lookup

WHOIS Lookup

The WHOIS API returns parsed fields for a domain or IP range: registrar, dates, status, nameservers and the raw registry text when parsing fails.

GET https://api2.globus.studio/v2/whois

Reference

Parameters

Name Type Required Description
ip string one of ip/domain/query IP address.
domain string one of ip/domain/query Domain name.
query string alias Auto-detects IP or domain.

Example request

curl -s "https://api2.globus.studio/v2/whois?domain=example.com"
Open documentation

WHOIS API

The WHOIS API returns registry data as a key and value object. A domain query starts at the TLD registry and follows the referral to the registrar. An IP query starts at IANA and follows the referral to the network owner. The response also keeps the raw text for fields the parser does not recognise.

What the WHOIS API returns

A domain response carries the domain name, the registrar, the creation date, the expiry date, the status flags and the nameservers. An IP response carries the network, the organisation and the country. Missing fields are omitted rather than filled with a guess.

{
  "domain": "example.com",
  "whois": {
    "Domain Name": "EXAMPLE.COM",
    "Creation Date": "1995-08-14T04:00:00Z",
    "Name Server": ["A.IANA-SERVERS.NET", "B.IANA-SERVERS.NET"]
  }
}

IP lookups use the ip key instead of domain. Invalid input returns {"error":true,"message":"Invalid IP address or domain name"}.

Domain and IP queries

Pass a domain to learn who registered it and when it expires. Pass a public IP address to learn which network owns it. A private address has no registry record. A domain with a country-code TLD may answer in a local format, and a registry may redact the registrant.

Referrals and timeouts

WHOIS uses TCP port 43 with a five-second timeout. Some registries rate-limit or block the server address. When that happens the endpoint returns an Error: value inside whois, and the call did not produce registry data. Treat it as a temporary failure, not as a missing domain.

Dates and status flags

Creation and expiry dates are strings in registry format. Parse them with a date library and store them as dates. Status flags are not consistent across registries: a domain can be on hold, pending transfer or client transfer prohibited. An unknown flag stays unknown, because guessing a status can hide a real problem.

Redaction and privacy

Many registries redact registrant data. You will see a proxy service or a redacted string, and that is the correct answer. The WHOIS API does not work around the redaction. Use the field for contact routing only when the registry says it belongs to the registrant, not to a privacy proxy.

Caching and limits

Successful responses are cached for one hour. The query waits for the registry, so it is slower than a local lookup, and some registries restrict automated use. Do not use it to build a copy of the registry. Use it for a specific check such as expiry monitoring or an abuse investigation.

When to use the WHOIS API

A security team can watch the expiry date of its own domains. A support tool can show the registrar when a customer cannot change nameservers. An abuse team can check the network owner for an address. The WHOIS guide covers parsing, redaction and monitoring in more detail.

Fields by registry

A WHOIS API response follows the registry, not one shared schema. A generic top-level domain usually returns the registrar, the creation and expiry dates, the status flags and the nameservers. A country-code domain may return a local date format, a different set of flags and a registrant field that the registry chooses to publish.

An IP WHOIS API response carries the network, the organisation and the country. The abuse contact can be a role address rather than a person. Treat an empty field as missing data, not as a negative answer, and keep the raw text when the parsed object is thin.

Automating an expiry check

A monitoring job can call the WHOIS API once a day for the domains you own. Parse the expiry date, store it as a timestamp and alert when it falls inside the renewal window. A WHOIS API call that returns an error should not overwrite the last known date; keep the previous value and raise a separate alert for the failed check.

$data = json_decode(file_get_contents(
    'https://api2.globus.studio/v2/whois?query=' . urlencode($domain),
), true);

When the registry does not answer

A WHOIS API call can fail because the registry times out, blocks the server address or rate-limits the query. The response then carries an Error: value inside whois. Retry later, and do not treat the domain as expired. The WHOIS API reports what the registry said, including a refusal.

Reading a WHOIS record

Start with the registrar and the expiry date. A domain that expires in a month is worth a renewal ticket even when every other field looks normal. Then check the nameservers against the ones you expect. A change you did not make is a security event. Finally, read the status flags. A hold or a pending transfer explains why a change did not apply.

For an IP range, start with the network and the organisation. The country helps route an abuse report. The raw text stays useful when a registry adds a field that the parser does not know yet. Keep the parsed values for logic and the raw text for support.

Caching and repeated checks

Registry data changes slowly. Cache the WHOIS API response for an hour and store the parsed fields you need. A monitoring job that checks a thousand domains does not need a fresh query for each one on every run. Spread the checks over the day and keep the last known good value.

A WHOIS API result that has not changed for a month is still worth a check, because a missing renewal is easy to spot and expensive to fix. Keep the date of the last successful query next to the expiry date so a failed run is visible in the report.

A WHOIS API record is a snapshot of a registry at one moment. Treat it as evidence, not as a live feed. A domain that changes nameservers today may still show the old value in a cached response, and the next query will show the change.

For the address itself, use the IP geolocation API. If the domain sends mail, run the DNS blacklists check on the address before you trust it.

Further reading: RFC 3912, WHOIS Protocol.

Custom work

Need an API that does not exist yet?

Describe the task and the response format. We will estimate the endpoint, the integration and the maintenance.

Start a conversation