Link Expand API - Resolve Short URLs and Redirect Chains
Follows up to 10 HTTP redirects manually, recording each hop with its URL and status code. Returns the original URL, the final URL, the full hop array, and the redirect count. Useful for unshortening bit.ly, t.co, and tracking redirects without loading the destination in a browser.
Code examples
curl -X POST https://api.botoi.com/v1/link/expand \
-H "Content-Type: application/json" \
-d '{"url":"https://bit.ly/3xE4AbC"}'When to use this API
Safety-check links before following them
When a user-submitted short URL arrives in your app, expand it first. Display the final destination in the preview so users know where a click actually lands. Works well alongside /v1/phishing/check.
Attribute traffic past redirectors
When a campaign links to bit.ly/campaign, expand the link at ingest time to capture the real destination URL. Keeps your analytics accurate even when the shortener changes its target later.
Detect affiliate-link hijacking
Periodically expand each of your affiliate links. If the final URL changes from the expected merchant domain, something in the chain has been replaced (DNS hijack, compromised shortener).
Frequently asked questions
What is the redirect hop limit?
Does it follow meta-refresh or JavaScript redirects?
What happens if the shortener is down?
Are relative redirects handled?
How is this different from /v1/redirect-trace?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.