# URL Expander / Redirect Chain Tracer

> URL Expander / Redirect Chain Tracer is a paid API for AI agents from x402-deployer.x402-deployer.workers.dev, paid per call via x402, $0.020000/call, status unknown (last checked 2026-09-15).

Traces every redirect hop in a URL chain, returning status codes, intermediate locations, redirect types, and response times for each hop.

## Facts

- Endpoint: POST https://x402-deployer.x402-deployer.workers.dev/expand-url
- Price: $0.020000/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-4817ffdb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LdI3b7sqUDVQW8JyfVXBp

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-deployer-x402-deployer-workers-dev-4817ffdb -d '<json body>'
```

Example prompt: Can you trace the full redirect chain for this link — https://bit.ly/3xAbCdE — and show me every hop it takes, the status code at each step, and where it ultimately ends up?

## When to prefer this

Use this endpoint when you need to programmatically resolve shortened URLs, audit redirect chains for security or analytics purposes, or verify that a link ultimately leads to an expected destination — without exposing the user's browser to the intermediate hops.

## Known failure modes

- Invalid or malformed URL returns an error
- URL that returns no redirects returns a single-hop result with 200
- Network timeouts on slow or unreachable hosts
- Redirect loops may cause the tracer to bail out after a max-hop limit
- Non-HTTP schemes (ftp://, mailto:) may not be supported

## How this service works

URL expander / redirect chain tracer / link-shortener resolver. Returns every redirect hop with status, location, type, response time.

## Output

A list of every redirect hop in the chain, each with its HTTP status code (e.g. 301, 302), the Location header URL, the type of redirect, and the response time for that hop, plus the final destination URL.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "Starting URL (typically a shortlink). Must be http(s)."
      },
      "max_hops": {
       "type": "number",
       "description": "Maximum redirect hops to follow. 1-20. Default 10."
      },
      "user_agent": {
       "type": "string",
       "description": "Optional User-Agent header to send (some shorteners gate by UA). Default is a generic browser UA."
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "hops": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         },
         "status": {
          "type": "integer"
         },
         "location": {
          "type": "string"
         },
         "duration_ms": {
          "type": "integer"
         },
         "content_type": {
          "type": "string"
         },
         "redirect_type": {
          "type": "string"
         }
        }
       }
      },
      "error": {
       "type": "null"
      },
      "final_url": {
       "type": "string"
      },
      "hop_count": {
       "type": "integer"
      },
      "truncated": {
       "type": "boolean"
      },
      "initial_url": {
       "type": "string"
      },
      "final_status": {
       "type": "integer"
      },
      "total_duration_ms": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-deployer-x402-deployer-workers-dev-4817ffdb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-deployer.x402-deployer.workers.dev](https://www.zero.xyz/host/x402-deployer.x402-deployer.workers.dev/llms.txt)
