Redirect chains

GET /api/v1/redirect-chains

Follow a URL hop by hop and return the full redirect chain — each step's status code, type and destination — plus the final resolved URL and a redirect-loop flag.

Query parameters

NameTypeDescription
url requiredstringThe starting URL to trace.
max_hops optionalintegerMaximum redirects to follow before stopping. Default: 10.

Request

Response

200 · application/json
  1. {
  2. "url": "http://example.com",
  3. "finalUrl": "https://example.com/",
  4. "hopCount": 2,
  5. "isRedirectLoop": false,
  6. "chain": [
  7. { "from": "http://example.com", "to": "https://example.com", "statusCode": 301, "type": "permanent" },
  8. { "from": "https://example.com", "to": "https://example.com/", "statusCode": 301, "type": "permanent" }
  9. ]
  10. }

Response fields

FieldTypeDescription
finalUrlstringThe URL after all redirects resolve.
hopCountintegerNumber of redirects followed.
isRedirectLoopbooleanTrue if a cycle was detected.
chain[]arrayEach hop: from, to, statusCode, type (permanent 301/308 or temporary 302/307).

See Errors for status codes.