# HTTP Security Headers Checker — HSTS, CSP, Grade A-F (`ninhothedev/security-headers-checker`) Actor

$1/1K 🔥 Fast HTTP security headers checker! HSTS, CSP, X-Frame & a grade for any URL. No key. JSON, CSV, Excel or API in seconds. Paste URLs & audit thousands of sites for security & compliance ⚡

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

## Pricing

from $1.00 / 1,000 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/platform/actors/running/actors-in-store#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

## HTTP Security Headers Checker 🛡️

**Check HTTP security headers (HSTS, CSP, X-Frame-Options and more) for any list of URLs and get an instant A–F security grade.** Perfect for security audits, compliance reporting, DevOps pipelines, and continuous website monitoring.

Give the actor a list of URLs and it fetches each one with a real Chrome browser fingerprint, follows redirects, and reports exactly which security headers are present, which are missing, and an overall grade — one clean row per URL.

***

### ✨ What it checks

For every URL the actor inspects the response headers and returns:

| Category | Headers |
|---|---|
| **Core (drive the grade)** | Strict-Transport-Security (HSTS), Content-Security-Policy (CSP), X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy |
| **Informational** | X-XSS-Protection, Cross-Origin-Opener-Policy, Server, X-Powered-By |
| **Cookies** | Whether `Set-Cookie` uses the `Secure` flag |
| **Transport** | Final URL after redirects, HTTP status code, HTTPS detection |

The **grade (A–F)** and **score (0–6)** are computed from how many of the six core headers are present, and `missing_headers[]` lists exactly what to fix.

***

### 🚀 Input

```json
{
  "startUrls": [
    "https://www.apify.com",
    "https://www.github.com"
  ],
  "maxItems": 100
}
```

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | List of website URLs to check. Bare domains are auto-prefixed with `https://`. |
| `maxItems` | integer | Max URLs to process (default 100, max 1000). |

***

### 📤 Output

One item per URL:

```json
{
  "url": "https://www.github.com",
  "final_url": "https://github.com/",
  "status_code": 200,
  "is_https": true,
  "grade": "B",
  "score": 5,
  "hsts": "max-age=31536000; includeSubdomains; preload",
  "csp": "default-src 'none'; ...",
  "x_frame_options": "deny",
  "x_content_type_options": "nosniff",
  "referrer_policy": "origin-when-cross-origin, strict-origin-when-cross-origin",
  "permissions_policy": null,
  "x_xss_protection": "0",
  "cross_origin_opener_policy": "same-origin",
  "server": "GitHub.com",
  "x_powered_by": null,
  "cookies_secure": true,
  "missing_headers": ["Permissions-Policy"],
  "scraped_at": "2026-07-03T09:00:00+00:00"
}
```

***

### 💡 Use cases

- **Security audit** — quickly grade dozens of properties and get a prioritized list of missing headers.
- **Compliance** — evidence for SOC 2 / ISO 27001 / PCI reviews that HSTS and CSP are deployed.
- **DevOps / CI** — fail a pipeline when a deploy drops a header or downgrades HTTPS.
- **Monitoring** — schedule a run and alert when a site's grade regresses.

***

### 💰 Pricing

Pay-as-you-go, roughly **$1 per 1,000 URLs checked** (input) plus platform usage. Each input URL produces one output JSON item, so cost scales linearly and predictably with the number of URLs you scan.

***

### 🔍 Comparison

| | This actor | DIY curl script | Web-based scanners |
|---|---|---|---|
| Bulk URLs | ✅ up to 1,000/run | ⚠️ manual loop | ❌ one at a time |
| Structured JSON | ✅ | ⚠️ parse yourself | ⚠️ export limited |
| A–F grade + missing list | ✅ | ❌ | ✅ |
| Browser fingerprint (avoids blocks) | ✅ Chrome 124 | ❌ | varies |
| Scheduling / API / integrations | ✅ Apify | ❌ | ⚠️ |

***

### 🔗 Related actors

- [SSL Certificate Checker](https://apify.com/ninhothedev/ssl-certificate-checker)
- [DNS Records Scraper](https://apify.com/ninhothedev/dns-records-scraper)
- [Website Tech Stack Detector](https://apify.com/ninhothedev/website-tech-stack-detector)
- [SEO On-Page Auditor](https://apify.com/ninhothedev/seo-onpage-auditor)

***

### 🛟 Support

Questions or a header you'd like added? Open an issue or contact us through the Apify actor page — we respond fast.

***

**Keywords:** security headers checker, HSTS checker, CSP checker, X-Frame-Options, HTTP security scanner, security grade, header audit, website security scanner, referrer-policy, permissions-policy, compliance, devops security.

# Actor input Schema

## `startUrls` (type: `array`):

List of website URLs to scan for HTTP security headers. Each URL is fetched with a real browser fingerprint, redirects are followed, and the final response headers are analysed.

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

Maximum number of URLs to process from the list. Protects you from accidentally running very large jobs.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.apify.com",
    "https://www.github.com"
  ],
  "maxItems": 100
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("ninhothedev/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 = { "startUrls": [
        "https://www.apify.com",
        "https://www.github.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ninhothedev/security-headers-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.apify.com",
    "https://www.github.com"
  ]
}' |
apify call ninhothedev/security-headers-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=ninhothedev/security-headers-checker",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/yH6AfoB7dxZ1DIb45/builds/XCQao7AC8eEJDvdjs/openapi.json
