# Certificate Transparency Subdomain & Certificate Monitor (`afkdigital/newapi31-certificate-transparency-monitor`) Actor

Bounded crt.sh CT certificate history and matching subdomains. Historical expiry is not live TLS expiry.

- **URL**: https://apify.com/afkdigital/newapi31-certificate-transparency-monitor.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.50 / 1,000 unique ct certificate records

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

## Certificate Transparency Subdomain & Certificate Monitor (NEWAPI31)

Search public Certificate Transparency history for up to five supplied DNS domains. Each Dataset item represents one distinct **crt.sh certificate ID** across the whole run. It includes names found in that certificate, not a claim that a host exists or that a certificate is deployed there.

### Input

```json
{"domains":["example.org"],"includeExpired":true,"maxRecords":20}
```

| Input | Bound | Meaning |
| --- | --- | --- |
| `domains` | 1–5 valid DNS names | Queries are sequential; duplicate input names are removed. |
| `includeExpired` | boolean | Defaults to true for historical discovery; false sends `exclude=expired` to crt.sh. |
| `maxRecords` | 1–250 | Maximum distinct certificate IDs published and charged. Default 20. |

No live TLS handshake or current site certificate inspection is performed. `not_after` and `days_until_expiry` describe the **historical CT certificate**, which may not be deployed on any site. `expiry_basis` is always `historical_ct_certificate`. A wildcard pattern such as `*.example.org` is kept in `wildcard_patterns` and is not treated as an observed concrete hostname.

### Output and missing data

Default Dataset rows are JSON via the Apify Dataset API and CSV via `?format=csv`; both work in Clay and n8n. `matching_subdomains`, `wildcard_patterns`, and `queried_domains` are arrays in JSON (serialized cells in CSV). The output schema exposes links. `RUN_SUMMARY` in the default key-value store contains counts, truncation, and per-domain source errors; errors do not create paid Dataset rows.

Fields: `cert_id`, `logged_at`, `not_before`, `not_after`, `common_name`, `matching_subdomains`, `wildcard_patterns`, `issuer_ca_name`, `days_until_expiry`, `serial_number`, `queried_domains`, `source`, `source_url`, `expiry_basis`, and `missing_source_fields`. `issuer_ca_name` is the source's unmodified issuer DN, not a verified CA brand. The normal crt.sh search JSON has no log timestamp: `logged_at` is null and listed in `missing_source_fields`. Missing and malformed dates are null; no field is inferred from the live TLS service. The source can contain precertificates or duplicate SAN search matches; certificate IDs are deduplicated within a run.

### Source, limits, and reliability

The Actor calls `https://crt.sh/?q=<domain>&output=json` once per domain. The public service has no published official JSON pagination, API quota, guaranteed SLA, or commercial service grant identified during review on 2026-10-27. Use is intentionally small and best effort. The Actor waits two seconds between domain requests, allows up to three attempts on timeouts/429/5xx with exponential backoff, uses a 45-second attempt timeout, a 270-second run deadline, and rejects responses over 8 MiB. For broad domains, the server may be slow or reject a request; errors appear in `RUN_SUMMARY`. Because there is no reliable server pagination, a result set over the 250-row output cap is marked `truncated`; no claim of complete domain coverage is made. A source error produces no paid item for that domain. A run with no results may be successful with zero charge.

No proxy, credential, secret, or customer domain is written to logs. The Actor does not access other hosts based on CT results.

### Pay per event

Configure exactly **USD $0.0045 per `apify-default-dataset-item`** in Apify Console, and remove/price at zero any start or other chargeable event. One event is billed only when a unique, validated certificate row is successfully written to the default Dataset. Duplicate source hits, retried HTTP requests, skipped out-of-scope rows, errors, and summary writes are never charged. The Apify Python SDK reports spending limits from `Actor.push_data`; the Actor stops after the limit is reached. The price is $4.50 per 1,000 successful unique rows, before any platform-specific discount or tax. Verify the actual effective Store pricing in Console before release.

### Local checks

```sh
python3 -m unittest discover -s tests -v
docker build -t newapi31:local .
```

For Apify CLI deployment, run `apify validate-schema`, `apify push`, test a cloud run and then configure the synthetic Dataset event price in the Actor's monetization settings. Publishing is contingent on source suitability and a confirmed effective price.

# Actor input Schema

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

1 to 5 DNS domains; no URL, path or wildcard. Default example.org.

## `includeExpired` (type: `boolean`):

Historical CT coverage; not a live TLS status check.

## `maxRecords` (type: `integer`):

Dataset rows and billable events; source response still fetched with 8 MiB cap.

## Actor input object example

```json
{
  "domains": [
    "example.org"
  ],
  "includeExpired": true,
  "maxRecords": 20
}
```

# Actor output Schema

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

No description

## `csv` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/newapi31-certificate-transparency-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/newapi31-certificate-transparency-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 '{}' |
apify call afkdigital/newapi31-certificate-transparency-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/newapi31-certificate-transparency-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/cZUSDb5lc63wxSDzZ/builds/phnMRuZfHDdRvajrk/openapi.json
