$ man expand-url
/expand-url
PRICE / CALL
$0.02
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
webprobeCATEGORY
utilities
STATUS
● live
NAME
expand-url — expands shortened urls by tracing the full redirect chain hop-by-hop
SYNOPSIS
POST https://x402.agentutility.ai/expand-url
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
Expands shortened URLs by tracing the full redirect chain hop-by-hop. Each step returns status code, Location header, redirect_type (permanent / temporary / meta / js), per-hop duration, and content-type, plus the final landing URL and total trace time. Useful for unmasking shortened links before fetch, and for forensic / security analysis of suspicious redirects. Use it as a URL expander, redirect chain tracer, link unshortener, shortlink resolver, bit.ly + t.co + lnkd.in + goo.gl + tinyurl resolver, final-URL fetcher, or phishing redirect inspector.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| url | string | Starting URL (typically a shortlink). Must be http(s). | required |
| max_hops | number | Maximum redirect hops to follow. 1-20. Default 10. | optional |
| user_agent | string | Optional User-Agent header to send (some shorteners gate by UA). Default is a generic browser UA. | optional |
OUTPUT — response shape
| field | type | description |
|---|---|---|
| initial_url | string | Original URL submitted for expansion before any redirects were followed. |
| final_url | string | Terminal URL reached after following the full redirect chain. |
| final_status | number | HTTP status code returned at the final hop (200, 404, etc.). |
| hop_count | number | Number of redirect hops traversed between the initial and final URL. |
| total_duration_ms | number | Total wall-clock time in milliseconds to trace the full redirect chain. |
| hops | array | Ordered list of each redirect step with URL, status, location header, redirect type, and response time. |
| truncated | boolean | True if the chain hit the max-hop cap before reaching a terminal URL. |
| error | string | Error message if the trace failed (DNS failure, timeout, redirect loop, invalid URL). |
EXAMPLES — two ways to call
EXAMPLE 1 · curl
curl -X POST https://x402.agentutility.ai/expand-url \
-H 'Content-Type: application/json' \
-d '{ }'first response =
402 Payment Required with payment requirements; sign + retry with X-PAYMENT.EXAMPLE 2 · mcp
# Install the MCP package for this endpoint's cluster npx -y @agentutility/mcp-<cluster> # Required: EVM private key with USDC on Base export X402_PRIVATE_KEY=0x... # Then call the expand-url tool from your MCP-aware agent.
MCP server handles payment automatically — your coding agent just calls the tool by name.
METADATA
- tags
- urlredirectshortlinktracephishing
- methods
- POST
- cluster
- webprobe
- price
- $0.02 USDC per call
ADJACENT — other endpoints in webprobe
| endpoint | description | price |
|---|---|---|
| archive-snapshot | Finds the closest archived snapshot of a public URL, like a Wayback Machine API. | $0.02 |
| archive-snapshot-api | Finds archived snapshots of public web pages, returning the closest Wayback Machine captures with timestamps, status codes, and replay URLs. | $0.02 |
| archive-url | Looks up the archived copy of a public URL closest to a given timestamp and can fetch cleaned archived page text. | $0.02 |
| brand-domain-check | Checks whether a brand or company domain is established, expiring, registrar-locked, or newly registered, on the same RDAP backend as who… | $0.02 |
| brand-watch-domain-risk | Checks new or suspicious brand-adjacent domains for age, registrar, expiry, DNSSEC, and transfer/lock statuses. | $0.02 |
| creator-domain-check | Checks creator, newsletter, podcast, and community domains for age, expiry, registrar, DNSSEC, and suspicious new-registration flags. | $0.02 |
| dmarc-check | Audits a domain's email authentication posture: DMARC, SPF, and DKIM in one check. | $0.02 |
| dns-lookup | Full DNS lookup over Cloudflare 1.1.1.1 DNS-over-HTTPS. | $0.02 |
SEE ALSO