# Website Security Headers & SSL Checker (Bulk, A+ to F) (`larkmoor/website-security-headers-checker`) Actor

Bulk-check HTTP security headers (CSP, HSTS, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy), HTTPS redirect, cookie flags, TLS version and SSL certificate expiry for any list of websites. A+ to F grade, score and the exact headers to add.

- **URL**: https://apify.com/larkmoor/website-security-headers-checker.md
- **Developed by:** [Larkmoor Data](https://apify.com/larkmoor) (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 $1.70 / 1,000 website checkeds

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/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

## Website Security Headers & SSL Checker (Bulk, A+ to F)

Check the security headers, HTTPS setup and SSL certificate of hundreds or thousands of websites in one run. For every site you get each HTTP security header with its value, whether `http://` redirects to `https://`, HSTS age and preload, cookie flags, server version leaks, the negotiated TLS protocol, the certificate issuer and how many days it has left. Each site gets a 0-100 score, an A+ to F grade, a list of issues and the exact header lines to add.

It is a passive check: one normal visit to the page you give, one to its `http://` version, a TLS handshake and (optionally) the public `/.well-known/security.txt` file. No port scanning, no attack payloads, no login.

### What you can use it for

- **Agencies and freelancers**: audit every client site in one go and send each client the fixes column.
- **Security and compliance reviews**: vendor risk questionnaires, SOC 2 / ISO 27001 evidence, cyber-insurance checks of a domain list.
- **Certificate expiry monitoring**: schedule a daily run and catch certificates that expire in the next 15 days before the browser warning does.
- **Developers and DevOps**: check staging and production after a deploy or a CDN change.
- **Sales prospecting**: find companies whose site is missing basic protections and offer the fix.

### What it checks

| Area | What you get | Weight |
|---|---|---|
| HTTPS | site ends on HTTPS, `http://` redirects to `https://` | 20 |
| HSTS | header value, max-age in days, includeSubDomains, preload | 15 |
| Content-Security-Policy | value, report-only, `'unsafe-inline'` scripts | 20 |
| Clickjacking | X-Frame-Options or CSP `frame-ancestors` | 10 |
| X-Content-Type-Options | `nosniff` | 10 |
| Referrer-Policy, Permissions-Policy | values | 5 + 5 |
| Information leaks | version numbers in Server, X-Powered-By, X-AspNet-Version, X-Generator | 5 |
| Cookies | Secure, HttpOnly and SameSite per cookie set on the page | 5 |
| TLS and certificate | protocol (TLS 1.2 / 1.3), issuer, valid-from, expiry, days left, hostname match, verification error | 5 |
| security.txt | present with a Contact line (informational) | - |

Also returned: Cross-Origin-Opener-Policy and Cross-Origin-Resource-Policy values, the final URL and status code, and the certificate's alternative names.

Grades: A+ = 95+, A = 85+, B = 70+, C = 55+, D = 40+, F below.

### Why this one

- Built for lists: thousands of sites per run with free rows for sites that are down, instead of a one-site-at-a-time web form.
- Every header value is in the output, not only a letter grade, so you can paste the evidence into a report.
- The fixes column gives the exact header line to add, ready for your web server, CDN or hosting panel.
- Certificate expiry and TLS protocol come from a real handshake, so you can use the same run as an SSL expiry monitor.

### Input

- **Websites**: one per line. `example.com` is checked as `https://example.com/`.
- **Only report sites with problems**: skip A+ sites (not charged).
- **Check security.txt**: on by default.
- **Max sites, parallel checks, timeout**: safe defaults.

```json
{
  "urls": ["https://apify.com", "stripe.com", "example.com"],
  "onlyProblems": false
}
```

### Output

One row per site. Example (shortened):

```json
{
  "host": "example.com",
  "grade": "F",
  "score": 26,
  "httpsFinal": true,
  "httpRedirectsToHttps": false,
  "hsts": null,
  "contentSecurityPolicy": null,
  "xFrameOptions": null,
  "tlsVersion": "TLSv1.3",
  "certIssuer": "SSL Corporation",
  "certExpires": "2026-12-25",
  "certDaysLeft": 47,
  "issues": ["http:// does not redirect to https://", "No Strict-Transport-Security header", "No Content-Security-Policy"],
  "fixes": ["Redirect every http:// request to https:// with a 301", "Strict-Transport-Security: max-age=31536000; includeSubDomains"],
  "summary": "F (26/100): http:// does not redirect to https://; ..."
}
```

Export as CSV, Excel, JSON or HTML, or read the dataset through the API. The table view shows grade, score, HTTPS, redirect, HSTS days, CSP, X-Frame-Options, TLS version, issuer, certificate days left and the summary.

### Cost

You pay per website checked: **$2 per 1,000 websites** (less on higher Apify plans). Sites that cannot be reached are returned free, and with "Only report sites with problems" the A+ sites are free too.

- 100 sites: about $0.20
- 1,000 sites: about $2
- 10,000 sites: about $20

A run of 1,000 sites usually takes 5-10 minutes at the default settings.

### FAQ

**Is this legal?** Yes. It reads the same response headers and certificate that every browser receives when it opens the page. It does not probe for vulnerabilities, guess paths, scan ports or send attack strings.

**Why does a site get a different grade from other tools?** Every tool weighs headers differently. We count only what clearly reduces risk and show every value, so you can see exactly why a site lost points.

**Does it check every page?** It checks the URL you give (after redirects). Headers are usually the same across a site; add more URLs of the same site to compare sections.

**Can I monitor certificate expiry?** Yes: save the input as a task, schedule it daily, and filter on `certDaysLeft` below 15, or connect a webhook / Slack integration.

**What about sites behind Cloudflare or other CDNs?** They are checked as the public sees them, which is what matters for visitors.

### Integrations

Run it from the Apify API or CLI, schedule it, and send results to Google Sheets, Slack, Make, Zapier, n8n or a webhook.

### Changelog

- **0.1** (Nov 8, 2026): first release: HTTPS and redirect, HSTS, CSP (incl. unsafe-inline), clickjacking, nosniff, Referrer-Policy, Permissions-Policy, COOP/CORP, version leaks, cookie flags, TLS protocol and certificate expiry, security.txt, A+ to F grade, issues and fixes, free rows for unreachable sites.

# Actor input Schema

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

Websites to check, one per line (example.com or https://example.com/page). One normal visit per site.

## `onlyProblems` (type: `boolean`):

Skip sites that grade A+ (they are not charged).

## `checkSecurityTxt` (type: `boolean`):

Also look for the public /.well-known/security.txt contact file (RFC 9116).

## `maxSites` (type: `integer`):

Upper limit of sites checked in this run.

## `concurrency` (type: `integer`):

Sites checked at the same time.

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

How long to wait for each site to answer.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://stripe.com",
    "https://example.com",
    "https://books.toscrape.com"
  ],
  "onlyProblems": false,
  "checkSecurityTxt": true,
  "maxSites": 5000,
  "concurrency": 8,
  "timeoutSecs": 15
}
```

# Actor output Schema

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

One row per website in the run's default dataset (CSV/Excel/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 = {
    "urls": [
        "https://apify.com",
        "https://stripe.com",
        "https://example.com",
        "https://books.toscrape.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("larkmoor/website-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://apify.com",
        "https://stripe.com",
        "https://example.com",
        "https://books.toscrape.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("larkmoor/website-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://apify.com",
    "https://stripe.com",
    "https://example.com",
    "https://books.toscrape.com"
  ]
}' |
apify call larkmoor/website-security-headers-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,larkmoor/website-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/gepM4FqYLdzY1Ouor/builds/ag1lCl03tRf4KUXuf/openapi.json
