Skip to content
RU

securityheaders.com API replacement

Same request, same JSON, same X-Grade. Change the host and your CI check keeps grading security headers. Free, no API key.

Updated

What happened. securityheaders.com (now run by Snyk, which bought its operator Probely in November 2024) stopped selling and renewing API subscriptions in April 2025 — its API page reads This service has been discontinued (current page, first archived 18 Apr 2025). Keys that were not renewed run out; several migration write-ups put the end at April 2026. The free X-Grade on the result page has required a key since May 2023.

Migrate: change the host

Query parameters, JSON keys and response headers are the old ones. Drop the key header.

Old · discontinued removed
curl -H "x-api-key: $KEY" "https://api.securityheaders.com/?q=example.com&hide=on&followRedirects=on"
New · no key
curl "https://enterno.io/api/securityheaders?q=example.com&hide=on&followRedirects=on"

Scripts that read .summary.grade, compare .status == "good", or take the grade from the X-Grade header of a HEAD request work unchanged.

Endpoint

GET /api/securityheaders?q=<host|url> no authentication · HEAD supported · CORS *
Parameter Values Meaning
q host or URL, required A bare host is scanned over https. Only http and https on ports 80 and 443; internal, loopback and reserved addresses are refused.
followRedirects on (default) · off on: follow up to 5 redirects and grade the final page. off: grade the first response; a redirect is grade R.
hide on · off Accepted for compatibility. Results are never listed publicly, so it changes nothing.

Errors come back as JSON with a 4xx/5xx status and {"status": "error", "error": "…"}, so a client that checks status == "good" fails cleanly instead of parsing a grade that is not there.

Example response

Built by the endpoint's own code from a sample header set: HSTS, a CSP with 'unsafe-inline' scripts, X-Frame-Options, X-Content-Type-Options, Referrer-Policy; no Permissions-Policy.

Example JSON response 102 lines
{
    "status": "good",
    "summary": {
        "site": "https://example.com",
        "grade": "A",
        "ip": "93.184.215.14",
        "timestamp": "20 Oct 2026 04:00:00 UTC",
        "headers": {
            "Strict-Transport-Security": "green",
            "Content-Security-Policy": "yellow",
            "Permissions-Policy": "red",
            "Referrer-Policy": "green",
            "X-Content-Type-Options": "green",
            "X-Frame-Options": "green"
        },
        "gradeCap": "A",
        "score": 87
    },
    "rawHeaders": [
        {
            "key": "HTTP/2",
            "value": "200",
            "colour": "#696E76"
        },
        {
            "key": "content-type",
            "value": "text/html; charset=utf-8",
            "colour": "#696E76"
        },
        {
            "key": "strict-transport-security",
            "value": "max-age=31536000; includeSubDomains",
            "colour": "green"
        },
        {
            "key": "content-security-policy",
            "value": "default-src 'self'; script-src 'self' 'unsafe-inline'",
            "colour": "yellow",
            "info": "'unsafe-inline' in script-src allows inline scripts (XSS risk)."
        },
        {
            "key": "x-frame-options",
            "value": "SAMEORIGIN",
            "colour": "green"
        },
        {
            "key": "x-content-type-options",
            "value": "nosniff",
            "colour": "green"
        },
        {
            "key": "referrer-policy",
            "value": "strict-origin-when-cross-origin",
            "colour": "green"
        }
    ],
    "missingHeaders": {
        "Permissions-Policy": {
            "missing": "Permissions-Policy decides which browser features (camera, microphone, geolocation …) this page and its frames may use. Recommended: deny the ones you do not use.",
            "key": "Permissions-Policy"
        }
    },
    "validationErrors": {
        "Content-Security-Policy": "'unsafe-inline' in script-src allows inline scripts (XSS risk)."
    },
    "upcomingHeaders": {
        "Cross-Origin-Embedder-Policy": {
            "info": "COEP stops the page from loading cross-origin resources that have not opted in; needed for cross-origin isolation.",
            "key": "Cross-Origin-Embedder-Policy"
        },
        "Cross-Origin-Opener-Policy": {
            "info": "COOP puts the page in its own browsing-context group, so a window it opens cannot reach back into it.",
            "key": "Cross-Origin-Opener-Policy"
        },
        "Cross-Origin-Resource-Policy": {
            "info": "CORP lets a resource say which sites may embed it.",
            "key": "Cross-Origin-Resource-Policy"
        }
    },
    "additionalInformation": {
        "Strict-Transport-Security": {
            "info": "HSTS is set: browsers will only use HTTPS for this host for 31536000 seconds.",
            "colour": "green"
        },
        "Content-Security-Policy": {
            "info": "A Content-Security-Policy is sent.",
            "colour": "yellow"
        }
    },
    "enterno": {
        "url": "https://example.com/",
        "status_code": 200,
        "follow_redirects": true,
        "responses": 1,
        "points": 140,
        "max_points": 160,
        "bot_protected": false,
        "cached": false,
        "methodology": "https://enterno.io/en/securityheaders-api#grading",
        "full_report": "https://enterno.io/en/security?url=https%3A%2F%2Fexample.com"
    }
}

Field mapping

securityheaders.com enterno.io Notes
status status same "good" on success; "error" with an error message otherwise.
summary.site summary.site same The URL scanned (a bare host gets https://).
summary.grade summary.grade same A+ … F, or R for a redirect that was not followed.
summary.ip summary.ip same The address that was connected to.
summary.timestamp summary.timestamp same Same format: "20 Oct 2026 10:00:00 UTC".
summary.headers summary.headers same The six graded headers → green / yellow / red.
summary.gradeCap summary.gradeCap same A when a graded header is missing or weak, else A+.
rawHeaders[] rawHeaders[] same {key, value, colour, info?}; the status line first.
missingHeaders missingHeaders same Header → {missing, key}. Always an object; the old API sometimes sent [] when empty.
validationErrors validationErrors same Header → why it is weak or ignored. Always an object.
upcomingHeaders upcomingHeaders same COEP, COOP, CORP when absent → {info, key}. Not graded.
additionalInformation additionalInformation same Header → {info, colour}. Plain text, not HTML.
X-Grade, X-Score X-Grade, X-Score same Response headers, also on HEAD. X-Score is base64 of {"score","colour"}.
x-api-key — differs Not needed. Sending it does no harm; it is ignored.
— summary.score differs New: the percentage of 160 points behind the grade (null for R).
— enterno differs New: final URL, status code, points, cache flag, link to the full report.

Examples

shell Fail a build below B

GRADE=$(curl -s "https://enterno.io/api/securityheaders?q=example.com&followRedirects=on" | jq -r '.summary.grade')
case "$GRADE" in A+|A|B) echo "headers: $GRADE" ;; *) echo "headers: $GRADE, need B or better"; exit 1 ;; esac

# just the grade, from the response headers
curl -sI "https://enterno.io/api/securityheaders?q=example.com" | grep -i '^x-grade'

JavaScript fetch

const res  = await fetch('https://enterno.io/api/securityheaders?q=' + encodeURIComponent('example.com'));
const data = await res.json();
if (data.status !== 'good') throw new Error(data.error);
console.log(data.summary.grade, Object.keys(data.missingHeaders));

Python requests

import requests

r = requests.get("https://enterno.io/api/securityheaders",
                 params={"q": "example.com", "followRedirects": "on"}, timeout=60)
data = r.json()
if data.get("status") != "good":
    raise SystemExit(data.get("error"))
print(data["summary"]["grade"], list(data["missingHeaders"]))

GitHub Action

A composite action (curl and jq, nothing to install) that grades a URL and fails the job below a minimum grade. It writes the grade and the missing headers to the job summary.

- uses: enterno-io/security-headers-action@v1
  with:
    url: https://example.com
    min-grade: B          # A+, A, B, C, D, E or F
    follow-redirects: true

github.com/enterno-io/security-headers-action — source, README and changelog of the action.

Outputs: grade, score, missing, passed, report (path to the full JSON).

No action at hand? The shell example above is the whole check — it runs in any CI.

How the grade is calculated

The point table and grade bands are the ones securityheaders.com published in January 2023 (Scott Helme):

Item Points
HTTPS 30
Strict-Transport-Security 25
Content-Security-Policy 25
X-Frame-Options 20
X-Content-Type-Options 20
Referrer-Policy 20
Permissions-Policy 20
Total 160
  1. A+ ≥ 95%
  2. A ≥ 75%
  3. B ≥ 60%
  4. C ≥ 50%
  5. D ≥ 29%
  6. E ≥ 14%
  7. F < 14%
  8. R redirect

Percent of the 160 points. R: the first response was a redirect and followRedirects=off.

Where the published method is silent, this is our reading:

  • A header earns its points only if a browser acts on it. X-Content-Type-Options other than nosniff, X-Frame-Options other than DENY/SAMEORIGIN, HSTS with max-age=0 or over plain HTTP: red, no points.
  • A CSP earns its points only if some policy restricts scripts (script-src or default-src). An empty header counts as absent. Several policies are all enforced, so the strictest one decides.
  • CSP frame-ancestors that keeps other sites out stands in for X-Frame-Options, as it did on securityheaders.com.
  • A header that works but weakly is yellow, keeps its points and caps the grade at A: 'unsafe-inline' or 'unsafe-eval' in script-src, HSTS under 180 days, Referrer-Policy: unsafe-url.
  • Unlike securityheaders.com, 'unsafe-inline' in style-src alone does not cap: its risk is CSS injection, not script execution. A site that got A there for that reason gets A+ here.
  • A+ needs all six headers green. An HTTPS site that sends none of them scores 30 of 160 points — grade E.

Grades will not match securityheaders.com's for every site — its finer rules were never published. For a full report (cookies, HTTPS enforcement, information disclosure) use the security scanner.

Limits and fair use

  • 10 requests per minute per IP
  • 300 requests per day per IP
  • 6 / 12 fresh scans per minute of one host / one IP address, for all callers
  • 5 min a result is cached and served again

IPv6 callers are counted per /64. Over a limit the answer is 429 with Retry-After. Each scan is one GET (plus redirects) to the host you name, sent with the User-Agent Mozilla/5.0 (compatible; enterno.io-securityheaders/1.0; +https://enterno.io/en/securityheaders-api), so site owners can see who called.

More volume — hundreds of sites, scheduled checks? Get a free API key and use /api/v4/security or /api/v4/batch: API documentation · plans and limits.

Machine-readable description: OpenAPI, path /securityheaders.