# Watch SSL certificate expiry for a list of domains

**Use case:** 

When does the certificate of each domain end? Here eight well-known sites: expiry date, days left, a flag for certificates that end within 60 days, the issuer, key size and whether the chain is trusted. Replace the list with your own domains and run it on a schedule with Only new rows to be told when a certificate is renewed or about to end.

## Input

```json
{
  "domains": [
    "github.com",
    "wikipedia.org",
    "python.org",
    "mozilla.org",
    "letsencrypt.org",
    "docs.python.org",
    "developer.mozilla.org",
    "www.gnu.org"
  ],
  "checkHeaders": true,
  "expiryWarningDays": 60,
  "maxItems": 0,
  "port": 443,
  "onlyNew": false,
  "stateName": "default",
  "notifyWhenEmpty": false,
  "requestIntervalMs": 1000
}
```

## Output

```json
{
  "host": {
    "label": "Host checked, exactly as written (no www. added or removed)",
    "format": "string"
  },
  "validTo": {
    "label": "Certificate valid until (ISO 8601, UTC)",
    "format": "string"
  },
  "daysLeft": {
    "label": "Days until the certificate expires (negative when it already expired)",
    "format": "integer"
  },
  "expired": {
    "label": "True when the certificate has expired",
    "format": "boolean"
  },
  "expiresSoon": {
    "label": "True when the certificate expires within the warning period and has not expired yet",
    "format": "boolean"
  },
  "issuerO": {
    "label": "Organisation of the issuing certificate authority (null for a self-signed certificate)",
    "format": "string"
  },
  "issuerCN": {
    "label": "Common name of the issuing certificate authority",
    "format": "string"
  },
  "subjectCN": {
    "label": "Common name of the certificate subject, only when it is a domain name or an IP address",
    "format": "string"
  },
  "sanCount": {
    "label": "Number of DNS names and IP addresses in the certificate",
    "format": "integer"
  },
  "keyType": {
    "label": "Type of the public key (RSA, EC, Ed25519)",
    "format": "string"
  },
  "keyBits": {
    "label": "Key size in bits (for EC keys the curve size)",
    "format": "integer"
  },
  "signatureAlgorithm": {
    "label": "Signature algorithm of the certificate",
    "format": "string"
  },
  "selfSigned": {
    "label": "True when the certificate is signed by its own key",
    "format": "boolean"
  },
  "hostnameMatch": {
    "label": "True when the certificate is valid for the host name checked",
    "format": "boolean"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The SSL Certificate and Security Headers Checker API Actor is ready to run with the inputs already set for "Watch SSL certificate expiry for a list of domains". [Sign up or log in](https://console.apify.com/create-task-from-example/OuqENEROqMzpYtwAm) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Watch SSL certificate expiry for a list of domains" task

The SSL Certificate and Security Headers Checker API Actor will start running based on the input automatically. You can also change all the input fields, like domains or urls, also check the security headers, and more, to match your specific use case.

### 3. Receive the "Watch SSL certificate expiry for a list of domains" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as host checked, exactly as written (no www. added or removed), certificate valid until (iso 8601, utc), days until the certificate expires (negative when it already expired), and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Watch SSL certificate expiry for a list of domains" task via API](https://apify.com/rowcraft/ssl-security-headers-checker.md).

## About this Actor

This example demonstrates how to use [SSL Certificate and Security Headers Checker API](https://apify.com/rowcraft/ssl-security-headers-checker.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/rowcraft/ssl-security-headers-checker.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/rowcraft/ssl-security-headers-checker.md

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`).
