# Web2Markdown Text Counter (chars/words/lines/bytes)

> Web2Markdown Text Counter (chars/words/lines/bytes) 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).

Counts characters, words, lines, and UTF-8 bytes in a given text string

## Facts

- Endpoint: GET https://lin-desk-x402.lindesk.workers.dev/v1/texttools/count?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-counter-chars-words-lines-bytes-86c57af4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_VY6ZYoIbOVjTb4cJSx0IR

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-counter-chars-words-lines-bytes-86c57af4
```

Example prompt: Count the words, characters, lines, and UTF-8 bytes in this text: 'The quick brown fox jumps over the lazy dog.'

## When to prefer this

Use this endpoint when you need fast, precise text statistics (character, word, line, and byte counts) for a string — especially useful for validating text against LLM token/character limits, checking content lengths before storage or API submission, or gathering basic readability metrics. Prefer this over client-side counting when operating inside an agent pipeline where a trusted, server-side count is needed.

## Known failure modes

- Missing required 'input' query parameter returns an error
- Input text exceeding 100 KiB limit may be rejected
- Non-text or binary input may produce inaccurate counts
- Payment failure (402) if USDC payment on Base is not completed

## 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

Returns a JSON object with the operation name ('count'), metadata (chars_in, chars_out, elapsed_ms), and a result object containing: chars (character count), lines (line count), words (word count), and bytes_utf8 (UTF-8 byte size of the input text).

## 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"
      }
     }
    }
   },
   "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": "count",
  "meta": {
   "chars_in": 16,
   "chars_out": 55,
   "elapsed_ms": 0
  },
  "result": {
   "chars": 16,
   "lines": 2,
   "words": 3,
   "bytes_utf8": 24
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/web2markdown-text-counter-chars-words-lines-bytes-86c57af4/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)
