$ man expand-url
/expand-url(1)
PRICE / CALL
$0.02
USDC · base mainnet · scheme: exact
METHOD
POST
CLUSTER
webprobeCATEGORY
utilities
STATUS
● live
NAME
expand-url — url expander / redirect chain tracer / link-shortener resolver
SYNOPSIS
POST https://x402.org/v1/expand-url
Content-Type: application/json
X-PAYMENT: <signed-transferWithAuthorization>
{ ... }↳ first call →
402 Payment Required. Sign USDCtransferWithAuthorization, retry with theX-PAYMENT header.DESCRIPTION
URL expander / redirect chain tracer / link-shortener resolver. Follows HTTP redirects step-by-step, returns every hop with status, location, redirect type, response time. Phishing-link analysis, marketing attribution, click-tracking.
INPUT — request schema
| property | type | description | req? |
|---|---|---|---|
| url | string | Starting URL (typically a shortlink). Must be http(s). | required |
| max_hops | number | 1-50. Default 15. | 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.org/v1/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 once claude mcp add x402 --command "npx x402-deployer-mcp" # then ask Claude Code: # "use the expand-url tool to ..."
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 | Wayback Machine API / archive.org wrapper. | $0.02 |
| dmarc-check | DMARC / SPF / DKIM checker. | $0.02 |
| dns-lookup | DNS lookup / DNS resolver / DoH proxy. | $0.02 |
| password-strength | Password strength meter + breach checker. | $0.02 |
| whois | Domain WHOIS / RDAP lookup. | $0.02 |
| whois-lookup | WHOIS / RDAP domain lookup. | $0.02 |
| arxiv-search | arXiv full-text search. | $0.03 |
| ssl-cert | SSL certificate inspector / TLS cert checker / certificate transparency lookup / ssl expiry. | $0.03 |
SEE ALSO