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
| Name | Type | Description |
|---|---|---|
url required | string | The starting URL to trace. |
max_hops optional | integer | Maximum redirects to follow before stopping. Default: 10. |
Request
Response
200 · application/json
- {
- "url": "http://example.com",
- "finalUrl": "https://example.com/",
- "hopCount": 2,
- "isRedirectLoop": false,
- "chain": [
- { "from": "http://example.com", "to": "https://example.com", "statusCode": 301, "type": "permanent" },
- { "from": "https://example.com", "to": "https://example.com/", "statusCode": 301, "type": "permanent" }
- ]
- }
Response fields
| Field | Type | Description |
|---|---|---|
finalUrl | string | The URL after all redirects resolve. |
hopCount | integer | Number of redirects followed. |
isRedirectLoop | boolean | True if a cycle was detected. |
chain[] | array | Each hop: from, to, statusCode, type (permanent 301/308 or temporary 302/307). |
See Errors for status codes.