# SSL Certificate Expiry Monitor — Days Left, Issuer and Chain (`ponderable_hydrometer/cert-expiry`) Actor

Check the TLS/SSL certificate of a list of domains: days until expiry, issuer, validity window, lifetime, chain trust and which hostnames it covers. No API key.

- **URL**: https://apify.com/ponderable_hydrometer/cert-expiry.md
- **Developed by:** [Ponderable Hydrometer](https://apify.com/ponderable_hydrometer) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

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

## SSL Certificate Expiry Monitor — Days Left, Issuer and Chain

**Know before a certificate expires.** Give a list of domains and each one comes back with the days remaining, the issuer, the validity window, the certificate's lifetime, whether the chain is trusted and which hostnames it covers. No API key.

Certificate lifetimes are getting shorter on an industry schedule (the CA/Browser Forum ballot SC-081v3: a 200-day maximum from 15 March 2026, 100 days from 15 March 2027, 47 days from 15 March 2029), so a certificate you renewed by hand last year may now lapse mid-cycle. This Actor is the cheap way to watch a whole list at once.

### What you can do with it

- **Watch every certificate you own** from one list and act on `expiringSoon`.
- **Find the wrong certificate** on a host: `coversHost` is false when the name does not match, `chainTrusted` is false for self-signed or incomplete chains.
- **Plan for shorter certificate lifetimes**: `lifetimeDays` shows how long each certificate is valid.
- **Check non-standard ports** such as `mail.example.com:993`.

### What you get

One row per domain: `daysRemaining`, `validFrom`, `validTo`, `lifetimeDays`, `issuer`, `subjectCN`, `subjectAltNames`, `coversHost`, `chainTrusted`, `chainError`, `tlsProtocol`, `serialNumber`, `expired`, `expiringSoon`, and a plain `issues` list.

### Output sample

```json
{
  "host": "github.com",
  "port": 443,
  "ok": true,
  "expired": false,
  "expiringSoon": false,
  "daysRemaining": 82,
  "validFrom": "2026-10-29T00:00:00.000Z",
  "validTo": "2027-01-27T23:59:59.000Z",
  "lifetimeDays": 90,
  "issuer": "Sectigo Limited",
  "issuerCN": "Sectigo ECC Domain Validation Secure Server CA",
  "subjectCN": "github.com",
  "subjectAltNames": ["github.com", "www.github.com"],
  "coversHost": true,
  "chainTrusted": true,
  "chainError": null,
  "tlsProtocol": "TLSv1.3",
  "serialNumber": "…",
  "issues": []
}
```

### Input

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `domains` | array | — | Domains to check. Use `host`, `host:port` or a URL. Default port is 443. |
| `warnDays` | integer | 30 | Flag a certificate as expiring soon when fewer than this many days remain. |

### Input example

```json
{
  "domains": ["github.com", "expired.badssl.com", "mail.example.com:993"],
  "warnDays": 30,
  "timeoutMs": 15000
}
```

`domains` accepts `host`, `host:port` or a URL. `timeoutMs` (default 15000) is the TLS connection timeout per target; it is an API input and is not shown in the Console form.

### Schedule it

Run it daily from Apify Schedules on your domain list and send the dataset to an alert: filter on `expiringSoon` or `ok: false`.

### Use it from the API or an AI agent

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_hydrometer~cert-expiry/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"domains": ["github.com"], "warnDays": 30}'
```

Through the Apify MCP server: `https://mcp.apify.com?tools=ponderable_hydrometer/cert-expiry`.

### Limits and good to know

- It reads the certificate the server presents during the TLS handshake; it does not need the chain to be trusted, so an expired, self-signed or wrong-host certificate is still reported (with the problem in `issues`).
- `coversHost` applies the real wildcard rule: `*.example.com` covers one extra label, not nested subdomains.
- An unreachable host (refused, reset, timed out, or no certificate presented) still produces a row with `ok: false`, `error` and an `issues` entry, so one unreachable host never fails the run. That row counts as one result, because one checked domain = one result: the row tells you the check failed.

### FAQ

**Does it check the whole chain?** It reads the certificate the server presents and reports whether the chain is trusted (`chainTrusted`, `chainError`). It does not list the intermediate certificates.

**Does it send anything to the server besides the TLS handshake?** No.

### Pricing

Pay per result — **$3.00 per 1,000 results** (one checked domain = one result), plus Apify's standard per-run start event ($0.00005 per GB of memory, so a fraction of a cent per run). No subscription.

# Actor input Schema

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

Domains to check. Use host, host:port or a URL (default port 443).

## `warnDays` (type: `integer`):

Flag a certificate as expiring soon when fewer than this many days remain.

## `timeoutMs` (type: `integer`):

Per-target TLS connection timeout.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "cloudflare.com",
    "expired.badssl.com",
    "apify.com"
  ],
  "warnDays": 30,
  "timeoutMs": 15000
}
```

# Actor output Schema

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

All rows produced by this run, as JSON.

# 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": [
        "github.com",
        "cloudflare.com",
        "expired.badssl.com",
        "apify.com"
    ],
    "warnDays": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_hydrometer/cert-expiry").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": [
        "github.com",
        "cloudflare.com",
        "expired.badssl.com",
        "apify.com",
    ],
    "warnDays": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("ponderable_hydrometer/cert-expiry").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": [
    "github.com",
    "cloudflare.com",
    "expired.badssl.com",
    "apify.com"
  ],
  "warnDays": 30
}' |
apify call ponderable_hydrometer/cert-expiry --silent --output-dataset

```

## MCP server setup

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

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/6YOAjxacJkf1uyjGk/builds/sPj14J2D4XVFs5wFs/openapi.json
