# Domain Expiry Monitor — RDAP Expiration, DNS & Registrar Alerts (`openregistry/domain-expiry-watch`) Actor

Schedule it and get alerted before your domains expire, and when name servers, MX records, registrar or registry status change. Official RDAP (IANA bootstrap) and DNS-over-HTTPS. Slack, Discord or webhook alerts. Only new alerts each run.

- **URL**: https://apify.com/openregistry/domain-expiry-watch.md
- **Developed by:** [Mahé Perrin](https://apify.com/openregistry) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 alert delivereds

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

## Domain Expiry Monitor — RDAP Expiration, DNS & Registrar Alerts

Never lose a domain to a forgotten renewal again. Give this Actor your list of domains, **schedule it**, and it tells you **only what is new** since its previous run:

- a domain **expires within N days** (once per expiry date), has **expired**, or was **renewed**;
- its **name servers**, **MX records** or **registrar** changed (hijack, unplanned migration, broken e-mail);
- its **registry status** changed (`client hold`, transfer lock removed…);
- a domain you want became **no longer registered** — or one you watch got **registered**.

Alerts can go straight to **Slack**, **Discord** or any **webhook** (Zapier, Make, n8n, your server).

Data comes from the official sources only: **RDAP**, the registry protocol that replaces WHOIS (registry servers found through the IANA bootstrap file `data.iana.org/rdap/dns.json`), and DNS-over-HTTPS (Google Public DNS or Cloudflare). No WHOIS page scraping, no proxy, no API key. No owner contact data is collected.

### How to schedule it

1. Paste your domains and give the watchlist a **name** (for example `company-domains`) so its memory survives edits to the list.
2. Set the expiry threshold (default 30 days). Optional: paste a Slack incoming-webhook URL or any webhook in **Alert URL**.
3. Run it once. Each domain gets a free **baseline** row (registrar, expiry, name servers, MX). Domains already inside the threshold raise an `expiring_soon` alert right away.
4. In Apify Console → **Schedules → Create new**, choose this Actor and the same input. Daily (`0 6 * * *`) is plenty; weekly works too.

Each run compares with the previous one and returns only new alerts. Nothing new → empty dataset, no message (unless you turn on the heartbeat). The memory lives in a named key-value store of your own account, `domain-expiry-watch-state`; delete its record to start over.

### Example alert

Slack message:

```
Domain watch: 3 alert(s) on 120 domains
• shop-example.com: expires in 21 day(s) (2026-12-07)
• example.io: name servers changed: ns1.oldhost.net, ns2.oldhost.net → dana.ns.cloudflare.com, rob.ns.cloudflare.com
• example.fr: MX records changed: 10 mx1.mail.example.net → none
```

Dataset row:

```json
{
  "domain": "shop-example.com",
  "alertType": "expiring_soon",
  "message": "expires in 21 day(s) (2026-12-07)",
  "after": "2026-12-07T04:00:00Z",
  "registrar": "Example Registrar, Inc.",
  "expiresAt": "2026-12-07T04:00:00Z",
  "daysUntilExpiry": 21,
  "detectedAt": "2026-11-16T06:00:04.120Z",
  "previousCheckAt": "2026-11-15T06:00:03.871Z",
  "rdapUrl": "https://rdap.verisign.com/com/v1/domain/shop-example.com",
  "errors": []
}
```

Other webhooks receive `{ source, title, count, generatedAt, runUrl, items: [ ...rows ] }`.

### Pricing

Pay per event:

- **$0.0005 per domain checked** (100 domains checked daily ≈ $1.50 a month),
- **$0.005 per alert delivered**.

Baseline rows and domains that could not be reached at all are not charged. Set a maximum charge per run for a hard cap: the run stops cleanly and the unchecked domains keep their previous state.

### Honest limits

- Some country-code registries do not publish RDAP (or publish no expiry date, for example several European ccTLDs). For those, expiry alerts are impossible; name server, MX and availability changes still work through DNS. The baseline row shows `rdapAvailable` and `expiresAt` so you know at once.
- If a source is down during a run, its previous values are kept and no false alert is raised; the domain is re-checked next run.
- Name servers are compared on the registry's RDAP list when available, otherwise on DNS.
- Expiry dates are the registry's; your registrar may auto-renew a few days before or after.

# Actor input Schema

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

Domain names (example.com). Web addresses and e-mail addresses are reduced to their domain; subdomains to the registered domain. Up to 5,000 per watchlist.

## `watchlistName` (type: `string`):

Recommended for schedules. The memory of the previous run is stored under this name, so you can edit the list without losing it. Leave empty and the memory is tied to the exact input.

## `expiryThresholdDays` (type: `integer`):

An 'expiring_soon' alert is sent once per expiry date when the domain expires within this many days (also on the first run).

## `watch` (type: `array`):

Leave empty to watch everything.

## `webhookUrl` (type: `string`):

Optional. When there is a new alert, the run POSTs a JSON message to this URL: a readable summary for Slack incoming webhooks and Discord webhooks, the full alert list for any other URL (Zapier, Make, n8n, your server).

## `notifyWhenNothingNew` (type: `boolean`):

Send a short 'no alert' message after each run (a heartbeat).

## `emitBaseline` (type: `boolean`):

The first time a domain is checked, a free 'baseline' row shows its registrar, expiry, name servers and MX.

## `dnsResolver` (type: `string`):

DNS-over-HTTPS resolver used for NS and MX records.

## `concurrency` (type: `integer`):

Requests to a same registry are always spaced out.

## Actor input object example

```json
{
  "domains": [
    "example.com",
    "apify.com"
  ],
  "expiryThresholdDays": 30,
  "notifyWhenNothingNew": false,
  "emitBaseline": true,
  "dnsResolver": "google",
  "concurrency": 5
}
```

# Actor output Schema

## `alerts` (type: `string`):

No description

# 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": [
        "example.com",
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("openregistry/domain-expiry-watch").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": [
        "example.com",
        "apify.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("openregistry/domain-expiry-watch").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": [
    "example.com",
    "apify.com"
  ]
}' |
apify call openregistry/domain-expiry-watch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,openregistry/domain-expiry-watch"
        }
    }
}
```

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/PM2HefVMXUZKvJo07/builds/nWXV59iLBE6aRGcSt/openapi.json
