🔗 URL Unshortener API avatar

🔗 URL Unshortener API

Pricing

Pay per event

Go to Apify Store
🔗 URL Unshortener API

🔗 URL Unshortener API

Extract and resolve shortened URLs into full redirect chains. Detect infinite loops and HTTPS downgrades using this API tool.

Pricing

Pay per event

Rating

0.0

(0)

Developer

太郎 山田

太郎 山田

Maintained by Community

Actor stats

0

Bookmarked

3

Total users

2

Monthly active users

12 hours ago

Last modified

Share

🔗 URL Unshortener

Expand bit.ly, t.co, goo.gl, and any shortened URL. Trace full redirect chains, detect loops and HTTPS downgrades.

Store Quickstart

Start with the Quickstart template (3 demo shortened URLs). For bulk processing, use Bulk Resolve (1,000 URLs, concurrency 20).

Key Features

  • 🔓 Expand all shorteners — Works with bit.ly, t.co, goo.gl, tinyurl, ow.ly, buff.ly, and more
  • 🔗 Full redirect chain — Every hop logged with URL + status code
  • 🔄 Loop detection — Identifies infinite redirect loops and cyclic redirects
  • 🔒 HTTPS downgrade detection — Flags URLs where https redirects to http
  • Bulk processing — Up to 1,000 URLs per run with 1-20 concurrency
  • 📊 Hop count stats — Total hops per URL for ad network / tracker analysis

Use Cases

WhoWhy
Ad fraud analystsDetect cloaking by tracing redirect chains in ad URLs
Security teamsResolve phishing links without clicking to identify payloads
Social media analystsExpand t.co links from X/Twitter datasets for attribution
SEO auditorsVerify outbound shortened links resolve to intended destinations
Journalism/OSINTInvestigate URL patterns in misinformation campaigns

Input

FieldTypeDefaultDescription
urlsstring[](required)Shortened URLs to resolve (max 1000)
maxRedirectsinteger10Max redirect hops (1-20)
concurrencyinteger10Parallel requests (1-20)

Input Example

{
"urls": ["https://bit.ly/3abcdef", "https://t.co/xyz", "https://goo.gl/abc123"],
"maxRedirects": 10,
"concurrency": 10
}

Output

FieldTypeDescription
originalUrlstringThe short URL provided as input
finalUrlstringThe final destination URL after all redirects
redirectChainstring[]Full chain of intermediate URLs
totalHopsintegerNumber of redirects followed
hasLoopbooleanTrue if a redirect loop was detected
isHttpsDowngradebooleanTrue if any HTTPS→HTTP downgrade occurred
statusCodeintegerFinal HTTP status code
errorstringnull

Output Example

{
"originalUrl": "https://bit.ly/3abcdef",
"chain": [
{"url": "https://bit.ly/3abcdef", "statusCode": 301},
{"url": "https://example.com/landing", "statusCode": 200}
],
"finalUrl": "https://example.com/landing",
"totalHops": 2,
"hasLoop": false,
"isHttpsDowngrade": false
}

API Usage

Run this actor programmatically using the Apify API. Replace YOUR_API_TOKEN with your token from Apify Console → Settings → Integrations.

cURL

curl -X POST "https://api.apify.com/v2/acts/taroyamada~url-shortener-resolver/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "urls": ["https://bit.ly/3abcdef", "https://t.co/xyz", "https://goo.gl/abc123"], "maxRedirects": 10, "concurrency": 10 }'

Python

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("taroyamada/url-shortener-resolver").call(run_input={
"urls": ["https://bit.ly/3abcdef", "https://t.co/xyz", "https://goo.gl/abc123"],
"maxRedirects": 10,
"concurrency": 10
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

JavaScript / Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('taroyamada/url-shortener-resolver').call({
"urls": ["https://bit.ly/3abcdef", "https://t.co/xyz", "https://goo.gl/abc123"],
"maxRedirects": 10,
"concurrency": 10
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Tips & Limitations

  • Detect malicious URL chains by checking hasLoop and isHttpsDowngrade flags.
  • Default maxRedirects: 10 is safe for legitimate shorteners. Increase only if needed.
  • Use this before clicking any unknown short link in security-sensitive workflows.
  • Combine with Meta Tag Analyzer to inspect the destination page metadata.

FAQ

What if the short URL is dead?

The chain shows the final status code (e.g., 404). hasLoop will be false; finalUrl will be the last URL reached.

Can it handle JavaScript redirects?

No — this is HTTP-level only. JS-based redirects (meta refresh, window.location) require a browser.

Is bit.ly rate-limited?

bit.ly may rate-limit aggressive requests. Use concurrency ≤ 10 for safety on shortener-heavy batches.

Will this follow tracking parameters?

Yes. The full URL including UTM tags is preserved at each hop.

Which shorteners are supported?

Any HTTP-based redirect — bit.ly, t.co, tinyurl, goo.gl, lnkd.in, custom shorteners. No special integration needed.

Will it click through tracking pixels?

It follows server-side HTTP redirects only, not JavaScript or meta-refresh redirects.

URL/Link Tools cluster — explore related Apify tools:

Cost

Pay Per Event:

  • actor-start: $0.01 (flat fee per run)
  • dataset-item: $0.002 per output item

Example: 1,000 items = $0.01 + (1,000 × $0.002) = $2.01

No subscription required — you only pay for what you use.