Redirect Chain API
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 | Location | Type | Required | Description |
|---|---|---|---|---|
url | query | string | Required | The URL to trace redirects fromExample: http://example.com |
canonicalCheck | query | 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
Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.
| 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 |
domain | string | Queried domain. |
Code Examples
Replace YOUR_API_KEY with your API key. This endpoint requires the free plan or higher; see plans and usage limits.
curl --request GET 'https://api.edgedns.dev/v1/domain/redirect?url=http%3A%2F%2Fexample.com' \
--header "Authorization: Bearer YOUR_API_KEY"const response = await fetch(
"https://api.edgedns.dev/v1/domain/redirect?url=http%3A%2F%2Fexample.com",
{
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
);
if (!response.ok) {
throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);import requests
response = requests.request(
'GET',
"https://api.edgedns.dev/v1/domain/redirect?url=http%3A%2F%2Fexample.com",
headers={'Authorization': 'Bearer YOUR_API_KEY'},
timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)Read the full Redirect Chain guide
Learn the concepts, choose a practical workflow, and interpret the observations from Redirect Chain before acting on them. Run supported checks via MCP or through REST.
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.