Find the final URL after redirects
Trace the full redirect chain of any URL. See every hop in order, the final destination, and the total number of redirects followed.
GET /api/url-resolve
Try it
{
"input_url": "http://example.com",
"final_url": "https://www.example.com/",
"redirect_count": 2,
"redirect_chain": [
{ "url": "http://example.com", "status": 301 },
{ "url": "https://example.com", "status": 301 },
{ "url": "https://www.example.com/", "status": 200 }
],
"error": null
}What it returns
- •input_url - the URL you submitted
- •final_url - the last URL in the redirect chain
- •redirect_count - number of redirects followed
- •redirect_chain - every hop with its URL and HTTP status
- •error - error code if resolution failed, null otherwise
Use cases
- •Expand shortened URLs (bit.ly, t.co) to see where they lead
- •Detect redirect loops in your web application
- •Verify affiliate link chains are working correctly
- •Clean scraped data by normalizing redirect targets
- •Debug misconfigured HTTP-to-HTTPS or www redirects
Quick API examples
curl
curl "https://tinyutils.dev/api/url-resolve?url=http://example.com"
JavaScript (fetch)
const res = await fetch( "https://tinyutils.dev/api/url-resolve?url=http://example.com" ); const data = await res.json(); console.log(data.final_url, data.redirect_count); console.log(data.redirect_chain);
Batch endpoint
Resolve up to 10 URLs in a single request using POST /api/url-resolve/batch.
curl -X POST "https://tinyutils.dev/api/url-resolve/batch" \
-H "Content-Type: application/json" \
-d '{"urls":["http://example.com","http://openai.com"]}'