senapati
Documentation index

URL Status

Where a URL actually goes. Every redirect is followed one hop at a time and recorded with its status code, Location header, server and timing, up to the final response. The report flags the chains that cost you: too long, looping, dropping from HTTPS to HTTP, or ending on a different site from the one you started at.

POST/api/url-statusCosts 1 creditAPI key

Follow a URL's redirect chain to its final response (1 credit)

How the chain is followed

  • A GET with a browser-like Accept header and the Senapati/1.0 user agent, redirects handled by hand so each hop is seen. Up to ten redirects are followed; a hop that returns to a URL already visited stops the walk as a loop.
  • Each hop's host is resolved and checked before it is requested; a redirect into a private or internal address ends the chain with fetch_status: blocked.
  • The final page's HTML is scanned for a <meta http-equiv="refresh"> tag, the redirect that HTTP-only checkers miss. JavaScript redirects are not executed.

Fetch status

fetch_statusMeaning
okA final, non-redirect response was read
timeoutNo final response in time
dns_errorA host in the chain did not resolve
connection_errorA host refused or dropped the connection
too_many_redirectsMore than ten redirects
redirect_loopThe chain returned to a URL it had visited
unsupported_redirectA Location header pointed at something other than an http(s) URL
blockedA hop targets a non-public address
errorAnother failure; see error

Issue codes

codetypeMeans
FETCH_FAILEDerrorThe chain did not reach a final response
TARGET_BLOCKEDerrorA hop targets a non-public address
TOO_MANY_REDIRECTSerrorMore than ten redirects
REDIRECT_LOOPerrorThe redirects form a loop
FINAL_STATUS_ERRORerror / warningThe final response is 5xx (error) or 4xx (warning)
HTTPS_DOWNGRADEwarningA hop redirects from HTTPS to plain HTTP
CROSS_DOMAIN_REDIRECTinfoThe chain ends on a different site
LONG_REDIRECT_CHAINinfoThree or more redirects
META_REFRESHinfoThe final page redirects again with a meta tag

Request

JSON body
FieldTypeDescription
url*stringFull URL to analyze

Authenticate with API key. Send it as the X-API-Key header.

curl -X POST "https://api.senapati.io/api/url-status" \
  -H "X-API-Key: $SENAPATI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"http://wikipedia.org/"}'

Response

Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.

response: 200 OKURLStatusData
{
"request_id": "req_32d7aa66",
"timestamp": "2026-10-28T07:37:52.451885+00:00",
"data": {
"url": "http://wikipedia.org/",
"fetch_status": "ok",
"error": null,
"accessible": true,
"final_url": "https://www.wikipedia.org/",
"final_status_code": 200,
"redirect_count": 2,
"hops": [
{
"url": "http://wikipedia.org/",
"status_code": 301,
"location": "https://wikipedia.org/",
"elapsed_ms": 581,
"server": "HAProxy",
"content_type": null
},
{
"url": "https://wikipedia.org/",
"status_code": 301,
"location": "https://www.wikipedia.org/",
"elapsed_ms": 905,
"server": "mw-web.codfw.main-6d6b8b4f9b-jklcv",
"content_type": "text/html; charset=iso-8859-1"
},
{
"url": "https://www.wikipedia.org/",
"status_code": 200,
"location": null,
"elapsed_ms": 915,
"server": "mw-web.codfw.main-6d6b8b4f9b-l9kcf",
"content_type": "text/html"
}
],
"redirect_domains": [
"www.wikipedia.org"
],
"cross_domain_redirect": false,
"https_downgrade": false,
"meta_refresh_url": null,
"lookup_failed": false,
"issues_found": [],
"elapsed_ms": 2975
}
}

hops lists every response in order, the final one last; redirect_count is hops.length - 1 when the chain completed.

data · URLStatusData
FieldTypeDescription
url*string
fetch_status*"ok" | "timeout" | "blocked" | "dns_error" | "connection_error" | "too_many_redirects" | "redirect_loop" | "unsupported_redirect" | "error"ok when a final, non-redirect response was read
error*string | null
accessible*booleanA final response was read
final_url*string | null
final_status_code*integer | null
redirect_count*integer
hops*RedirectHop[]Every response in order, the final one last
↳ url*string
↳ status_code*integer
↳ location*string | nullThe Location header, as sent
↳ elapsed_ms*integer
↳ server*string | null
↳ content_type*string | null
redirect_domains*string[]Hosts visited other than the one asked for
cross_domain_redirect*booleanThe chain ends on a different site from the one asked for
https_downgrade*booleanA hop goes from HTTPS back to HTTP
meta_refresh_url*string | nullWhere the final page sends visitors with a meta refresh tag
lookup_failed*booleanTrue when the fetch failed for a reason that may clear on retry
issues_found*Finding[]
↳ code*stringStable machine-readable code, e.g. CERT_EXPIRED
↳ type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
↳ message*stringWhat was found and why it matters
elapsed_msintegerdefault 0

Errors

  • 401missing or invalid API key / token
  • 402not enough credits on the account
  • 422the request body or a parameter failed validation
  • 429plan rate limit exceeded

Nested objects

data.hops[] · RedirectHop
FieldTypeDescription
url*string
status_code*integer
location*string | nullThe Location header, as sent
elapsed_ms*integer
server*string | null
content_type*string | null
data.issues_found[] · Finding
FieldTypeDescription
code*stringStable machine-readable code, e.g. CERT_EXPIRED
type*"error" | "warning" | "info"error: clients or browsers reject it; warning: it works but is weaker than it should be; info: a note, not a defect
message*stringWhat was found and why it matters

Notes

  • hops is kept even when the chain fails part-way, so you can see how far it got.
  • cross_domain_redirect compares registrable domains with a simple rule (two labels, three under co, com, org and the like), so www.example.com to example.com is not cross-domain.
  • Only the first 64 KB of the final page is read, enough for the meta refresh scan.
  • A report with lookup_failed: true failed for a reason that may clear on retry (timeout, DNS, connection).