# Domain Health Check · SSL Expiry, Security Headers, SPF & DMARC (`thequietstack/domain-health-check`) Actor

Audit many domains in one run: TLS certificate expiry and trust, HTTPS redirect, security headers and email authentication (SPF, DMARC, MX, CAA). Grade A–F and a plain-language issue list; monitoring mode reports only changes.

- **URL**: https://apify.com/thequietstack/domain-health-check.md
- **Developed by:** [TheQuietStack](https://apify.com/thequietstack) (community)
- **Categories:** Developer tools, SEO tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Check: SSL expiry, security headers, SPF and DMARC

Audit a list of domains in one run and get a **grade (A–F)** and a **plain-language issue list** per domain:

- **TLS certificate:** days until expiry, trusted or not (expired, self-signed, wrong host name), issuer, TLS version
- **HTTPS:** does `http://` redirect to `https://`, final URL and status
- **Security headers:** HSTS, CSP / X-Frame-Options, X-Content-Type-Options, Referrer-Policy, exposed `X-Powered-By`
- **Email authentication (DNS):** MX, SPF (and its `all` mechanism), DMARC policy, CAA

**Typical uses:** agencies checking all client domains every morning · IT teams watching certificate expiry across dozens of domains · sales teams qualifying leads by email security · pre-launch checks.

### Example (real run, 21.10.2026)

6 domains in one run: cloudflare.com **A**, github.com **A**, python.org **A (90)**, example.com **B** (no HTTPS redirect, no HSTS),
expired.badssl.com **F** (certificate expired 4,210 days ago), wrong.host.badssl.com **F** (certificate does not cover the host name).

```json
{
 "domain": "python.org",
 "grade": "A",
 "score": 90,
 "issues": [
  "low: No X-Content-Type-Options: nosniff",
  "medium: DMARC policy is p=none (monitoring only)",
  "info: No CAA record (any CA may issue certificates)"
 ],
 "certValidTo": "2027-02-14T13:03:45.000Z",
 "certDaysLeft": 116,
 "certIssuer": "GlobalSign nv-sa",
 "certTrusted": true,
 "tlsProtocol": "TLSv1.3",
 "httpsRedirect": true,
 "hsts": "max-age=63072000; includeSubDomains; preload",
 "spfAll": "~",
 "dmarcPolicy": "none",
 "dmarcReporting": true,
 "mx": [
  "mail.python.org"
 ],
 "caa": [],
 "newIssues": [],
 "resolvedIssues": []
}
```

### Monitoring mode

`onlyWhenChanged: true` reports a domain only when an issue **appeared or was resolved** since the last run (`newIssues`, `resolvedIssues`). Unchanged domains are not charged.
`reportMinSeverity: "high"` reports only domains with high or critical issues (e.g. a certificate expiring within `warnDaysBeforeExpiry`, default 21 days).

### Pricing

Pay per event: **$0.004 per domain reported** on the free plan, −10/−20/−30 % on higher Apify plans. Domains skipped by monitoring mode or the severity filter are never charged.

### How it checks, and limits

- Sources are only the domain itself (one TLS handshake, the homepage headers) and public DNS. No third-party API, no login.
- `robots.txt` is honoured for the homepage request: if `/` is disallowed for all user agents, header checks are skipped (TLS and DNS still run) and the row says so.
- **No personal data:** DMARC report addresses are not output, only whether reporting is configured (`dmarcReporting`).
- The grade is a transparent sum of the listed issues (critical −40, high −15, medium −7, low −3); it is a checklist, not a penetration test. DKIM cannot be checked without knowing the selector.

# Actor input Schema

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

Domains or URLs to check (example.com, https://shop.example.com). Each domain = one result row.

## `warnDaysBeforeExpiry` (type: `integer`):

Certificates expiring within this many days are reported as a high-severity issue.

## `reportMinSeverity` (type: `string`):

'info' reports every domain. 'high' reports only domains with high or critical issues (plus domains where an issue was just resolved). Unreported domains are not charged.

## `onlyWhenChanged` (type: `boolean`):

Monitoring mode: from the second run on, report a domain only when an issue appeared or was resolved since the last run. Unchanged domains are not charged.

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

Named key-value store that keeps the last result per domain for change detection.

## Actor input object example

```json
{
  "domains": [
    "cloudflare.com",
    "python.org",
    "example.com"
  ],
  "warnDaysBeforeExpiry": 21,
  "reportMinSeverity": "info",
  "onlyWhenChanged": false,
  "stateStoreName": "domain-health-check-state"
}
```

# Actor output Schema

## `domains` (type: `string`):

No description

## `summary` (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": [
        "cloudflare.com",
        "python.org",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thequietstack/domain-health-check").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": [
        "cloudflare.com",
        "python.org",
        "example.com",
    ] }

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

```

## MCP server setup

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

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/dKfCPdgGFxbNWIjbU/builds/YZFwUt0laH0xBmREG/openapi.json
