Developer Reference
Redirect Chain API Documentation
Redirect Chain API Documentation: Follow URL redirect chains to detect HTTPS upgrades, domain changes, and final landing pages. Useful for SEO analysis, security auditing, and understanding URL routing. Tracks all 3xx redirects including 301, 302, 303, 307, and 308.
Redirect Chain
Follow URL redirect chains to detect HTTPS upgrades, domain changes, and final landing pages. Useful for SEO analysis, security auditing, and understanding URL routing. Tracks all 3xx redirects including 301, 302, 303, 307, and 308.
GET
/v1/redirects
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| url required | string | Starting URL to follow (e.g., "http://example.com") |
| max_redirects optional | number | Maximum redirects to follow (default: 10, max: 20) |
Response Fields
| Field | Type | Description |
|---|---|---|
original_url | string | Starting URL that was provided |
final_url | string | Final URL after all redirects |
redirect_count | number | Total number of redirects followed |
https_upgrade | boolean | Whether HTTP was upgraded to HTTPS |
chain | array | Each redirect with URL, status code, location |
Example Request
curl "https://domscan.net/v1/redirects?url=http://github.com"
const response = await fetch(
"https://domscan.net/v1/redirects?url=" + encodeURIComponent("http://github.com")
);
const data = await response.json();
console.log(`Final URL: ${data.final_url}`);
console.log(`Redirects: ${data.redirect_count}`);
console.log(`HTTPS upgrade: ${data.https_upgrade}`);
data.chain.forEach((hop, i) => {
console.log(`${i + 1}. ${hop.status} ${hop.url} → ${hop.location}`);
});
import requests
from urllib.parse import quote
url = quote("http://github.com", safe='')
response = requests.get(f"https://domscan.net/v1/redirects?url={url}")
data = response.json()
print(f"Final URL: {data['final_url']}")
print(f"HTTPS upgrade: {data['https_upgrade']}")
for i, hop in enumerate(data['chain']):
print(f"{i+1}. [{hop['status']}] {hop['url']}")
Example Response
{
"original_url": "http://github.com",
"final_url": "https://github.com/",
"redirect_count": 1,
"chain": [
{
"url": "http://github.com",
"status": 301,
"location": "https://github.com/",
"response_time_ms": 45
}
],
"https_upgrade": true,
"domain_change": false,
"total_time_ms": 156
}