{"uid":"cap_ZlGW-hw3ltU_--NZdmkKX","slug":"url-parser-whatwg-830bf9ad","name":"URL Parser (WHATWG)","description":"Parse an absolute URL into its WHATWG components: protocol/scheme, credentials, host/hostname/port, origin, pathname (plus path segments), search (plus a decoded query object) and hash. A string that is not a valid absolute URL is rejected as a clean 400.","url":"https://url.openverbs.com/v1/parse","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"type":"object","required":["url"],"properties":{"url":{"type":"string","maxLength":8192,"minLength":1,"description":"The absolute URL to parse."}},"additionalProperties":false},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ng3LrJ5XFyJ8FrgyqA3dy","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","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 string into its WHATWG-standard components including protocol, credentials, host, port, origin, pathname, path segments, query object, and hash.","exampleAgentPrompt":"Can you parse this URL for me — 'https://user:pass@api.example.com:8080/v2/items?filter=active&page=2#results' — and give me all its components like the protocol, host, port, pathname, query parameters, and hash?","exampleUseCases":[{"title":"Extract query parameters from redirect URL","prompt":"I have this redirect URL from an OAuth callback: 'https://myapp.com/auth/callback?code=abc123&state=xyz789&session_state=qrs456' — can you parse it and pull out all the query parameters as a decoded object?"},{"title":"Validate and decompose API endpoint URL","prompt":"Before I call this endpoint, can you parse 'https://api.partner.com:443/data/v3/reports/monthly' and confirm the hostname, port, and full path breakdown?"},{"title":"Debug a malformed URL string","prompt":"I'm not sure if this URL is valid — can you try parsing 'htps://missing-letter.com/path?q=test' and tell me whether it's a valid absolute URL or if it gets rejected?"}],"resultDescription":"A structured object containing all WHATWG URL components: protocol/scheme, username, password, host, hostname, port, origin, pathname, an array of path segments, the raw search/query string, a decoded query key-value object, and the hash/fragment. If the input is not a valid absolute URL, the endpoint returns a 400 error.","failureModes":["Non-absolute URLs (relative paths, protocol-relative) rejected with 400","Malformed URLs with invalid characters return 400","Empty or missing 'url' field returns 400 validation error","URLs exceeding 8192 characters rejected","Non-string input types rejected by schema validation"],"whenToPreferThis":"Use this endpoint when you need a reliable, standards-compliant (WHATWG) decomposition of a URL into all its named components in a single call — especially when you need the query string decoded into a structured key-value object and path segments as an array. Prefer it over regex-based parsing or manual string splitting when correctness and spec compliance matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:41:23.319Z","isFirstParty":false}