# Domain Health Watch – SSL, Expiry, SPF/DMARC Alerts (`petipeti/domain-health-watch`) Actor

Weekly check of your own domains: days until domain and SSL expiry, broken SPF/DMARC/DKIM email authentication (the reason mail lands in spam), and DNS / name-server changes since the last run.

- **URL**: https://apify.com/petipeti/domain-health-watch.md
- **Developed by:** [peti peti](https://apify.com/petipeti) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 domain checkeds

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 Health Watch – SSL, Expiry, SPF/DMARC Alerts

**The boring things that take a business offline or into the spam folder – checked every week, reported only when they need you.**

For each of your domains:

| Check | Alert when |
|---|---|
| **Domain registration expiry** (official RDAP) | 🔴 ≤ 14 days or expired, 🟡 ≤ 30 days |
| **HTTPS certificate** | 🔴 untrusted, expired or ≤ 7 days left (auto-renewal broken?), 🟡 ≤ 21 days |
| **SPF** | 🔴 missing on a domain that receives mail, two SPF records, `+all`, more than 10 DNS lookups · 🟡 close to 10 lookups, no `all` |
| **DMARC** | 🔴 invalid (no `p=`) or duplicated · 🟡 missing · ⚪ `p=none`, no `rua=` reports |
| **DKIM** | Lists the selectors found (Google Workspace, Microsoft 365, SendGrid, SES … plus your own) · 🔴 when a selector that existed last run is gone |
| **DNS changes since last run** | 🟡 name servers changed (migration – or hijack) · 🔴 SPF / DMARC record disappeared · ⚪ MX, A, certificate issuer changed |

#### Why email authentication matters now

Gmail and Yahoo require SPF or DKIM from every sender and **DMARC from bulk senders**; mail that fails goes to spam or is rejected. These records usually break silently – a DNS migration, a new mail tool overwriting the SPF record, a second SPF record added by a plugin. This Actor **remembers last week's records** and flags the moment one disappears.

### What it does not do

No website content is downloaded and no personal data is collected: only DNS queries, one TLS handshake per domain and one RDAP lookup at the registry listed by IANA. RDAP registrant contacts are never read out – only the expiry date, status and registrar name.

`.jp` and some other country domains have no public RDAP service, so their expiry date is reported as unknown (SSL and email checks still work).

### Input

```json
{ "domains": ["example.com", "example.co.uk"], "dkimSelectors": ["s1"] }
```

Then **Schedules → Create schedule → weekly** (or daily). Hook an integration on `status = new-critical` to get an email or Slack message only when something new broke.

### Output (one row per domain)

```json
{
  "domain": "example.com",
  "status": "new-critical",
  "summary": "Certificate on www.example.com expires in 5 day(s) – auto-renewal may be broken | DMARC changed: v=DMARC1; p=reject → (none)",
  "issues": [{ "severity": "critical", "key": "ssl-expiry", "isNew": true, "message": "…" }],
  "daysToDomainExpiry": 290, "domainExpires": "2027-08-13T04:00:00Z", "registrar": "Example Registrar",
  "daysToSslExpiry": 5, "sslIssuer": "Let's Encrypt",
  "spf": "v=spf1 include:_spf.google.com ~all", "dmarc": null, "dmarcPolicy": null,
  "dkimSelectorsFound": ["google"], "mx": ["aspmx.l.google.com"], "ns": ["ns1.example.net"], "a": ["203.0.113.10"]
}
```

`status`: `ok`, `warnings`, `critical`, or `new-critical` (a critical problem that was not there last run).

### Pricing

Pay per event, platform usage included:

| Event | Price |
|---|---|
| Actor start | $0.01 per run |
| `domain-checked` – one domain checked | $3.00 per 1,000 domains ($0.003 each) |

Example: 5 domains checked weekly ≈ 4 × ($0.01 + 5 × $0.003) = **$0.10 per month**.

### 日本語での説明

自分のドメインを毎週チェックし、ドメインや SSL 証明書の期限切れが近いこと、SPF・DMARC・DKIM（メールが迷惑メール扱いにならないための設定）が壊れていないか、DNS（ネームサーバー・MX など）が変わっていないかを知らせます。前回の結果を覚えているので、「先週まであった DMARC が消えた」のような事故を見つけられます。サイトの中身は読まず、個人情報も扱いません。.jp ドメインは公開の RDAP がないため、ドメインの期限は「不明」と表示します（SSL とメールのチェックはできます）。

料金: 1回 $0.01 ＋ 1ドメイン $0.003。

# Actor input Schema

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

Your own domains, e.g. example.com (URLs are fine too; www. is dropped).

## `checkSsl` (type: `boolean`):

Opens one TLS connection to the domain (or www.) to read the certificate's expiry date and issuer. No page is downloaded.

## `dkimSelectors` (type: `array`):

Just the selector name, e.g. google or s1 (the part before .\_domainkey). Common selectors of Google Workspace, Microsoft 365, SendGrid, Amazon SES and others are always tried.

## `stateStoreName` (type: `string`):

Named key-value store in your account that keeps last run's DNS records, so changes can be reported.

## Actor input object example

```json
{
  "domains": [
    "example.com"
  ],
  "checkSsl": true,
  "stateStoreName": "domain-health-watch-state"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per domain: status, problems (new ones marked), expiry countdowns, SPF / DMARC / DKIM and DNS records.

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("petipeti/domain-health-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"] }

# Run the Actor and wait for it to finish
run = client.actor("petipeti/domain-health-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 call petipeti/domain-health-watch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,petipeti/domain-health-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/cKMWuqbDBVbWmGMdi/builds/WKyW6IuoB8KyRWbvT/openapi.json
