# pastable-x402 URL Canonicalization

> pastable-x402 URL Canonicalization is a paid API for AI agents from pastable-x402.pages.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Normalizes and canonicalizes a URL by lowercasing the scheme/host, removing default ports, resolving path segments, sorting query parameters, and stripping fragments.

## Facts

- Endpoint: GET https://pastable-x402.pages.dev/data/url-canonical
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pastable-x402-url-canonicalization-63329fcb
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_hOGfwpcDSpXpQsxsfzF0i

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 pastable-x402-url-canonicalization-63329fcb
```

Example prompt: Can you canonicalize this URL for me — HTTPS://Example.COM:443/a/../b?b=2&a=1#frag — so it's in a clean, normalized form with sorted query params and no redundant parts?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call URL normalization step — particularly useful in agent pipelines that scrape or collect URLs from varied sources and need consistent, deduplicated representations. It is preferable over rolling your own normalization logic when you need RFC-compliant canonicalization (sorted params, path resolution, port stripping) without maintaining a library dependency.

## Known failure modes

- Missing or malformed 'url' query parameter returns an error
- Completely invalid URL strings may fail to parse
- Relative URLs without a scheme may not be processable
- Network or payment authorization failure returns HTTP 402

## How this service works

Pay-per-call utility APIs for agents: EVM helpers (checksum, unit conversion, keccak), data transforms (CSV to JSON, JSON diff, URL canonicalisation), text tools (hashing, JWT decode), and Bazaar market intelligence. x402 on Base mainnet.

## Output

A JSON object containing the original input URL, the fully canonicalized URL (lowercased scheme and host, default port removed, path segments resolved, query parameters sorted alphabetically, fragment dropped), and an array of any query parameters that were dropped during normalization.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "string"
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "input": "HTTPS://Example.COM:443/a/../b?b=2&a=1#frag",
  "canonical": "https://example.com/b?a=1&b=2",
  "dropped_params": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pastable-x402-url-canonicalization-63329fcb/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pastable-x402.pages.dev](https://www.zero.xyz/host/pastable-x402.pages.dev/llms.txt)
