# PennyRail URL Encode (encodeURIComponent)

> PennyRail URL Encode (encodeURIComponent) is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

URL-encodes an input string using JavaScript's encodeURIComponent semantics, escaping all characters except unreserved URI characters

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/p/nano/encoding.url-encode--encode-uri-component
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pennyrail-url-encode-encodeuricomponent-31dca71b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ah_BpGnNhrQk0xRM_AbQS

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 pennyrail-url-encode-encodeuricomponent-31dca71b -d '<json body>'
```

Example prompt: Can you URL-encode this string for me so I can safely use it as a query parameter: 'hello world & goodbye=world'?

## When to prefer this

Choose this endpoint when you need reliable, standards-compliant encodeURIComponent-style percent-encoding as a paid micro-service, particularly within x402 payment-enabled agent workflows where you want a simple, composable utility that handles encoding without running your own server-side code.

## Known failure modes

- Missing 'input' field in request body returns a validation error
- Payment failure or insufficient USDC balance prevents the call from executing
- Non-string input type may cause unexpected encoding or rejection
- Empty string input returns an empty string result without error
- Very long strings may hit payload size limits

## How this service works

Machine-readable settlement service

## Output

A JSON object containing the percent-encoded version of the input string, where all characters except A–Z, a–z, 0–9, -, _, ., and ~ are replaced with their %XX UTF-8 hex escape sequences, matching JavaScript's encodeURIComponent output.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-url-encode-encodeuricomponent-31dca71b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
