{"uid":"cap_hOGfwpcDSpXpQsxsfzF0i","slug":"pastable-x402-url-canonicalization-63329fcb","name":"pastable-x402 URL Canonicalization","description":"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.","url":"https://pastable-x402.pages.dev/data/url-canonical","method":"GET","headers":{},"bodySchema":{"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"}}},"responseSchema":{"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":[]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_KBTqqgNwRs_1JCE0ebhnh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Normalizes and canonicalizes a URL by lowercasing the scheme/host, removing default ports, resolving path segments, sorting query parameters, and stripping fragments.","exampleAgentPrompt":"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?","exampleUseCases":[{"title":"Deduplicating scraped web URLs","prompt":"I've scraped a bunch of URLs and some of them look different but might point to the same page — like one has uppercase in the domain and another has the port number. Can you canonicalize this URL so I can deduplicate: HTTP://WWW.EXAMPLE.COM:80/page/../about?z=3&a=1"},{"title":"Consistent URL storage in a database","prompt":"Before I save this URL to my database, normalize it so it's always in a standard form — resolve any relative paths, lowercase the host, remove the default port, and sort the query string: https://MySite.com:443/products/./shoes?color=red&size=10"},{"title":"Comparing two potentially equivalent URLs","prompt":"Are these two URLs pointing to the same resource? Please canonicalize https://Example.COM/foo/../bar?b=2&a=1#section1 so I can compare it against https://example.com/bar?a=1&b=2"}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:32:08.389Z","isFirstParty":false}