# URL Query String Parser and Builder

> URL Query String Parser and Builder is a paid API for AI agents from url-text-tools.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Parses a URL query string into grouped key-value pairs or builds a query string from a JSON object, flagging duplicate keys.

## Facts

- Endpoint: GET https://url-text-tools.x402tookit.com/query-string?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/url-query-string-parser-and-builder-5eb584dc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KyG2wCHOQRrKMkukSu1nH

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-and-builder-5eb584dc
```

Example prompt: Parse the query string 'a=1&b=hello&a=2&flag=' into structured key-value pairs and group any repeated keys — also flag any duplicates.

## When to prefer this

Use this endpoint when you need to programmatically parse or construct URL query strings without writing custom parsing logic, especially when handling repeated keys or needing grouped output. Prefer this over generic string-splitting when you need RFC-compliant handling of duplicates and structured output including a duplicate-keys flag.

## Known failure modes

- Malformed JSON passed as build input returns an error or skipped count
- Empty query string returns empty pairs and grouped object
- Extremely long query strings may be truncated or skipped
- Invalid action value (not 'parse' or 'build') defaults to parse
- Missing required 'query' parameter causes request failure

## How this service works

Parse a URL query string into keys and values (repeats grouped) or build one from a JSON object, with duplicates flagged.

## Output

Returns a structured object containing: an array of key-value pairs, a grouped object where repeated keys are collected into arrays, a list of duplicate key names, the action performed (parse or build), the source query string, a summary, and metadata like timestamp and any degraded-mode warnings.

## 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"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "query": {
       "type": "string",
       "description": "For parse: the query string, with or without the leading ?. For build: a JSON object of keys to values or arrays"
      },
      "action": {
       "type": "string",
       "description": "parse (default) or build"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "pairs": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "key": {
          "type": [
           "null",
           "string"
          ]
         },
         "value": {
          "type": [
           "null",
           "string"
          ]
         }
        }
       }
      },
      "action": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "grouped": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "a": {
         "type": [
          "array",
          "null"
         ],
         "items": {
          "type": "string"
         }
        },
        "b": {
         "type": [
          "array",
          "null"
         ],
         "items": {
          "type": "string"
         }
        },
        "flag": {
         "type": [
          "array",
          "null"
         ],
         "items": {
          "type": "string"
         }
        }
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "skipped": {
       "type": [
        "null",
        "number"
       ]
      },
      "summary": {
       "type": [
        "null",

… (truncated)
```

## More

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