# WHOIS Domain Lookup API - RDAP, DNS, MX, TXT, Expiry (`stas_k/whois-domain-lookup-api`) Actor

Most WHOIS actors charge for rows the registry never answered: a name, a null registrar, null dates. Here a row either carries the registry answer or says in plain words why there is none, and that row costs nothing.

- **URL**: https://apify.com/stas_k/whois-domain-lookup-api.md
- **Developed by:** [Stas K](https://apify.com/stas_k) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 domains

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## WHOIS Domain Lookup API - RDAP, DNS, MX, TXT, Expiry

A WHOIS actor is usually judged on the day a registry rate-limits it. The run comes back green, the
dataset is full of rows, and half of them say nothing: a name, a null registrar, a null creation
date. The buyer pays for that. This actor is built the other way round: a row either carries the
registry answer, or it says in plain words why there is no answer, and that row costs nothing.

One run takes a list of domains and returns, per domain:

- registration, expiry and last-change dates, and the domain age in whole days;
- registrar name when the registry publishes it;
- EPP statuses (client transfer prohibited and the like) and nameservers;
- whether DNSSEC is signed;
- DNS records: nameservers, MX with priorities, TXT, the SPF record, the DMARC record and its `p=`
  policy, plus the resolver that answered.

Data comes from RDAP, the open replacement for port 43 WHOIS: the IANA bootstrap file maps each TLD
to its own registry. No key, no proxy, no paid middleman.

### What a run looks like

Input:

```json
{
  "domains": ["example.com", "google.io", "google.de", "this-name-is-free-xz9q.com", "https://www.apify.com/pricing"],
  "includeDns": true,
  "maxDomains": 50
}
```

A link or an email is accepted: only the host is looked up, so `https://www.apify.com/pricing`
becomes `apify.com`. `www.` is dropped, because it is the same registration.

Output, one row per domain (real values from a run on 2026-11-09):

```json
{
  "domain": "openai.com",
  "status": "REGISTERED",
  "registered": true,
  "registrar": "MarkMonitor Inc.",
  "createdAt": "2007-01-19T19:28:24Z",
  "expiresAt": "2029-01-19T19:28:24Z",
  "ageDays": 7233,
  "daysUntilExpiry": 802,
  "statuses": ["client delete prohibited", "client transfer prohibited"],
  "nameservers": ["ns1-02.azure-dns.com", "ns2-02.azure-dns.net"],
  "dnssecSigned": false,
  "dns": {
    "mx": [{"preference": 1, "exchange": "aspmx.l.google.com"}],
    "spf": "v=spf1 include:_spf.google.com ~all",
    "dmarc": "v=DMARC1; p=reject",
    "dmarcPolicy": "reject",
    "resolver": "system"
  },
  "billable": true
}
```

### Statuses

| status | meaning | charged |
|---|---|---|
| `REGISTERED` | the registry returned a record | yes |
| `AVAILABLE` | the registry answered 404: the name is not registered | yes |
| `NOT_CHECKED_NO_RDAP` | this TLD has no public RDAP service (for example .co, .eu, .ru); DNS records are still returned | no |
| `NOT_CHECKED_SOURCE` | the registry did not answer or answered with an error | no |
| `NOT_CHECKED_INVALID` | the line is not a domain, with the reason | no |
| `NOT_CHECKED_DUPLICATE` | the same domain came earlier in the list | no |
| `NOT_CHECKED_LIMIT` | beyond `maxDomains` | no |
| `NOT_CHECKED_TIME` | the run was close to the platform deadline; send it in a second run | no |
| `NOT_CHECKED_CAP` | the spending cap of this run was reached | no |
| `NOT_CHECKED_BILLING` | the run already knew it could not bill | no |
| `NOT_CHECKED_ERROR` | the dataset refused the row after a retry | no |

`registered` is `true`, `false` or `null`, and `null` never means `false`: it means the registry was
not read. `AVAILABLE` is the only `false`, and it comes from a registry 404, never from a timeout.

### Price

`domain-checked` is charged per row that carries a registry answer: a registered domain, or a
registry saying the name is free. A TLD without RDAP, an unread registry, a bad line, a repeated
line and the tail cut by `maxDomains` are all free and say so in `status` and `reason`.

The run summary (in the key-value store as `RUN_SUMMARY`, and in the named store
`whois-domain-lookup-summary` under `RUN_SUMMARY-<runId>`) reports `chargedEvents`, `byStatus`,
`deliveredUncharged` and `stopReason`, so the bill can be checked against the dataset row by row.

### Limits, honestly

- **RDAP coverage.** The IANA bootstrap file listed 1203 TLDs when this was written. Four more have
  RDAP outside it and are mapped by hand, each measured on a registered name: `.io`, `.me` (Identity
  Digital), `.us` and `.de` (thin: no registrar, no creation date). A TLD outside both lists has no
  public RDAP service, and this actor does not fall back to guessing.
- **Rate limits.** One registry is one host, and requests to it are spaced. A 429 is retried once
  with a short pause; a second failure becomes `NOT_CHECKED_SOURCE` for that domain and the run reads
  on.
- **`maxDomains`** defaults to 50. The list beyond it is not dropped: it comes back as
  `NOT_CHECKED_LIMIT` rows with their own line in `input`, so the buyer sees the whole list.
- **Platform deadline.** The actor reads `ACTOR_TIMEOUT_AT` and stops starting new lookups 10 seconds
  before the platform kills the run, marking the rest `NOT_CHECKED_TIME` instead of dying silently.
- **Personal data.** Registrant names, addresses and emails are not collected, and none of it is
  asked for. Registries redact most of it anyway; a country code is returned only when the registry
  publishes it.

### What this actor does not do

- It does not say whether a premium or reserved name is for sale: `AVAILABLE` means "not registered",
  not "you can buy it at the standard price".
- It does not value a domain, score its history, or read the Wayback Machine.
- It does not use port 43 WHOIS: registries are moving to RDAP, and a port 43 path would be a second
  source of half-answers.
- It does not hide a failure inside an empty row. If nothing could be read at all, the run ends with
  a failed status and a sentence naming every status that came back.

### Run it locally

```bash
pip install -r requirements.txt
APIFY_LOCAL_STORAGE_DIR=./storage python -m src.main
```

Tests: `python tests/test_domain.py`, `python tests/test_rdap.py`, `python tests/test_dnsrec.py`,
`python tests/test_main.py`. They run without network: the RDAP fixtures are real registry answers
captured on 2026-11-09.

# Actor input Schema

## `domains` (type: `array`):

One domain per line. A full link or an email is accepted and only the host is looked up, so https://www.example.com/pricing becomes example.com. Up to 100 domains per run.

## `includeDns` (type: `boolean`):

Adds NS, MX, TXT, SPF and DMARC to every domain that has registry data, plus the resolver that answered. Turn it off when only the registration facts are needed: it makes a run faster.

## `maxDomains` (type: `integer`):

The list is cut here. Domains beyond the limit come back as rows with status NOT_CHECKED_LIMIT, their own line in input, and are not charged. 0 means no limit, and the summary reports the number actually applied.

## Actor input object example

```json
{
  "domains": [
    "google.com",
    "apify.com",
    "this-domain-does-not-exist-xz9q.com"
  ],
  "includeDns": true,
  "maxDomains": 50
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per domain. status is REGISTERED, AVAILABLE (the registry says the name is not registered), or NOT_CHECKED\_\* with the reason written in plain words: NO_RDAP (this TLD has no registry API), SOURCE (the registry did not answer), INVALID (the line is not a domain), DUPLICATE (the same domain came earlier), LIMIT (beyond maxDomains), TIME (the run was close to the platform deadline), CAP (the spending cap was reached), BILLING (the run could not bill), ERROR (the dataset refused the row after a retry). registered is true, false or null and null never means false. createdAt, expiresAt, updatedAt are the registry dates as written, ageDays and daysUntilExpiry are derived from them and stay null when the registry does not publish that date (the .de registry publishes only a change date). billable is true only on a row with a delivered registry answer; the money actually taken is in the run summary. dns carries nameservers, mx, txt, spf, dmarc and dmarcPolicy, and dnsResolver names the resolver that answered (system, 8.8.8.8 or 1.1.1.1) so an empty record list is never confused with a closed resolver.

## `summary` (type: `string`):

Run summary. requested is how many lines were sent, uniqueDomains how many different domains they held, duplicates how many lines repeated a domain, processed plus notChecked always equals requested, delivered counts REGISTERED and AVAILABLE rows, rowsDelivered counts every row written, chargedEvents is what the platform actually charged, billingActive says whether this run could bill at all, stopReason is null, spending-cap, charge-error or dataset-write-error. byStatus is the full breakdown. cutByMaxDomains is the tail the limit cut, maxDomains the limit actually applied. deliveredUncharged counts rows delivered without money: the charge call failed, the platform charged nothing, or the run knew it could not bill. datasetItemCount is our own count of written rows, datasetItemCountApi the same number as the platform reported it, and datasetItemCountLag says the platform number was behind. rdapBootstrapTlds is how many TLDs the IANA bootstrap mapped in this run, deadlineCapped says the platform deadline stopped the list early. The named store keeps one object per run under RUN_SUMMARY-<runId>.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "google.com",
        "apify.com",
        "this-domain-does-not-exist-xz9q.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("stas_k/whois-domain-lookup-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "google.com",
        "apify.com",
        "this-domain-does-not-exist-xz9q.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("stas_k/whois-domain-lookup-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "google.com",
    "apify.com",
    "this-domain-does-not-exist-xz9q.com"
  ]
}' |
apify call stas_k/whois-domain-lookup-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stas_k/whois-domain-lookup-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SCelABxa2afrgeeoO/builds/Oimeq6IEiBknZVG4t/openapi.json
