# Website Security Audit API

> Website security audit: headers, CSP, cookies, SSL/TLS and HTTPS, graded A+ to F with fixes.

**One call tells you what an attacker sees first, and how to close it.** Send a domain and get a **grade from A+ to F**, every finding explained, and the **exact fix**: the header line to send, the **nginx** and **Apache** directives, and where to click in **Cloudflare**. Security headers, cookies, HTTPS, the TLS certificate and protocol versions, all in one answer, from **$0.0004 per audit**: hundreds of times cheaper than the popular security audit API.

- Host: `website-security-audit-headers-ssl-grade.p.rapidapi.com`
- Base URL: `https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit`
- Auth: headers `X-RapidAPI-Key` and `X-RapidAPI-Host`
- OpenAPI: https://helenis-api.com/docs/site-audit/openapi.json

## Endpoints

### Security Audit

Full audit of a website, or up to 10, graded A+ to F.

#### Audit Website Security

`GET /v1/site-audit/audit`

Full security audit of a website, graded A+ to F, with fixes. Audit a website's security, graded A+ to F: headers (CSP, HSTS...), cookies, version disclosure, HTTPS redirect, mixed content, TLS certificate and versions, security.txt. Each finding has its fix (header, nginx, Apache, Cloudflare). 400 `site_unreachable` (not billed). 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `url` | query | `string` | yes | Website: a domain (`example.com`) or a page URL. | `https://www.wikipedia.org` |

```bash
curl -G "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit" \
  --data-urlencode "url=w3.org" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com"
```

#### Audit Websites in Bulk

`POST /v1/site-audit/audit/bulk`

Audit up to 10 websites in one call. The same audit for up to 10 websites, run in parallel, in order. A site that cannot be reached gets its `error` and is not billed. 1 credit per website audited.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `urls` | body | `string[]` | yes | Websites (domains or URLs), 10 at most. | `["github.com", "http://neverssl.com", "expired.badssl.com"]` |

```bash
curl -X POST "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit/bulk" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "github.com",
      "http://neverssl.com",
      "expired.badssl.com"
    ]
  }'
```

### Headers

Security headers and cookies of a page, or of headers you paste.

#### Check Security Headers

`GET /v1/site-audit/headers`

Grade the security headers and cookies of one page. One request to the page: security headers, cookies, version disclosure and mixed content, graded, with fixes and a starter Content-Security-Policy built from what the page loads. Faster than the full audit (no TLS, no files). 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `url` | query | `string` | yes | Website: a domain (`example.com`) or a page URL. | `https://www.wikipedia.org` |

```bash
curl -G "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers" \
  --data-urlencode "url=https://www.wikipedia.org" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com"
```

#### Analyze Security Headers

`POST /v1/site-audit/headers/analyze`

Grade response headers you paste (staging, CI). Grade a set of response headers without fetching anything: paste the output of `curl -I`, or send them as a JSON object. For staging servers, intranets and CI pipelines that the internet cannot reach. 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `headers` | body | `object` | no | Response headers, name -> value (a list for several Set-Cookie lines). |  |
| `raw` | body | `string` | no | Or the raw header block, as printed by `curl -I`. |  |
| `https` | body | `boolean` | no | Whether the page is served over HTTPS (HSTS applies). Default `True`. |  |

```bash
curl -X POST "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers/analyze" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "https": true,
    "raw": "HTTP/2 200\ncontent-type: text/html\nserver: nginx/1.18.0\nx-frame-options: SAMEORIGIN\nset-cookie: session=abc; Path=/; HttpOnly"
  }'
```

### TLS

Certificate validity and expiry, and TLS versions accepted.

#### Check TLS and Certificate

`GET /v1/site-audit/tls`

Certificate validity and expiry, and TLS versions accepted. Certificate (trusted chain, name, issuer, days left, key) and the protocol versions the server accepts on port 443: TLS 1.0 and 1.1 (deprecated), 1.2 and 1.3, graded with fixes. 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `host` | query | `string` | yes | Host name, or any URL of it. | `www.wikipedia.org` |

```bash
curl -G "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/tls" \
  --data-urlencode "host=www.wikipedia.org" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com"
```

## Sample call

Audit Website Security: `GET /v1/site-audit/audit`.

```bash
curl -G "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit" \
  --data-urlencode "url=w3.org" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com"
```

## Response

```json
{
  "url": "https://w3.org/",
  "final_url": "https://www.w3.org/",
  "status_code": 200,
  "grade": "B",
  "score": 75,
  "summary": { "passed": 13, "warnings": 3, "failed": 0, "info": 4 },
  "checks": [
    {
      "id": "csp",
      "category": "headers",
      "title": "Content-Security-Policy",
      "status": "warn",
      "points": -15,
      "value": "frame-ancestors 'self' https://cms.w3.org/ https://cms-dev.w3.org/; upgrade-insecure-requests",
      "message": "CSP is weak: no default-src or script-src: scripts are not restricted.",
      "fix": {
        "header": "Content-Security-Policy: frame-ancestors 'self' https://cms.w3.org/ https://cms-dev.w3.org/; upgrade-insecure-requests; default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' https:; object-src 'none'; base-uri 'self'; form-action 'self'",
        "nginx": "add_header Content-Security-Policy \"frame-ancestors 'self' ...\" always;",
        "apache": "Header always set Content-Security-Policy \"frame-ancestors 'self' ...\"",
        "cloudflare": "Rules › Transform Rules › Modify Response Header › Set static header: Content-Security-Policy = ...",
        "note": "Your directives, plus a script policy built from what this page loads. Deploy it first as Content-Security-Policy-Report-Only."
      }
    },
    {
      "id": "referrer_policy",
      "category": "headers",
      "title": "Referrer-Policy",
      "status": "warn",
      "points": -5,
      "message": "No Referrer-Policy: set one so full URLs (and what they carry) are not sent to other sites.",
      "fix": {
        "header": "Referrer-Policy: strict-origin-when-cross-origin",
        "nginx": "add_header Referrer-Policy \"strict-origin-when-cross-origin\" always;",
        "apache": "Header always set Referrer-Policy \"strict-origin-when-cross-origin\"",
        "cloudflare": "Rules › Transform Rules › Modify Response Header › Set static header: Referrer-Policy = strict-origin-when-cross-origin"
      }
    },
    {
      "id": "certificate",
      "category": "tls",
      "title": "TLS certificate",
      "status": "pass",
      "points": 0,
      "value": "Google Trust Services, expires 2027-02-02",
      "message": "Valid and trusted, 69 days left."
    },
    {
      "id": "tls_versions",
      "category": "tls",
      "title": "TLS protocol versions",
      "status": "pass",
      "points": 0,
      "value": "TLS 1.2, TLS 1.3",
      "message": "Only TLS 1.2 and 1.3."
    },
    {
      "id": "http_redirect",
      "category": "https",
      "title": "HTTP to HTTPS redirect",
      "status": "pass",
      "points": 0,
      "value": "https://www.w3.org/",
      "message": "http:// redirects to HTTPS (301)."
    },
    {
      "id": "hsts",
      "category": "headers",
      "title": "Strict-Transport-Security (HSTS)",
      "status": "pass",
      "points": 0,
      "value": "max-age=15552000; includeSubdomains; preload",
      "message": "HSTS for 180 days."
    },
    { "...": "14 more checks" }
  ],
  "headers": {
    "strict-transport-security": "max-age=15552000; includeSubdomains; preload",
    "content-security-policy": "frame-ancestors 'self' https://cms.w3.org/ https://cms-dev.w3.org/; upgrade-insecure-requests",
    "x-content-type-options": "nosniff",
    "server": "cloudflare",
    "content-type": "text/html; charset=UTF-8"
  },
  "cookies": [
    { "name": "__cf_bm", "secure": true, "http_only": true, "same_site": "None" }
  ],
  "redirects": [
    { "url": "https://w3.org/", "status": 301, "location": "https://www.w3.org/" }
  ],
  "http_redirects": [
    { "url": "http://w3.org/", "status": 301, "location": "https://www.w3.org/" }
  ],
  "fixes": {
    "nginx": "# Content-Security-Policy\nadd_header Content-Security-Policy \"...\" always;\n# Referrer-Policy\nadd_header Referrer-Policy \"strict-origin-when-cross-origin\" always;\n# Permissions-Policy\nadd_header Permissions-Policy \"camera=(), microphone=(), geolocation=(), payment=(), usb=()\" always;",
    "apache": "# Content-Security-Policy\nHeader always set Content-Security-Policy \"...\"\n# Referrer-Policy\nHeader always set Referrer-Policy \"strict-origin-when-cross-origin\"\n...",
    "cloudflare": [
      "Rules › Transform Rules › Modify Response Header › Set static header: Referrer-Policy = strict-origin-when-cross-origin",
      "..."
    ]
  },
  "tls": {
    "certificate": {
      "domain": "w3.org",
      "valid": true,
      "issuer": "WE1",
      "issuer_organization": "Google Trust Services",
      "names": ["w3.org", "*.w3.org"],
      "valid_until": "2027-02-02T05:48:26Z",
      "days_remaining": 69,
      "key": "EC 256",
      "protocol": "TLSv1.3"
    },
    "protocols": { "tls_1_0": false, "tls_1_1": false, "tls_1_2": true, "tls_1_3": true }
  },
  "files": {
    "security_txt": { "found": false, "has_contact": false, "signed": false },
    "robots_txt": { "found": true, "url": "https://www.w3.org/robots.txt", "sitemaps": 0 }
  },
  "notes": [
    "The page has 3 inline script(s): give them a nonce or move them to files before enforcing a strict CSP.",
    "Headers checked on https://www.w3.org/, where the site redirects."
  ],
  "checked_at": "2026-11-24T20:14:18Z"
}
```

*From a real response, shortened.* `checks` come worst first (`fail`, `warn`, `info`, `pass`), so `checks[0]` is always the first thing to fix.

## Why developers pick this API

- 🔧 **Fixes, not just findings:** every failed check carries the line to copy for nginx, Apache and Cloudflare, plus one block with all of them.
- 📐 **A grade you can explain:** a documented scale (below), points per check, and caps for what really matters (no HTTPS, an invalid certificate, TLS 1.0).
- 💸 **Priced for monitoring:** $0.0004 per audit on PRO and $0.00015 on MEGA, where the popular security audit API charges $0.05 to $0.25 per request. Failed calls (unreachable sites) use 0 credits.
- 🧪 **Works before you deploy:** `/headers/analyze` grades the output of `curl -I` from a staging server the internet cannot reach.

## How the grade works

The score starts at **100** and each check adds its `points`:

| Check | Points |
|---|---|
| No Content-Security-Policy, or report-only | -20 |
| Weak CSP (no script restriction, `'unsafe-inline'`, wildcards, `'unsafe-eval'`) | -5 to -15 |
| No HSTS, or max-age=0 / HSTS under 180 days | -20 / -10 |
| http:// serves the page instead of redirecting | -20 |
| No clickjacking protection (X-Frame-Options or `frame-ancestors`) | -15 |
| Certificate renewal overdue / due | -15 / -5 |
| Cookies without Secure | -10 |
| Script, style or frame loaded over http:// | -10 |
| TLS 1.0 or 1.1 accepted | -10 |
| No nosniff, no Referrer-Policy, no Permissions-Policy, version disclosure, cookies without HttpOnly, no TLS 1.3 | -5 each |
| HSTS preload-ready, strict CSP (nonces or hashes, `object-src 'none'`, `base-uri`) | +5 each |

**A+** 100 or more with no failure and no warning, **A** 90, **B** 75, **C** 60, **D** 45, **F** below. Caps: no working HTTPS or an invalid certificate is **F**; TLS 1.0 or 1.1 accepted is **B** at best. COOP, CORP, COEP, `security.txt` and `robots.txt` are advice (`info`, 0 points).

## Grade headers you paste

```bash
curl -X POST "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers/analyze" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" -H "X-RapidAPI-Host: website-security-audit-headers-ssl-grade.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{"raw": "HTTP/2 200\nserver: nginx/1.18.0\nx-frame-options: SAMEORIGIN\nset-cookie: session=abc; Path=/; HttpOnly"}'
```

Nothing is fetched: the API grades the block you send (the output of `curl -I`, or a JSON object of headers). Fail a CI job when the grade drops below B, before the release reaches production.

## TLS only

`GET /v1/site-audit/tls?host=w3.org` returns the certificate (valid, issuer, names, days left, key) and the protocol versions with their own grade: a quick expiry and TLS-hygiene monitor.

## Errors

| Status | `code` | Meaning |
|---|---|---|
| 400 | `invalid_url` | Not a website address, a non-standard port, or a private address. |
| 400 | `invalid_domain` | An IP address or a public suffix instead of a domain name. |
| 400 | `site_unreachable` | The website did not answer over HTTPS or HTTP. Not billed. |
| 400 | `invalid_request` | No headers to analyse, or more than 10 websites in a bulk call. |
| 429 | `daily_limit_reached` | Daily safety limit of your plan; resets at 00:00 UTC. |

## Pricing

1 credit per website audited. Failed calls are never billed.

| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 10 / day | resets every day |
| PRO | $3.99/month | 10,000 / month | $0.004 per credit |
| ULTRA | $9.99/month | 50,000 / month | $0.004 per credit |
| MEGA | $29.99/month | 200,000 / month | $0.004 per credit |

Apify actor **Website Security Audit - Bulk Headers, SSL & Grade**: billed per event; free-plan users get 25 websites per run.

| Event | Charged for | Price |
|---|---|---|
| `site-audited` | each website audited | $0.0015 |

## Links

- API reference (HTML): https://helenis-api.com/docs/site-audit
- OpenAPI: https://helenis-api.com/docs/site-audit/openapi.json
- Overview and pricing: https://helenis-api.com/apis/site-audit/
- RapidAPI listing: https://rapidapi.com/helenis-api-helenis-api-data/api/website-security-audit-headers-ssl-grade?utm_source=helenis&utm_medium=site&utm_campaign=site-audit&utm_content=markdown
- Apify actor: https://apify.com/helenisapi/website-security-audit-bulk?utm_source=helenis&utm_medium=site&utm_campaign=site-audit&utm_content=markdown
- MCP server (Apify): https://mcp.apify.com?tools=helenisapi/website-security-audit-bulk

MCP: Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify (your Apify token).

## Conventions (every Helenis API)

- Auth: two headers on every call, `X-RapidAPI-Key` (your key) and `X-RapidAPI-Host` (the API's host). One RapidAPI key works for every API you subscribe to.
- Billing in credits: one for a simple call, more for heavier work (a minute of audio, a page read by AI). Each API states its rule.
- Failed calls are never billed: a `4xx` bills zero credits and a `5xx` is never counted.
- Errors share one envelope: `{"error": {"status", "code", "message"}}` with a stable machine-readable `code`.
- `400`: fix the input (validation errors are always 400, never 422); not billed.
- `429`: rate limit; wait for `Retry-After`. `503`: temporary upstream or AI failure (`ai_error`, `upstream_timeout`); retry later, not billed.
- Values the source does not give come back as `null`, never invented.
