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 keyProbes 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
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
domain | string | Yes | none | Bare 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
| Field | Type | Description |
|---|---|---|
https.enforced | boolean | true when a request to http://<domain>/ ends up on an https:// URL after redirects. false also when that probe failed. |
https.hsts | boolean | true when the homepage response carries a Strict-Transport-Security header. |
https.hsts_max_age | integer or null | The max-age value in seconds, or null when absent. |
www_redirect.enabled | boolean | true 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.target | string or null | Final URL of the www probe when enabled is true. |
checks | array | Three 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_options | string or null | Raw header value. |
security_headers.x_content_type_options | string or null | Raw header value. |
security_headers.content_security_policy | boolean | true when a CSP header is present. The policy itself is not returned. |
security_headers.strict_transport_security | string or null | Raw header value. |
security_headers.referrer_policy | string or null | Raw header value. |
robots_txt.present | boolean | true when /robots.txt answered 200. |
robots_txt.disallow_all | boolean | Heuristic: 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_declared | boolean | true 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 plainhttp://homepage andhttps://www.<domain>/(5 seconds each), and, whenrobots.txtreturns200, 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 orwwwprobe fails or times out, the rest of the report is still returned. A failedchecksentry hasstatus,content_typeandresponse_time_msallnull. A failed HTTP probe showshttps.enforced: false. - HEAD quirks. Some servers answer HEAD differently from GET (for example
405).checksreports 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
| Status | Code | When |
|---|---|---|
400 | invalid_url | domain is missing, not a bare domain (scheme, path, port or invalid characters), or longer than 253 characters. |
400 | private_ip | Domain resolves to a private, reserved or local host (for example a literal private IP). |
400 | fetch_failed | The HTTPS homepage could not be fetched. |
400 | timeout | The HTTPS homepage did not respond within 8 seconds. |
400 | response_too_large | The homepage exceeded 2 MB. |
401 | invalid_api_key | Missing, invalid or revoked key. |
402 | insufficient_credits | Balance below 2 credits. |
402 | spend_cap_reached | Monthly spend cap reached. |
429 | rate_limited | More 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.
Related
MCP tool: get_site_health.