{"uid":"cap_URlg4AhKBekfgARKwQXzY","slug":"url-query-string-parser-builder-2170045f","name":"URL Query String Parser & Builder","description":"Two directions over query strings. action='parse' decodes a query string (with or without a leading '?') into an object, collapsing repeated keys into arrays. action='build' encodes a params object into a query string, expanding array values into repeated keys; set sort=true to order keys alphabetically.","url":"https://url.openverbs.com/v1/query","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":["action"],"properties":{"sort":{"type":"boolean","description":"Sort keys alphabetically when building. Default false."},"query":{"type":"string","maxLength":8192,"description":"The query string to parse (required when action='parse')."},"action":{"enum":["parse","build"],"type":"string","description":"Direction: 'parse' string→object, 'build' object→string."},"params":{"type":"object","description":"The parameters to encode (required when action='build'). Values may be scalars or arrays.","additionalProperties":true}},"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_-otiGFYfxqUb06uNif1FR","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":"Bidirectional query string utility: parse a query string into a key-value object (collapsing repeated keys into arrays) or encode a params object back into a query string (with optional alphabetical key sorting).","exampleAgentPrompt":"Parse this query string into a JSON object for me: '?utm_source=newsletter&color=red&color=blue&page=3'","exampleUseCases":[{"title":"Extract query params from redirect URL","prompt":"I have a redirect URL with a bunch of query parameters like '?user_id=42&ref=email&tags=promo&tags=sale' — can you parse that query string into a clean object so I can work with the values?"},{"title":"Build sorted query string for API request","prompt":"I need to build a query string from these params: { page: 2, limit: 50, sort: 'asc', filter: ['active', 'verified'] } — please encode them into a query string and sort the keys alphabetically."},{"title":"Reconstruct query string after param edits","prompt":"Take this params object — { search: 'coffee', category: 'drinks', tags: ['hot', 'espresso'] } — and encode it back into a query string I can append to a URL."}],"resultDescription":"Returns either a parsed object where each query key maps to its value (or an array of values for repeated keys) when action='parse', or a URL-encoded query string where array values are expanded into repeated keys when action='build'. The response reflects the direction specified by the action field.","failureModes":["Missing required 'action' field returns a validation error","Malformed query string may produce unexpected key groupings","Passing params to a 'parse' action or query to a 'build' action results in an error","Query string exceeding 8192 characters is rejected","Invalid body type or method returns a 400-level error"],"whenToPreferThis":"Choose this endpoint when you need a reliable, standards-compliant way to parse or build URL query strings, especially when handling repeated keys that must be collapsed into arrays or expanded from arrays. Prefer it over custom string-splitting logic when correctness of edge cases (empty values, encoded characters, array expansion) matters. It complements the sibling URL parsing and canonicalization endpoints on url.openverbs.com for full URL processing pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:31:40.059Z","isFirstParty":false}