Skip to main content

Redirect Chain API

free
GET/v1/domain/redirect

Follows 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 Specialist

SEO Audit

Identify redirect chains that dilute link equity or slow down page indexing.

Optimize redirects to improve SEO performance and crawl efficiency.

DevOps Engineer

Migration Verification

After site migration, verify old URLs properly redirect to new locations.

Ensure migration redirects are working and not creating chains.

Security Analyst

Security Analysis

Detect open redirects or suspicious redirect patterns in phishing investigations.

Identify malicious redirect patterns used in phishing campaigns.

Parameters

NameLocationTypeRequiredDescription
urlquerystringRequiredThe URL to trace redirects fromExample: http://example.com
canonicalCheckquerybooleanOptionalWhen 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.

FieldTypeDescription
originalUrlstringThe starting URL
finalUrlstringThe final destination after all redirects (including meta-refresh)
chainarrayEach hop: url, statusCode, statusText, redirectType, location, server, responseTimeMs, category
totalRedirectsnumberNumber of redirects in chain (includes meta-refresh hops)
categoryCountsobjectHop counts by category: protocol-upgrade, canonical, mixed-content, open-redirect-suspect, meta-refresh, normal
isLoopbooleanWhether a redirect loop was detected
canonicalMatchobjectWhen canonicalCheck=true, { canonicalUrl, matchesFinal } from the final document's rel=canonical
issuesarrayFlat string descriptions of detected problems (loops, mixed content, etc.)
structuredIssuesarrayStructured issues with severity/code/href: meta-refresh detection, open-redirect suspicion, temporary-for-permanent, HSTS preload suggestions
totalTimeMsnumberTotal time to trace the chain in milliseconds
domainstringQueried 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
curl --request GET 'https://api.edgedns.dev/v1/domain/redirect?url=http%3A%2F%2Fexample.com' \
  --header "Authorization: Bearer YOUR_API_KEY"
JavaScript
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);
Python
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.

Redirect Chain API Reference | EdgeDNS