# Bulk SSL Certificate Expiry Checker & Monitor (`mediapro-tools/ssl-certificate-expiry-monitor`) Actor

Check SSL/TLS certificates for thousands of domains: days to expiry, issuer, SANs, hostname match, trust chain, TLS version and cipher. Input: hosts. Output (JSON/CSV): one row per item with host, port, status, daysRemaining, validTo, issuer, hostnameMatches, authorized, sans, protocol.

- **URL**: https://apify.com/mediapro-tools/ssl-certificate-expiry-monitor.md
- **Developed by:** [Jeremy Yarbrough](https://apify.com/mediapro-tools) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Bulk SSL Certificate Expiry Checker & Monitor

Check SSL/TLS certificates for a list of domains and get the days left before expiry, issuer, SANs, hostname match, trust status, TLS version and cipher for each one. Turn on **monitor mode** and schedule it daily to catch renewals, CA switches, and new problems before your visitors see a browser warning.

### Who uses it

- Agencies and MSPs watching dozens or hundreds of client sites
- IT and security teams auditing subdomains
- SEO teams, since an expired certificate kills traffic

### Input

`hosts` (domains, URLs or host:port), `warnDays` (default 30), `monitorMode`, `onlyChanged`.

### Output (one row per host)

`status` is one of OK, EXPIRING_SOON, EXPIRED, NAME_MISMATCH, UNTRUSTED or UNREACHABLE. Each row also has `daysRemaining`, `validTo`, `issuer`, `sans`, `hostnameMatches`, `authorized`, `protocol`, `cipher`, `chain` and `handshakeMs`. In monitor mode it adds `changed` and `changes`.

### Tips

Schedule daily with `monitorMode: true, onlyChanged: true`, then connect a Slack or email integration to the dataset.

### Pricing

Pay per result. See the Pricing tab.

### Related tools

- [Bulk HTTP Security Headers Checker & Grade (with change alerts)](https://apify.com/mediapro-tools/security-headers-checker-bulk)
- [Bulk Domain WHOIS (RDAP) Lookup: Age, Expiry, Registrar & DNS](https://apify.com/mediapro-tools/domain-whois-rdap-bulk)
- [Bulk DNS Lookup & DNS Change Monitor](https://apify.com/mediapro-tools/bulk-dns-lookup-monitor)
- [Subdomain Finder (Certificate Transparency) + Live Check](https://apify.com/mediapro-tools/subdomain-finder-ct-logs)

# Actor input Schema

## `hosts` (type: `array`):

Domains or URLs; host:port is accepted.

## `port` (type: `integer`):

Used when a host has no :port.

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

Certificates expiring within this many days get status EXPIRING_SOON.

## `monitorMode` (type: `boolean`):

Adds changes/changed fields (fingerprint, issuer, status, expiry). Schedule daily.

## `onlyChanged` (type: `boolean`):

Monitor mode only.

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

Named key-value store for previous results.

## `maxConcurrency` (type: `integer`):

Parallel TLS handshakes.

## `timeoutSecs` (type: `integer`):

Per-host handshake timeout.

## Actor input object example

```json
{
  "hosts": [
    "apify.com",
    "example.com",
    "expired.badssl.com"
  ],
  "port": 443,
  "warnDays": 30,
  "monitorMode": false,
  "onlyChanged": false,
  "stateStoreName": "ssl-cert-monitor",
  "maxConcurrency": 10,
  "timeoutSecs": 10
}
```

# Actor output Schema

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

All result records in the default dataset (table view: overview).

## `files` (type: `string`):

Files saved by this run (download links are also in each result record).

## `summary` (type: `string`):

Counts and stats for this run (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 = {
    "hosts": [
        "apify.com",
        "example.com",
        "expired.badssl.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("mediapro-tools/ssl-certificate-expiry-monitor").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 = { "hosts": [
        "apify.com",
        "example.com",
        "expired.badssl.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("mediapro-tools/ssl-certificate-expiry-monitor").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 '{
  "hosts": [
    "apify.com",
    "example.com",
    "expired.badssl.com"
  ]
}' |
apify call mediapro-tools/ssl-certificate-expiry-monitor --silent --output-dataset

```

## MCP server setup

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

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/ZXA1hbUMsj2uYcYbV/builds/Vxmbe2yvbR1ekmRNb/openapi.json
