# Security Headers & SSL Checker (`viktorov_aa/security-headers-checker`) Actor

Check HTTP security headers (HSTS, CSP, X-Frame-Options and more) and SSL certificate validity and expiry for a list of domains. No login.

- **URL**: https://apify.com/viktorov_aa/security-headers-checker.md
- **Developed by:** [Andrey Viktorov](https://apify.com/viktorov_aa) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 domains checked

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/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

## Security Headers & SSL Checker

Check the HTTP security headers and the SSL/TLS certificate of up to 500 domains or URLs in one run. For each target you get a 0 to 100 header score, the list of missing headers, whether HTTPS works and redirects from HTTP, the certificate status with days until expiry, and a short list of fixes. No login, no API key, no browser.

### What does it do?

- Reads these response headers: Strict-Transport-Security (HSTS), Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy and X-XSS-Protection.
- Calculates a **0 to 100 score** from which of those headers are present, and lists the missing ones.
- Checks the **certificate**: is it trusted by Node's CA store, does it match the hostname, is it inside its validity dates. Gives days until expiry, issuer and subject.
- Checks **HTTPS**: whether it is available and whether HTTP redirects to HTTPS.
- Writes **recommendations** such as "Add Strict-Transport-Security header to force HTTPS connections."

### Why use it

Security headers and certificate dates are two of the cheapest things to check and two of the most often forgotten. A missing header is easy to fix in a minute, and an expired certificate takes a site down. Checking a handful of sites by hand in a browser is slow, and online checkers handle one site at a time. This Actor checks a whole list, gives you a table to sort by score or by days to expiry, and can run on a schedule so that you hear about a certificate before it expires.

### Who is it for

- **DevOps and site reliability engineers:** monitor certificate expiry across all domains and verify headers after a release.
- **Web developers and agencies:** check that headers are deployed before launch, and give clients a before and after table.
- **Security teams:** get a quick first view of header hygiene across many domains. It is a screening tool, not a penetration test.
- **IT and compliance teams:** collect evidence of header and certificate status for a list of sites. The Actor does not certify compliance with any standard.

### How to use it

1. Put your domains or URLs into **URLs or Domains**. You can write `example.com` or `https://example.com`.
2. Click **Start**. The prefilled input checks `https://example.com` and `https://github.com` and finishes in a few seconds.
3. Open the **Output** tab and sort by `securityScore` or `sslDaysUntilExpiry`, or download the table as CSV, Excel or JSON.

### Input

| Field | What it does |
| --- | --- |
| `urls` | Required. Public URLs or domains. A bare domain is checked over HTTPS first. Loopback, private and link-local addresses are rejected. Up to 500 targets per run. |
| `timeout` | Timeout for each request in milliseconds. Default 30,000. |

A bare domain is requested over `https://` first. HTTP is probed separately to see whether port 80 redirects to HTTPS. A closed port 80 is not reported as a missing redirect.

Example input:

```json
{
  "urls": [
    "https://example.com",
    "https://github.com",
    "https://www.wikipedia.org"
  ]
}
```

### Output

One dataset row per target. This is a real row from one of our runs, for `https://github.com`:

```json
{
  "url": "https://github.com",
  "finalUrl": "https://github.com/",
  "httpsAvailable": true,
  "httpsRedirect": true,
  "securityHeaders": {
    "strictTransportSecurity": "max-age=31536000; includeSubdomains; preload",
    "contentSecurityPolicy": "default-src 'none'; base-uri 'self'; child-src github.githubassets.com ... (shortened here)",
    "xFrameOptions": "deny",
    "xContentTypeOptions": "nosniff",
    "referrerPolicy": "origin-when-cross-origin, strict-origin-when-cross-origin",
    "xXssProtection": "0"
  },
  "securityScore": 90,
  "missingHeaders": [
    "Permissions-Policy"
  ],
  "sslInfo": {
    "valid": true,
    "validFrom": "Oct 30 00:00:00 2026 GMT",
    "validTo": "Jan 27 23:59:59 2027 GMT",
    "daysUntilExpiry": 64,
    "issuer": "Sectigo Limited Sectigo Public Server Authentication CA DV E36",
    "subject": "github.com"
  },
  "sslValid": true,
  "sslDaysUntilExpiry": 64,
  "recommendations": [
    "Add the remaining security headers: Permissions-Policy."
  ],
  "error": null,
  "timestamp": "2026-11-24T17:44:04.187Z"
}
```

| Field | What it contains |
| --- | --- |
| `url` | The URL or domain you provided. |
| `finalUrl` | Final URL after redirects. |
| `httpsAvailable` | Whether HTTPS works. |
| `httpsRedirect` | True only when an HTTP response was observed redirecting to HTTPS. False means that redirect was not observed, including when port 80 could not be checked. |
| `securityHeaders` | Object with the security headers found. |
| `securityScore` | Score from 0 to 100 based on which tracked headers are present. |
| `missingHeaders` | Tracked headers that are missing. |
| `sslInfo` | Certificate details: validity, dates, days until expiry, issuer and subject. |
| `sslValid` | Quick boolean: is the certificate trusted, matching and inside its dates? |
| `sslDaysUntilExpiry` | Days until the certificate expires. `null` if there is no HTTPS or the check failed. |
| `recommendations` | Plain-language fixes. |
| `error` | Error message if the check failed, `null` otherwise. |
| `timestamp` | When the check was made, ISO 8601. |

#### How the score is calculated

The score adds up points for each header that is present:

| Header | Points |
| --- | --- |
| Strict-Transport-Security | 25 |
| Content-Security-Policy | 20 |
| X-Frame-Options | 15 |
| X-Content-Type-Options | 15 |
| Referrer-Policy | 10 |
| Permissions-Policy | 10 |
| X-XSS-Protection | 5 |

The score only tells you which headers are present. It does not judge whether the value of a header is a strong policy. A site can score 100 with a weak CSP. As a rough guide, 90 to 100 means all or nearly all headers are set, 70 to 89 means a few are missing, and below 50 means several important ones are missing. In the example above, GitHub scores 90 because it does not send Permissions-Policy.

### How much does it cost?

You pay per checked target. The Actor uses pay-per-event pricing with the event **`domain-checked`**: $0.001 for each domain or URL that was checked. A target that failed is written to the dataset with an `error` and is not charged. Every run also has a tiny start fee of $0.00005 per start event.

| Run size | Calculation | Cost for results |
| --- | --- | --- |
| A handful of sites | 10 × $0.001 | $0.01 |
| A client portfolio | 100 × $0.001 | $0.10 |
| The maximum per run | 500 × $0.001 | $0.50 |

The exact prices, including the Apify platform fee, are shown on the Pricing tab and apply to your plan. Apify's free plan includes monthly platform credits, so you can try it without paying. To cap spending, set **Maximum cost per run** in the run options. The Actor stops when the limit is reached. If a run hits that limit, it stops and says so: the log gets a warning, the run status message starts with `INCOMPLETE`, and `SUMMARY.complete` is false. To get a full download, raise **Maximum cost per run**, or split the work (for example with dateFrom/dateTo or tighter filters) and merge the datasets.

### Monitor certificate expiry

1. Put your domains into the input and save it as a task.
2. Create an Apify schedule that runs the task daily or weekly.
3. Use a webhook or the Make, Zapier or n8n integration to read `sslDaysUntilExpiry` and send yourself a message when it drops below the number of days you choose, for example 21.

### Integrations

You can run this Actor from the Apify Console, on a schedule, or from your own code and tools. Results land in a standard Apify dataset, so every integration below reads the same rows.

#### API

Run the Actor and get the rows back in one HTTP call. Replace `<YOUR_APIFY_TOKEN>` with your token from Apify Console, Settings, Integrations:

```bash
curl -X POST "https://api.apify.com/v2/acts/viktorov_aa~security-headers-checker/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://example.com", "https://github.com", "https://www.wikipedia.org"]}'
```

The synchronous endpoint waits for the run to finish and Apify limits it to 5 minutes. For bigger runs, start the Actor with `POST /v2/acts/viktorov_aa~security-headers-checker/runs`, then read the dataset when the run has finished (or let a webhook tell you).

Python, with the [Apify client](https://docs.apify.com/api/client/python):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("viktorov_aa/security-headers-checker").call(run_input={
    "urls": [
        "https://example.com",
        "https://github.com",
        "https://www.wikipedia.org"
    ]
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row)
```

JavaScript, with the [Apify client](https://docs.apify.com/api/client/js):

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('viktorov_aa/security-headers-checker').call({
    "urls": [
        "https://example.com",
        "https://github.com",
        "https://www.wikipedia.org"
    ]
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### AI agents and MCP

The Actor works as a tool for AI agents through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Point an MCP client that supports remote servers at this URL, sign in with your Apify account, and the agent can call the Actor with the input fields above:

```text
https://mcp.apify.com?tools=viktorov_aa/security-headers-checker
```

Ask the agent in plain language, for example: "Use Security Headers & SSL Checker with my filter and summarize the rows." The agent sees the input schema and the output fields, so it fills the fields for you.

#### Make, Zapier, n8n and Google Sheets

Apify has official apps for Make, Zapier and n8n. In each one, choose the action that runs an Actor, select `viktorov_aa/security-headers-checker`, paste the input JSON, then map the dataset items to the next step. The Apify integration for Google Sheets can send a finished dataset to a spreadsheet. Webhooks on the Actor let you start your own process as soon as a run succeeds, and Apify schedules start it daily or weekly with no code.

### FAQ

#### What is a good security headers score?

The score counts present headers only, so 100 means all seven are set, not that the policies are strong. Use it to find what is missing, then read the values in `securityHeaders` for the details.

#### Does it do a full TLS or security audit?

No. The certificate check covers trust, hostname and expiry. The Actor does not report the signature algorithm, the cipher suite or the TLS version. For penetration tests, OWASP ZAP scans or detailed TLS analysis, use dedicated security tools.

#### Why is `httpsRedirect` false for a site that works on HTTPS?

It is true only when the Actor saw an HTTP response redirecting to HTTPS. If port 80 is closed or the probe did not finish, the redirect is not observed and the value is false. A closed port 80 does not add a recommendation.

#### Does it check meta tags or headers set by JavaScript?

No. It reads the headers the server sends. Headers set by meta tags or by JavaScript are not seen.

#### Does it check subpages or subdomains?

One request per target. It does not crawl paths or subdomains. Add each URL or subdomain you care about to the list.

#### How many targets can I check, and how fast is it?

Up to 500 per run, one after another. The prefill with two sites finishes in about two seconds, and the time for a long list grows with how fast each site answers.

#### Can it check sites on my private network?

No. Loopback, private and link-local addresses are rejected.

### Limitations

- **Server headers only:** meta tags and JavaScript-set headers are not seen.
- **No deep CSP analysis:** the Actor reports that CSP is present, not whether the policy is strong.
- **Certificate basics only:** trust, hostname and expiry. No signature algorithm, cipher suite or TLS version.
- **One request per URL:** paths and subdomains are not crawled.
- **Public targets only.**
- Memory: 256 MB by default, up to 512 MB.

### More actors by the same author

Same publisher, same pay-per-result pricing, same no-login approach. Pick the ones that fit your workflow:

- [URL Status & Redirect Chain Checker](https://apify.com/viktorov_aa/url-status-checker) — HTTP status codes and full redirect chains for a list of URLs.
- [Contact Details Scraper: Emails, Phones, Socials, Impressum](https://apify.com/viktorov_aa/website-contact-details) — public emails, phones and social links from company websites.
- [Google News Scraper: Real Article URLs & Date Range](https://apify.com/viktorov_aa/google-news) — Google News results with the real article URL and a date range.
- [Eclipse Marketplace Plugins Scraper](https://apify.com/viktorov_aa/eclipse-marketplace-plugins) — Eclipse Marketplace plugins with install counts, license and update site.

The full catalog with use-case pages is at [legion-factory.dev/actors](https://legion-factory.dev/actors/).

### Support

Found a problem, or need a field or a filter that is missing? Open an issue in the **Issues** tab of this Actor page. Publisher: [legion-factory.dev](https://legion-factory.dev/actors/).

# Actor input Schema

## `urls` (type: `array`):

Public URLs or domains. A bare domain is checked over HTTPS. Loopback, private, and link-local addresses are rejected. Maximum 500 targets.

## `timeout` (type: `integer`):

Timeout for each HTTP request in milliseconds

## Actor input object example

```json
{
  "urls": [
    "https://example.com",
    "https://github.com"
  ],
  "timeout": 30000
}
```

# Actor output Schema

## `overview` (type: `string`):

Default dataset in the overview table: URL, security score, HTTPS, redirect and certificate fields.

# 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 = {
    "urls": [
        "https://example.com",
        "https://github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("viktorov_aa/security-headers-checker").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 = { "urls": [
        "https://example.com",
        "https://github.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("viktorov_aa/security-headers-checker").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 '{
  "urls": [
    "https://example.com",
    "https://github.com"
  ]
}' |
apify call viktorov_aa/security-headers-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,viktorov_aa/security-headers-checker"
        }
    }
}
```

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/37UYajnwhigz5Hwee/builds/0vop5yb6S7gPfdVnU/openapi.json
