# URL Query String Parser & Builder

> URL Query String Parser & Builder is a paid API for AI agents from url.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

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).

## Facts

- Endpoint: POST https://url.openverbs.com/v1/query
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/url-query-string-parser-builder-2170045f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_URlg4AhKBekfgARKwQXzY

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 url-query-string-parser-builder-2170045f -d '<json body>'
```

Example prompt: Parse this query string into a JSON object for me: '?utm_source=newsletter&color=red&color=blue&page=3'

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-query-string-parser-builder-2170045f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from url.openverbs.com](https://www.zero.xyz/host/url.openverbs.com/llms.txt)
