Skip to main content

Security Headers API

free
GET/v1/security/headers

Comprehensive HTTP security-header audit aligned with OWASP Secure Headers Project + CSP Level 3 + CHIPS / Partitioned cookie rules. Evaluates Content-Security-Policy (incl. `strict-dynamic`, nonces, hashes, Trusted Types, reporting endpoints), Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, and Cross-Origin policies (COEP, COOP, CORP). Performs deep cookie analysis — Secure / HttpOnly / SameSite / `__Host-` / `__Secure-` / `Partitioned` (CHIPS). Flags Cache-Control on likely-sensitive endpoints and fingerprints the Server / X-Powered-By software with known-EOL warnings.

What It Does

Fetches the URL with bounded destination-validated redirects and evaluates effective HSTS, CSP, framing, referrer and contextual isolation policies using the same parser as composite reports. First CSP directives and independently enforced policies retain browser semantics. Cookie-setting attempts, reporting declarations and optional error-page observations are separate diagnostics; they do not establish runtime storage, report delivery, exploit resistance or legal compliance.

Why It's Useful

HTTP security headers are your first line of defense against common web attacks including XSS, clickjacking, MIME-sniffing, and protocol downgrade attacks. OWASP, Mozilla Observatory, and compliance frameworks (PCI-DSS 4.0, SOC 2, HIPAA) all recommend these headers. Regular auditing identifies missing headers and conflicting directives so teams can review and remediate their configuration.

Use Cases

Security Engineer

Application Security Audit

Before deployment, verify that all required security headers are properly configured across web applications. Compare results against OWASP Secure Headers Project recommendations.

Catch security header misconfigurations before they reach production.

Compliance Officer

Compliance Verification

Document security header configuration as evidence for PCI-DSS 4.0 Requirement 6.4, SOC 2 CC6.1, or HIPAA Technical Safeguards audits.

Automate compliance evidence collection for security controls.

Security Analyst

Vendor Security Assessment

Evaluate the security posture of third-party vendors and SaaS providers by analyzing their web application security headers as part of vendor risk management.

Assess vendor security without requiring access to their infrastructure.

DevOps Engineer

CI/CD Security Gate

Integrate security header checks into CI/CD pipelines to automatically validate headers after each deployment.

Prevent security regressions with automated header validation.

Parameters

NameLocationTypeRequiredDescription
urlquerystringRequiredThe full URL to analyze (must include https://)Example: https://example.com
follow_redirectsquerystringOptionalWhether to follow HTTP redirects (default: true). Set to "false" to analyze the initial response.Example: true
probequerystringOptionalSet "errors" to request an unlikely-existing path on the same origin. Reports whether an error response, a non-error response or no usable response was observed, with header comparison only for observed error responses.Example: errors

Response Fields

Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.

FieldTypeDescription
urlstringThe original requested URL
final_urlstringThe final URL after redirects
status_codenumberHTTP response status code
headers.presentarraySecurity headers found with name, value, and status (good/warning/present/info)
headers.missingarrayMissing security headers with name, required flag, and description
scoreobjectScoring breakdown: total points, max possible, letter grade (A–F), and percentage
server_infoobject{ server, powered_by, fingerprint }. fingerprint resolves the Server header to a known product/version and flags known-EOL releases.
cookiesobjectResponse-header cookie attributes and static eligibility; actual browser storage and cross-site use are unmeasured. Legacy chips_required is contextual advice, not a universal Partitioned requirement.
cache_controlobjectDelivered cache policy and heuristic sensitivity signals. Set-Cookie alone does not prove sensitive content; storage advice depends on response context.
reportingobjectPhase 2: parses Report-To, Reporting-Endpoints, and NEL headers. CSP reporting directives are also recognized; declared destinations do not prove report delivery. Flags non-HTTPS reporting URLs.
error_page_probeobject | nullOptional probe outcome: observed error response, non-error response or unavailable. Header differences apply only to the actual observed error response and do not establish all-error-page coverage.
recommendationsarrayPrioritized remediation recommendations
breakdownobjectPer-header scoring contributions.
status_warningstring|nullWarning when the response may be an HTTP error page.

Code Examples

Replace YOUR_API_KEY with your API key. This endpoint requires the free plan or higher; see plans and usage limits.

cURL
curl --request GET 'https://api.edgedns.dev/v1/security/headers?url=https%3A%2F%2Fexample.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
const response = await fetch(
  "https://api.edgedns.dev/v1/security/headers?url=https%3A%2F%2Fexample.com",
  {
    "method": "GET",
    "headers": {
      "Authorization": "Bearer YOUR_API_KEY"
    }
  }
);

if (!response.ok) {
  throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    'GET',
    "https://api.edgedns.dev/v1/security/headers?url=https%3A%2F%2Fexample.com",
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)

Read the full Security Headers guide

Learn the concepts, choose a practical workflow, and interpret the observations from Security Headers before acting on them. Run supported checks via MCP or through REST.

Read the guide →

Related Endpoints

External References

Learn more about the standards and protocols behind this endpoint.

Try This Endpoint

Test the Security Headers endpoint live in the playground.

Security Headers API Reference | EdgeDNS