Skip to content
POST AI agent ready /v1/redirect/trace

Redirect Trace API - Follow HTTP Redirect Chains with Timing

Sends a HEAD request to a URL and follows every redirect hop until the final destination or the maximum hop limit is reached. Returns the original URL, final URL, total redirect count, total time, and an array of hops with URL, status code, latency, server header, location header, and content type.

Parameters

stringrequired

URL to trace redirects for.

Code examples

curl -X POST https://api.botoi.com/v1/redirect/trace \
  -H "Content-Type: application/json" \
  -d '{"url":"https://bit.ly/example"}'

When to use this API

SEO redirect auditing

Crawl your site URLs through this endpoint to find redirect chains with more than one hop. Google recommends direct redirects; chains of 301s dilute link equity and slow page indexing.

URL shortener debugging

Paste a shortened URL and see every hop in the chain. Identify which redirect service is involved, whether it uses 301 (permanent) or 302 (temporary) redirects, and where the final destination lands.

Marketing link chain analysis

Trace campaign URLs through UTM wrappers, affiliate trackers, and CDN redirects. Measure the latency each hop adds and identify opportunities to shorten the chain.

Frequently asked questions

How many redirects does it follow?
The endpoint follows up to 10 redirect hops. If the chain exceeds 10 hops, it stops and returns the hops collected so far with a flag indicating the chain was truncated.
Does it follow JavaScript redirects?
No. The endpoint follows HTTP-level redirects (301, 302, 303, 307, 308). JavaScript-based redirects (window.location) or meta refresh tags are not detected.
What is the difference between this and /v1/link/expand?
The /v1/link/expand endpoint returns only the final destination URL. This endpoint returns the complete chain with every intermediate hop, status codes, timing, and server headers.
Does it send GET or HEAD requests?
It sends HEAD requests to minimize bandwidth and avoid triggering side effects on the target server. The final hop uses a HEAD request as well, so content_type is available but the response body is not fetched.
Can I trace redirects for POST endpoints?
No. This endpoint traces GET/HEAD redirect chains only. POST redirects follow different HTTP semantics (303 vs 307) and are not supported.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.