# Website Security Headers & SSL Certificate Check (`kacperor/website-security-headers-check`) Actor

Bulk-audit websites for security headers (HSTS, CSP, X-Frame-Options, nosniff, Referrer-Policy), HTTPS redirect, cookie flags, exposed software versions and SSL certificate expiry. Grade A–F with a fix list.

- **URL**: https://apify.com/kacperor/website-security-headers-check.md
- **Developed by:** [Kacper Kruszka](https://apify.com/kacperor) (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

$3.00 / 1,000 websites

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

## Website Security Headers & SSL Certificate Check

Audit any number of websites for the basics of web security in one run: **HTTPS redirect, HSTS, Content-Security-Policy, clickjacking protection, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, cookie flags, software versions leaking in headers and the SSL/TLS certificate** (issuer, expiry date, days left, TLS version). Every site gets a score, a grade A–F and a list of fixes in plain language.

Two plain HTTP requests and one TLS handshake per site — no browser, no proxy.

### What you can do with it

- **Agencies and freelancers** — audit a prospect's site before a sales call and show concrete problems.
- **Certificate expiry monitoring** — schedule it daily and filter `certDaysLeft < 14`.
- **Portfolio or supplier checks** — grade hundreds of client or vendor sites in one go.
- **Before and after a deployment** — confirm the headers you configured actually reach visitors.

### Input

| Field | What it does |
|---|---|
| `urls` | Domains or page URLs: `example.com`, `https://shop.example.com/checkout` |
| `maxConcurrency` | Sites checked in parallel (default 5) |

### Output (one row per site)

Real output from a run on 23 Nov 2026 (lists shortened here).

````json
{
  "url": "https://wikipedia.org/",
  "finalUrl": "https://www.wikipedia.org/",
  "status": 200,
  "grade": "D",
  "score": 45,
  "httpsRedirect": true,
  "hsts": true,
  "csp": false,
  "clickjackingProtection": false,
  "certIssuer": "Let's Encrypt",
  "certExpiresAt": "2027-01-02T18:34:50.000Z",
  "certDaysLeft": 39,
  "tlsProtocol": "TLSv1.3",
  "issues": [
    "No Content-Security-Policy: an injected script (XSS, a hijacked third-party script) runs with full rights.",
    "X-Content-Type-Options: nosniff is missing: browsers may guess file types and run uploaded files as scripts.",
    "Neither X-Frame-Options nor CSP frame-ancestors is set: the site can be framed for clickjacking.",
    "No Referrer-Policy: full page addresses (with any tokens in them) leak to other sites.",
    "No Permissions-Policy: embedded content can ask for camera, microphone or location.",
    "Cookies without Secure or HttpOnly: GeoIP, NetworkProbeLimit.",
    "Software versions exposed in headers: server: ATS/9.2.16."
  ],
  "headers": {
    "strict-transport-security": "max-age=106384710; includeSubDomains; preload",
    "content-security-policy": null,
    "x-content-type-options": null,
    "x-frame-options": null,
    "referrer-policy": null,
    "permissions-policy": null,
    "server": "ATS/9.2.16",
    "x-powered-by": null
  },
  "cookies": [
    {
      "name": "WMF-Last-Access",
      "secure": true,
      "httpOnly": true,
      "sameSite": null
    },
    {
      "name": "WMF-Last-Access-Global",
      "secure": true,
      "httpOnly": true,
      "sameSite": null
    }
  ],
  "certificate": {
    "issuer": "Let's Encrypt",
    "subject": "*.wikipedia.org",
    "validFrom": "2026-10-04T18:34:51.000Z",
    "validTo": "2027-01-02T18:34:50.000Z",
    "daysLeft": 39,
    "trusted": true,
    "trustError": null,
    "protocol": "TLSv1.3",
    "altNames": [
      "*.m.mediawiki.org",
      "*.m.wikibooks.org",
      "*.m.wikidata.org"
    ]
  },
  "checkedAt": "2026-11-23T21:54:21.204Z",
  "error": null
}```

### What is checked

| Check | Why it matters |
|---|---|
| HTTPS redirect | `http://` should send visitors to `https://` |
| HSTS (≥ 180 days) | Browsers stop trying plain HTTP |
| Content-Security-Policy | Limits what an injected script can do |
| X-Frame-Options or CSP `frame-ancestors` | Blocks clickjacking |
| X-Content-Type-Options `nosniff` | Stops content-type guessing |
| Referrer-Policy, Permissions-Policy | Less data leaked, fewer browser features exposed |
| Cookies | `Secure` and `HttpOnly` flags |
| Server / X-Powered-By | Version numbers help attackers pick exploits |
| Certificate | Issuer, expiry, days left, TLS version, trust |

### Limits

The check looks at the response headers of the page you give it. It is not a vulnerability scanner and it does not crawl the site.

### Pricing

Pay per event: you pay only for sites checked and saved to the dataset.



# Actor input Schema

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

Domains or page URLs, e.g. example.com or https://shop.example.com/checkout.
## `maxConcurrency` (type: `integer`):

How many sites are checked at once.

## Actor input object example

```json
{
  "urls": [
    "github.com",
    "apify.com"
  ],
  "maxConcurrency": 5
}
````

# Actor output Schema

## `results` (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 = {
    "urls": [
        "github.com",
        "apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kacperor/website-security-headers-check").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": [
        "github.com",
        "apify.com",
    ] }

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

```

## MCP server setup

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

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/c0JpNrTNxYAf4Wl5G/builds/aDAB854P2VevXFF2i/openapi.json
