RankParse

Site Health

Real-time domain health check covering HTTPS enforcement, HSTS, www redirect, security headers and robots.txt.

GET/v1/site-health2 credits (refunded on failure)API key

Probes a domain's homepage, robots.txt and sitemap.xml at request time and reports transport and header hygiene: whether plain HTTP redirects to HTTPS, whether HSTS is set, how www. behaves, which security headers the homepage sends, and what robots.txt declares. This is a live check, not link graph data.

Request

Parameters

NameTypeRequiredDefaultDescription
domainstringYesnoneBare domain such as stripe.com. No scheme, path or port. Up to 253 characters, letters, digits, hyphens and dots, with at least one dot.

Example

curl "https://api.rankparse.com/v1/site-health?domain=stripe.com" \
  -H "X-API-Key: rp_your_key"
import requests

resp = requests.get(
    "https://api.rankparse.com/v1/site-health",
    params={"domain": "stripe.com"},
    headers={"X-API-Key": "rp_your_key"},
    timeout=30,
)
resp.raise_for_status()
health = resp.json()["data"]
print(health["https"], health["security_headers"])
const res = await fetch(
  "https://api.rankparse.com/v1/site-health?domain=stripe.com",
  { headers: { "X-API-Key": process.env.RANKPARSE_API_KEY } }
);
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const { data } = await res.json();
console.log(data.https, data.security_headers);

Response

{
  "domain": "stripe.com",
  "data": {
    "domain": "stripe.com",
    "https": {
      "enforced": true,
      "hsts": true,
      "hsts_max_age": 31536000
    },
    "www_redirect": { "enabled": false, "target": null },
    "checks": [
      { "url": "https://stripe.com/", "status": 200, "content_type": "text/html", "response_time_ms": 180 },
      { "url": "https://stripe.com/robots.txt", "status": 200, "content_type": "text/plain", "response_time_ms": 95 },
      { "url": "https://stripe.com/sitemap.xml", "status": 200, "content_type": "application/xml", "response_time_ms": 112 }
    ],
    "security_headers": {
      "x_frame_options": "SAMEORIGIN",
      "x_content_type_options": "nosniff",
      "content_security_policy": true,
      "strict_transport_security": "max-age=31536000; includeSubDomains",
      "referrer_policy": "strict-origin-when-cross-origin"
    },
    "robots_txt": {
      "present": true,
      "disallow_all": false,
      "sitemap_declared": true
    }
  },
  "credits_used": 2,
  "credits_remaining": 998
}

Response fields

FieldTypeDescription
https.enforcedbooleantrue when a request to http://<domain>/ ends up on an https:// URL after redirects. false also when that probe failed.
https.hstsbooleantrue when the homepage response carries a Strict-Transport-Security header.
https.hsts_max_ageinteger or nullThe max-age value in seconds, or null when absent.
www_redirect.enabledbooleantrue when https://www.<domain>/ ends up somewhere that is not a www.<domain> URL (it redirects to the apex). Always false when the input already starts with www..
www_redirect.targetstring or nullFinal URL of the www probe when enabled is true.
checksarrayThree entries, in order: homepage, /robots.txt, /sitemap.xml. Each has url, status (final HTTP status after redirects), content_type (lowercased, without parameters) and response_time_ms.
security_headers.x_frame_optionsstring or nullRaw header value.
security_headers.x_content_type_optionsstring or nullRaw header value.
security_headers.content_security_policybooleantrue when a CSP header is present. The policy itself is not returned.
security_headers.strict_transport_securitystring or nullRaw header value.
security_headers.referrer_policystring or nullRaw header value.
robots_txt.presentbooleantrue when /robots.txt answered 200.
robots_txt.disallow_allbooleanHeuristic: the file contains a Disallow: rule starting with / and a User-agent: * line. It does not parse groups, so it can be true for a file that only disallows a subpath. Read the file yourself when this matters.
robots_txt.sitemap_declaredbooleantrue when the file contains a Sitemap: line.

Behavior and limits

  • What is fetched. One full GET of the HTTPS homepage (8 second timeout, 2 MB cap, up to 5 redirects), HEAD requests for /robots.txt, /sitemap.xml, the plain http:// homepage and https://www.<domain>/ (5 seconds each), and, when robots.txt returns 200, a GET of its body. Security headers and HSTS come from the homepage response.
  • Optional probes degrade quietly. If the robots.txt, sitemap.xml, HTTP or www probe fails or times out, the rest of the report is still returned. A failed checks entry has status, content_type and response_time_ms all null. A failed HTTP probe shows https.enforced: false.
  • HEAD quirks. Some servers answer HEAD differently from GET (for example 405). checks reports what the HEAD request received.
  • Required probe. The HTTPS homepage fetch is required. If it fails, the whole call fails with an error and is refunded.
  • Billing. Costs 2 credits; refunded automatically on any non-2xx response. Malformed or private domains are rejected before billing. Subject to the standard 60 requests per minute limit.

Errors

StatusCodeWhen
400invalid_urldomain is missing, not a bare domain (scheme, path, port or invalid characters), or longer than 253 characters.
400private_ipDomain resolves to a private, reserved or local host (for example a literal private IP).
400fetch_failedThe HTTPS homepage could not be fetched.
400timeoutThe HTTPS homepage did not respond within 8 seconds.
400response_too_largeThe homepage exceeded 2 MB.
401invalid_api_keyMissing, invalid or revoked key.
402insufficient_creditsBalance below 2 credits.
402spend_cap_reachedMonthly spend cap reached.
429rate_limitedMore than 60 requests per minute.

Unlike Page SEO, Tech Stack and Schema Markup, which answer 503 when the target is unreachable, Site Health answers 400 with fetch_failed or timeout. Branch on code, not on the status, to treat all four the same way.

See Errors for the shared error format.

MCP tool: get_site_health.

On this page