URL encode
Try it interactively →POST /api/url-encodeURL-encode arbitrary text. Two modes: `component` (escapes `?&=#`, suitable for query values) and `path` (preserves `/`, suitable for path segments).
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| input* | string | — | Text to encode. |
| scope | enum (component | uri | form) | "component" | Encoding scope: `component` (encodeURIComponent), `uri` (encodeURI), or `form` (application/x-www-form-urlencoded). |
Response
Modes: json, text. Cache: yes (24h TTL).
Code samples
Built from the search example.
curl -X POST https://api.xtract.bot/api/url-encode \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"input": "hello world & foo=bar",
"scope": "component"
}'