# URL & Text Tools – Percent Encode/Decode

> URL & Text Tools – Percent Encode/Decode 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).

Percent-encodes or decodes text as a URL component, path, query string, or form data (UTF-8), returning the transformed string with byte counts.

## Facts

- Endpoint: GET https://url-text-tools.x402tookit.com/percent-encode?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-text-tools-percent-encode-decode-0ce59bf8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_LymptJ77Qj5HLiWJe0c4w

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-text-tools-percent-encode-decode-0ce59bf8
```

Example prompt: Percent-encode this text for use as a URL query parameter: 'hello world & goodbye!'

## When to prefer this

Use this endpoint when you need reliable, RFC-compliant percent-encoding or decoding of text for URL construction, especially when you need fine-grained control over the encoding context (component vs path vs query vs form). Prefer it over ad-hoc encoding in code when correctness of special characters (e.g. spaces as + in form mode, reserved characters in path vs query) matters and you want byte-level metadata about the transformation.

## Known failure modes

- Missing required 'text' query parameter returns an error
- Text exceeding 2000 characters may be rejected or truncated
- Invalid 'mode' value (not component/path/query/form) may default to component or return an error
- Invalid 'action' value (not encode/decode) may default to encode
- Non-UTF-8 input may produce unexpected results
- Payment failure (402) if USDC balance is insufficient

## How this service works

Percent-encode or decode text as URL component, path, query or form data (UTF-8), with byte counts.

## Output

Returns the encoded or decoded text string along with the input byte count, output length, the mode used (component/path/query/form), the action performed (encode/decode), a summary, and metadata such as the timestamp. Optionally includes degraded status and disclaimer fields.

## 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": [
      "text"
     ],
     "properties": {
      "mode": {
       "type": "string",
       "description": "component (default), path, query or form; form turns spaces into +"
      },
      "text": {
       "type": "string",
       "description": "The text to encode or decode (up to 2000 characters)"
      },
      "action": {
       "type": "string",
       "description": "encode (default) or decode"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "mode": {
       "type": [
        "null",
        "string"
       ]
      },
      "input": {
       "type": [
        "null",
        "string"
       ]
      },
      "action": {
       "type": [
        "null",
        "string"
       ]
      },
      "output": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "inputBytes": {
       "type": [
        "null",
        "number"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "outputLength": {
       "type": [
        "null",
        "number"
       ]
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/url-text-tools-percent-encode-decode-0ce59bf8/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)
