apyhub
SECURITY & PRIVACY · SEO

Security Headers Audit API

What it does

Security Headers Audit checks a webpage URL and returns a compact audit of common browser security headers. Send an http or https URL, and get back a score plus boolean flags for whether the page sends CSP, HSTS, X-Content-Type-Options, Referrer-Policy, and X-Frame-Options.

Use it when you need a quick security review during deployment, a CI gate for public pages, or a lightweight compliance check across a list of URLs. The response is easy to inspect programmatically: the score gives you the overall result, details provides additional string-based findings, and the header-specific fields tell you exactly which protections are present.

Security Headers Audit is useful for spotting missing baseline protections before they reach production. It helps developers verify that important response headers are configured on landing pages, app shells, login screens, and other internet-facing endpoints without manually opening browser tools.

Because the input is just a webpage URL, you can plug it into automated checks, internal audits, or scheduled monitoring workflows where you need a fast yes/no view of header coverage.

POST
Security Headers Audit
http://localhost:8080/chisleroff/security-headers-audit
QUICKSTARTGUIDE

Quickstart

Send the webpage URL you want audited in a JSON body.

curl -X POST "http://localhost:8080/chisleroff/security-headers-audit" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://apyhub.com"}'

What you'll get back

Returns a JSON object with these top-level fields:

  • score (string)
  • details (object with string values)
  • has_csp (boolean)
  • has_hsts (boolean)
  • has_x_content_type (boolean)
  • has_referrer_policy (boolean)
  • has_x_frame_options (boolean)

Example response:

{
  "has_hsts": true,
  "has_csp": false,
  "has_x_frame_options": true,
  "has_x_content_type": true,
  "has_referrer_policy": true,
  "score": "B",
  "details": {
    "strict-transport-security": "max-age=31536000; includeSubDomains; preload",
    "content-security-policy": "Missing",
    "x-frame-options": "DENY",
    "x-content-type-options": "nosniff",
    "referrer-policy": "no-referrer-when-downgrade"
  }
}
TRY ITLIVE · 100 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
URL of the webpage to extract, audit, or validate content from (http/https only).

About this endpoint

What it does

Audits the security headers present on the webpage at the given URL and returns a JSON object describing the audit result. The response includes a score, a details object, and booleans indicating whether specific headers were found.

Request Body

ParameterTypeMandatoryDescription
urlStringYesURL of the webpage to extract, audit, or validate content from. Must be an http or https URI.

Response

Returns a JSON object with a score string, a details object whose values are strings, and boolean flags for the presence of specific security headers.

ParameterTypeMandatoryDescription
scoreStringNoAudit score returned by the service.
detailsObjectNoA string-to-string map with audit details.
has_cspBooleanNoWhether a Content Security Policy header is present.
has_hstsBooleanNoWhether an HSTS header is present.
has_x_content_typeBooleanNoWhether an X-Content-Type-Options header is present.
has_referrer_policyBooleanNoWhether a Referrer-Policy header is present.
has_x_frame_optionsBooleanNoWhether an X-Frame-Options header is present.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.