81trust / 100

Unshorten Url

by URL unshortener in Weather & location

x402 APIPassing, checked 1 h ago

Follow a short link's redirect chain (bit.ly, t.co, youtu.be, tracking links, …) without downloading any page body: returns the final URL, the final HTTP status, and every hop with its status code and Location target. Capped at 5 redirects; every hop is SSRF-re-validated, so chains that dive into private networks are blocked. Lets agents pre-flight links before fetching or citing them.

POST https://agent402.tools/api/unshorten-url

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
214 ms typical, 424 ms slowest 5%
Last check
1 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/unshorten-url" \
  -H "content-type: application/json" \
  -d '{"url":"https://www.agent402.tools/"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Funshorten-url
const res = await pay("https://agent402.tools/api/unshorten-url", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"url":"https://www.agent402.tools/"}),
});
console.log(await res.json());

Example input

{
  "url": "https://www.agent402.tools/"
}

Example output

{
  "finalStatus": 200,
  "finalUrl": "https://agent402.tools/",
  "hops": [
    {
      "location": "https://agent402.tools/",
      "status": 301,
      "url": "https://www.agent402.tools/"
    },
    {
      "location": null,
      "status": 200,
      "url": "https://agent402.tools/"
    }
  ],
  "redirects": 1,
  "truncated": false,
  "url": "https://www.agent402.tools/"
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
1 h agoPassed402191 ms$0.002
5 h agoPassed402426 ms$0.002
8 h agoPassed402329 ms$0.002
13 h agoPassed402185 ms$0.002
16 h agoPassed402214 ms$0.002
19 h agoPassed402190 ms$0.002
24 h agoPassed402424 ms$0.002