# x402-portfolio Text Cleaner

> x402-portfolio Text Cleaner is a paid API for AI agents from x402-portfolio.x402iom.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-14).

Cleans raw text by stripping HTML tags, normalising Unicode and whitespace, deduplicating lines, and optionally lowercasing — returning cleaned text plus processing stats.

## Facts

- Endpoint: POST https://x402-portfolio.x402iom.workers.dev/text/clean
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-portfolio-text-cleaner-df39d08b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_V-CQz-fU6c75YWX2reAnw

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 x402-portfolio-text-cleaner-df39d08b -d '<json body>'
```

Example prompt: Clean up this block of scraped HTML — strip all the tags, normalize the unicode, deduplicate repeated lines, and normalize the whitespace so I get back just the plain readable text with stats on what was changed.

## When to prefer this

Choose this endpoint when you need a fast, configurable, all-in-one text cleaning step — particularly after web scraping or when ingesting user-generated content that may contain HTML artifacts, inconsistent unicode, redundant lines, or irregular whitespace. Prefer it over building custom regex pipelines for common cleaning tasks, especially in agentic workflows where text needs to be clean before downstream NLP or storage steps.

## Known failure modes

- Input text exceeds 500KB limit — request rejected
- Malformed JSON body — 400 error returned
- Invalid options fields (e.g. non-boolean values) — validation error
- Service unavailable or worker cold-start timeout — 5xx error
- Empty text input — may return empty string with zero stats

## How this service works

Clean text: strip HTML, normalise unicode/whitespace, dedupe lines. Returns cleaned text plus stats.

## Output

Returns the fully cleaned text string after applying the requested transformations (HTML stripping, unicode normalization, whitespace normalization, lowercasing, line deduplication), along with statistics such as the number of lines removed, characters stripped, or other processing metrics.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "text": {
   "type": "string",
   "description": "Input text (max 500KB)"
  },
  "options": {
   "type": "object",
   "properties": {
    "lowercase": {
     "type": "boolean"
    },
    "stripHtml": {
     "type": "boolean"
    },
    "dedupeLines": {
     "type": "boolean"
    },
    "normalizeUnicode": {
     "type": "boolean"
    },
    "normalizeWhitespace": {
     "type": "boolean"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-portfolio-text-cleaner-df39d08b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-portfolio.x402iom.workers.dev](https://www.zero.xyz/host/x402-portfolio.x402iom.workers.dev/llms.txt)
