# URL Encoder/Decoder (Percent Encoding)

> URL Encoder/Decoder (Percent Encoding) is a paid API for AI agents from api.x402node.dev, paid per call via x402, $0.0022/call, status unknown (last checked 2026-09-14).

Encodes or decodes URLs using percent encoding (RFC 3986), equivalent to encodeURIComponent/decodeURIComponent for safe HTTP transmission.

## Facts

- Endpoint: GET https://api.x402node.dev/encode/url
- Price: $0.0022/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-x402node-dev-ab7f8ea4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vkmU2z-yGrysvPdKMDnbY

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 api-x402node-dev-ab7f8ea4
```

Example prompt: Can you percent-encode this string so it's safe to use as a URL query parameter: 'hello world & goodbye=true'?

## When to prefer this

Use this endpoint when you need server-side, RFC 3986-compliant URL encoding or decoding without relying on client-side JavaScript functions like encodeURIComponent; useful in agent pipelines where JavaScript is unavailable and a trusted remote conversion is needed.

## Known failure modes

- Empty or missing input string returns an error
- Malformed percent-encoded sequences when decoding may return an error or partial result
- Payment failure returns HTTP 402 if USDC balance is insufficient

## How this service works

URL encoder/decoder, percent encoding, RFC 3986, query string escape, form data, encodeURIComponent, decodeURIComponent. Safely escape URLs for HTTP. Accepts payment on Base or Solana — either network works.

## Output

Returns the percent-encoded or decoded version of the input string, with special characters properly escaped or unescaped per RFC 3986 / encodeURIComponent semantics.

## Example request

```json
{
 "text": "hello world & goodbye=true",
 "operation": "encode"
}
```

## 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": "Operation mode (optional)"
      },
      "text": {
       "type": "string",
       "description": "Input text (required)"
      }
     }
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-x402node-dev-ab7f8ea4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.x402node.dev](https://www.zero.xyz/host/api.x402node.dev/llms.txt)
