# crt.sh Certificate Monitor - New TLS Certs (`technicaldost/crtsh-new-certificate-monitor`) Actor

Watch public hostnames for newly logged certificates on crt.sh. Returns newest cert facts and expiry buckets. Queries crt.sh only — never connects to the target host. You only pay for successful checks you receive.

- **URL**: https://apify.com/technicaldost/crtsh-new-certificate-monitor.md
- **Developed by:** [Technical Dost Solutions](https://apify.com/technicaldost) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.50 / 1,000 successful watchlist 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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## crt.sh Certificate Monitor - New TLS Certs

**Watch hostnames you already own or operate for newly logged public certificates on crt.sh. Get newest-cert facts and expiry buckets — without connecting to the target host.**

This Actor takes a caller-owned list of public DNS hostnames, queries crt.sh JSON, and writes one structured row per host: newest not-before / not-after, issuer, serial, common name, certificate count and an expiry bucket. Pass the previous run's snapshot back in and you get `INITIAL`, `UNCHANGED` or `CHANGED` when a newer cert appears.

It never fetches `https://your-host`. Certificate Transparency data only.

***

### What this Actor does

You already know the hostnames (your product domains, a brand-protection list, a takeover watchlist). You want a scheduled check for a newly logged certificate or an expiry window — without a live TLS handshake and without dumping the entire CT universe.

That is the job: a **hostname watchlist on crt.sh**, not a handshake auditor and not a CT firehose.

***

### What you get

```json
{
  "schemaVersion": 1,
  "id": "example.com",
  "status": "ok",
  "domain": "example.com",
  "newestNotBefore": "2026-07-29T22:10:08",
  "newestNotAfter": "2026-09-20T22:10:07",
  "newestIssuer": "Example CA",
  "newestSerial": "abc",
  "newestCommonName": "example.com",
  "certificateCount": 2,
  "expiryBucket": "DUE_SOON",
  "daysUntilExpiry": 14,
  "changeType": "INITIAL",
  "changedFields": [],
  "checkedAt": "2026-09-06T12:00:00.000Z",
  "sourceUrl": "https://crt.sh/?Identity=example.com&output=json",
  "error": null
}
```

`example.com` is a public example hostname. Field values above are illustrative of shape. The Actor tries `Identity=` then `q=` because crt.sh sometimes answers one form and 404s the other.

`expiryBucket` is `OVERDUE`, `DUE_SOON` (within `expiryWarningDays`), `LATER`, or `UNKNOWN`.

***

### Main use cases

- **New-cert alerts.** See when a newer public certificate is logged for a host you watch.
- **Expiry buckets.** Route `DUE_SOON` / `OVERDUE` without SSHing to the box.
- **Brand / shadow-IT.** Watch product domains for unexpected newly logged names.
- **Pair with a handshake audit.** Use the SSL Actor (below) when you need the live cert, not CT.

***

### Quick start

```json
{
  "domains": ["example.com"],
  "maxItems": 1,
  "expiryWarningDays": 30
}
```

Run it, open the dataset, and save `NEXT_SNAPSHOT` from the default key-value store.

***

### Repeat workflow

1. Keep one hostname watchlist per customer or environment (1–20 hosts).
2. Start a bounded run. Schedule it yourself if you need a cadence.
3. Save `NEXT_SNAPSHOT` in **your** private workflow state.
4. On the next run pass it as `previousSnapshot` and set `onlyChanges: true`.
5. Route `CHANGED` rows (new serial, new not-before, bucket moves) for review.

***

### Input

| Field | Type | Default | What it does |
|---|---|---|---|
| `domains` | array | — | 1–20 public DNS hostnames. IP addresses, localhost and internal suffixes are rejected. |
| `maxItems` | integer | `20` | 1–20. Must cover all unique hosts. |
| `expiryWarningDays` | integer | `30` | 0–365. Window used for `DUE_SOON`. |
| `onlyChanges` | boolean | `false` | Suppress unchanged successful records without charging them. |
| `previousSnapshot` | object | — | Prior `NEXT_SNAPSHOT` with `kind: "crtsh"`. |

***

### Pricing

| Event | Price | When it happens |
|---|---|---|
| **Successful watchlist result** | **$0.0025** | One successful hostname check written to the dataset |
| Actor start | none | No custom start fee |

**You are not charged for:** crt.sh 404/502/503 after both query forms, parse failures, retries, duplicate hosts, invalid input, or unchanged records suppressed by `onlyChanges`.

**Worked example.** 15 hosts daily, 1 new cert/day after the first run → about `$0.0025` per day in Actor event charges when `onlyChanges` is on.

#### How this compares

| Actor | Price per result | Job |
|---|---|---|
| **This Actor** | **$0.0025** | Caller-owned hostname watchlist on crt.sh |
| `parseforge/crt-sh-scraper` (Store card, 2026-09-06) | $0.00333 | Dump-oriented CT listing |
| Owned [SSL Certificate Security Audit](https://apify.com/technicaldost/ssl-certificate-security-audit) | live handshake | Different job — connects to the host |

***

### Using the API

```bash
curl --fail -X POST "https://api.apify.com/v2/acts/technicaldost~crtsh-new-certificate-monitor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"domains":["example.com"],"maxItems":1}'
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('technicaldost/crtsh-new-certificate-monitor').call({
    domains: ['example.com'],
    maxItems: 1,
    expiryWarningDays: 30,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**Python**

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("technicaldost/crtsh-new-certificate-monitor").call(run_input={
    "domains": ["example.com"],
    "maxItems": 1,
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["domain"], row["newestSerial"], row["expiryBucket"], row["changeType"])
```

**n8n / MCP.** Server-side start + poll. Keep `APIFY_TOKEN` in credentials, not in the workflow JSON you publish.

***

### Limitations

- crt.sh is a public volunteer service and is often slow or returns 404/502. The Actor tries two query forms; it does not solve CAPTCHAs or forge tokens.
- Certificate Transparency is not a complete inventory of every certificate on a host (especially privately trusted or never-logged certs).
- This Actor does not connect to the hostname and does not replace a handshake / grade product.
- IP addresses, localhost and internal suffixes are rejected.
- At most 1,000 snapshot records are retained.

Source: public [crt.sh](https://crt.sh/) JSON. Not affiliated with crt.sh, Sectigo or the CA/Browser Forum.

***

### Related Actors

- [SSL Certificate Security Audit](https://apify.com/technicaldost/ssl-certificate-security-audit) — live TLS handshake on URLs you supply.
- [Hugging Face Model Monitor](https://apify.com/technicaldost/huggingface-model-watchlist-monitor) — SHA/visibility watchlist for Hub models you already use.

***

### Changelog

See `CHANGELOG.md`. Release 1.0.0 (2026-09-06): caller-owned hostname watchlists, Identity+q fallback, expiry buckets, $0.0025 per successful result, no start fee.

# Actor input Schema

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

One to 20 public DNS hostnames. IP addresses, localhost, and internal suffixes are rejected. The Actor queries crt.sh; it does not connect to the hostname.

## `onlyChanges` (type: `boolean`):

Suppress unchanged successful records without charging them. The first observation is emitted.

## `previousSnapshot` (type: `object`):

Copy the previous run NEXT\_SNAPSHOT JSON here. Keep one snapshot per customer watchlist; no shared server state.

## `maxItems` (type: `integer`):

Bound successful checks plus item errors to at most this many records.

## `expiryWarningDays` (type: `integer`):

Certificates ending within this many UTC days are DUE\_SOON; already ended are OVERDUE.

## Actor input object example

```json
{
  "domains": [
    "example.com"
  ],
  "onlyChanges": false,
  "maxItems": 20,
  "expiryWarningDays": 30
}
```

# Actor output Schema

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

No description

## `nextSnapshot` (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": [
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("technicaldost/crtsh-new-certificate-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 = { "domains": ["example.com"] }

# Run the Actor and wait for it to finish
run = client.actor("technicaldost/crtsh-new-certificate-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 '{
  "domains": [
    "example.com"
  ]
}' |
apify call technicaldost/crtsh-new-certificate-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,technicaldost/crtsh-new-certificate-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/UgHZUtXHkd8quytj5/builds/ohd4kg89wWfShXYtY/openapi.json
