# Web2Markdown Text Normalizer (Whitespace Collapse)

> Web2Markdown Text Normalizer (Whitespace Collapse) is a paid API for AI agents from lin-desk-x402.lindesk.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-11).

Normalizes and cleans raw text by collapsing whitespace and standardizing formatting, returning LLM-ready plain text.

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/texttools/normalize?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-11
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/web2markdown-text-normalizer-whitespace-collapse-7d04f2b8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MoSSK6U1u6-AD3pGBBDso

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 web2markdown-text-normalizer-whitespace-collapse-7d04f2b8
```

Example prompt: Clean up this scraped text by collapsing all the extra whitespace and newlines so it's ready to pass to an LLM: 'Hello   World\n\n\n  This   is   messy   text.'

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call text normalization step with no API key or signup overhead, especially in agentic pipelines where you need to clean up scraped or extracted text before passing it to an LLM. Ideal when whitespace collapse is the primary cleaning operation needed and you want a fast, stateless transformation with measurable char-in/char-out metrics.

## Known failure modes

- Input text exceeds 100 KiB limit — request rejected
- Missing required 'input' query parameter — API returns error
- Payment not fulfilled via x402 protocol — 402 Payment Required response
- Invalid 'collapse_whitespace' enum value (must be 'true' or 'false') — validation error
- Empty input string — may return empty result with zero chars_out

## How this service works

Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.

## Output

A JSON object containing the operation name ('normalize'), metadata with input character count, output character count, and elapsed milliseconds, and the cleaned result string with whitespace normalized.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "input"
     ],
     "properties": {
      "input": {
       "type": "string",
       "description": "Input text; max 100 KiB"
      },
      "collapse_whitespace": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "Collapse runs of whitespace"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "op": {
       "type": "string"
      },
      "meta": {
       "type": "object",
       "properties": {
        "chars_in": {
         "type": "integer"
        },
        "chars_out": {
         "type": "integer"
        },
        "elapsed_ms": {
         "type": "integer"
        }
       }
      },
      "result": {}
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "op": "normalize",
  "meta": {
   "chars_in": 13,
   "chars_out": 11,
   "elapsed_ms": 0
  },
  "result": "Hello World"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web2markdown-text-normalizer-whitespace-collapse-7d04f2b8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from lin-desk-x402.lindesk.workers.dev](https://www.zero.xyz/host/lin-desk-x402.lindesk.workers.dev/llms.txt)
