{"uid":"cap_EFjImxxmM_qgwwjTc9aUT","slug":"url-parser-resolver-e1e8ef9d","name":"URL Parser & Resolver","description":"Parse a URL into parts — host, path, query params as JSON, fragment, origin — or resolve a relative reference against a base URL correctly.","url":"https://toolbelt402.tpoborne.workers.dev/url/parse","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"ref":{"type":"string","description":"Resolve mode: relative reference to resolve against base"},"url":{"type":"string","description":"Absolute URL to parse"},"base":{"type":"string","description":"Resolve mode: base URL"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_YUXpUdeVBb3DjWZmq-ba-","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Parses an absolute URL into its component parts (host, path, query params, fragment, origin) or resolves a relative reference against a base URL.","exampleAgentPrompt":"Can you parse this URL for me — https://example.com/search?q=hello&page=2#results — and give me the host, path, query params as JSON, fragment, and origin?","exampleUseCases":[{"title":"Extract query params from URL","prompt":"I have this URL — https://shop.example.com/products?category=shoes&color=red&size=10 — can you break it down and pull out all the query parameters as structured JSON?"},{"title":"Resolve relative link against base","prompt":"I need to resolve the relative path ../images/logo.png against the base URL https://example.com/pages/about — what's the final absolute URL?"},{"title":"Get origin and host from URL","prompt":"What's the host and origin of this URL: https://api.acme.io:8443/v2/data?token=abc123#section2?"}],"resultDescription":"A JSON object containing the parsed URL components: host, pathname, query parameters as a key-value JSON object, fragment/hash, origin, protocol, and optionally the fully resolved absolute URL when used in resolve mode.","failureModes":["Missing required 'url' query param returns an error","Invalid or malformed URL string that cannot be parsed","Missing 'base' or 'ref' when using resolve mode","Relative URL passed without a base URL for resolution","Payment not included or insufficient (x402 payment required)"],"whenToPreferThis":"Choose this endpoint when you need to programmatically decompose a URL into structured parts (host, path, query params as JSON, fragment, origin) or resolve a relative URL reference against a base — especially in automation pipelines where manual string splitting is error-prone. It handles edge cases like port numbers, encoded characters, and fragment identifiers correctly.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:41:59.351Z","isFirstParty":false}