API reference
Website Security Audit API
Website security audit: headers, CSP, cookies, SSL/TLS and HTTPS, graded A+ to F with fixes.
- Host
website-security-audit-headers-ssl-grade.p.rapidapi.com- Base path
/v1/site-audit- Auth
X-RapidAPI-Key,X-RapidAPI-Host- For agents
openapi.json·site-audit.md
Overview and pricing · Tutorial: Security Headers Checker · RapidAPI playground (opens in a new tab) ↗ · Apify actor (opens in a new tab) ↗
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 | Description |
|---|---|---|---|
url required |
query | string |
Website: a domain (`example.com`) or a page URL. |
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"
import requests
url = "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit"
params = {
"url": "w3.org"
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
}
r = requests.get(url, params=params, headers=headers)
print(r.json())
const res = await fetch("https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit?url=w3.org", {
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
},
});
console.log(await res.json());
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 | Description |
|---|---|---|---|
urls required |
body | string[] |
Websites (domains or URLs), 10 at most. |
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"
]
}'
import requests
url = "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit/bulk"
payload = {
"urls": [
"github.com",
"http://neverssl.com",
"expired.badssl.com"
]
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
}
r = requests.post(url, json=payload, headers=headers)
print(r.json())
const res = await fetch("https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/audit/bulk", {
method: "POST",
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
"Content-Type": "application/json",
},
body: JSON.stringify({
"urls": [
"github.com",
"http://neverssl.com",
"expired.badssl.com"
]
}),
});
console.log(await res.json());
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 | Description |
|---|---|---|---|
url required |
query | string |
Website: a domain (`example.com`) or a page URL. |
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"
import requests
url = "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers"
params = {
"url": "https://www.wikipedia.org"
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
}
r = requests.get(url, params=params, headers=headers)
print(r.json())
const res = await fetch("https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers?url=https://www.wikipedia.org", {
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
},
});
console.log(await res.json());
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 | Description |
|---|---|---|---|
headers |
body | object |
Response headers, name -> value (a list for several Set-Cookie lines). |
raw |
body | string |
Or the raw header block, as printed by `curl -I`. |
https |
body | boolean |
Whether the page is served over HTTPS (HSTS applies). Default True. |
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"
}'
import requests
url = "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers/analyze"
payload = {
"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"
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
}
r = requests.post(url, json=payload, headers=headers)
print(r.json())
const res = await fetch("https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/headers/analyze", {
method: "POST",
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
"Content-Type": "application/json",
},
body: JSON.stringify({
"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"
}),
});
console.log(await res.json());
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 | Description |
|---|---|---|---|
host required |
query | string |
Host name, or any URL of it. |
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"
import requests
url = "https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/tls"
params = {
"host": "www.wikipedia.org"
}
headers = {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
}
r = requests.get(url, params=params, headers=headers)
print(r.json())
const res = await fetch("https://website-security-audit-headers-ssl-grade.p.rapidapi.com/v1/site-audit/tls?host=www.wikipedia.org", {
headers: {
"X-RapidAPI-Key": "YOUR_API_KEY",
"X-RapidAPI-Host": "website-security-audit-headers-ssl-grade.p.rapidapi.com",
},
});
console.log(await res.json());
Response
{
"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/analyzegrades the output ofcurl -Ifrom 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
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. |
Use it from an AI agent
Add this MCP server and the Website Security Audit - Bulk Headers, SSL & Grade actor becomes a tool your agent can call. Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify.
https://mcp.apify.com?tools=helenisapi/website-security-audit-bulk
Prefer plain HTTP? Give your agent the OpenAPI document or the Markdown reference.