Redirect Chain
free/v1/domain/redirectFollows and documents the complete redirect chain from a URL to its final destination. Identifies redirect types (301, 302, 307, 308, meta refresh) and potential issues.
What It Does
Makes HTTP requests following all redirects while recording each hop. Documents status codes, redirect types, response headers, and timing for each step. Identifies common issues like redirect loops, mixed content (HTTPS to HTTP), and excessive chain length.
Why It's Useful
Redirect chains impact SEO (passing link equity), page load speed, and can introduce security issues. Understanding the complete chain helps diagnose problems and optimize user experience.
Use Cases
SEO Audit
Identify redirect chains that dilute link equity or slow down page indexing.
Optimize redirects to improve SEO performance and crawl efficiency.
Migration Verification
After site migration, verify old URLs properly redirect to new locations.
Ensure migration redirects are working and not creating chains.
Security Analysis
Detect open redirects or suspicious redirect patterns in phishing investigations.
Identify malicious redirect patterns used in phishing campaigns.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | Required | The URL to trace redirects fromExample: http://example.com |
canonicalCheck | boolean | Optional | When true, fetch the final URL's HTML and compare its <link rel=canonical> to the final URL. Surfaces "you redirect to X but X's canonical is Y" SEO issuesExample: true |
Response Fields
| Field | Type | Description |
|---|---|---|
originalUrl | string | The starting URL |
finalUrl | string | The final destination after all redirects (including meta-refresh) |
chain | array | Each hop: url, statusCode, statusText, redirectType, location, server, responseTimeMs, category |
totalRedirects | number | Number of redirects in chain (includes meta-refresh hops) |
categoryCounts | object | Hop counts by category: protocol-upgrade, canonical, mixed-content, open-redirect-suspect, meta-refresh, normal |
isLoop | boolean | Whether a redirect loop was detected |
canonicalMatch | object | When canonicalCheck=true, { canonicalUrl, matchesFinal } from the final document's rel=canonical |
issues | array | Flat string descriptions of detected problems (loops, mixed content, etc.) |
structuredIssues | array | Structured issues with severity/code/href: meta-refresh detection, open-redirect suspicion, temporary-for-permanent, HSTS preload suggestions |
totalTimeMs | number | Total time to trace the chain in milliseconds |
Code Examples
curl "https://api.edgedns.dev/v1/domain/redirect" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "url=http://example.com"const response = await fetch(
'https://api.edgedns.dev/v1/domain/redirect?url=http%3A%2F%2Fexample.com',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/domain/redirect',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'url': 'http://example.com'
}
)
data = response.json()
print(data)Read the full Redirect Chain guide
Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.
Try This Endpoint
Test the Redirect Chain endpoint live in the playground.