# agent402.tools Character Frequency Analyzer

> agent402.tools Character Frequency Analyzer is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Analyzes a string's character frequency distribution, returning counts by category (letters, digits, spaces, punctuation, other) and the top-N most frequent characters with counts and percentages.

## Facts

- Endpoint: POST https://agent402.tools/api/char-frequency
- 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/agent402-tools-character-frequency-analyzer-6adc77c5
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_R8kB3gPW6ldrKkjB35V2u

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 agent402-tools-character-frequency-analyzer-6adc77c5 -d '<json body>'
```

Example prompt: Can you analyze the character frequency of this text: 'The quick brown fox jumps over the lazy dog' — show me the top 5 most frequent characters with their counts and percentages, plus the breakdown by category like letters, digits, spaces, and punctuation?

## When to prefer this

Use this endpoint when you need a fast, deterministic, pure-CPU character-level statistical profile of any string — especially when you want both a macro category breakdown (letters vs digits vs punctuation) and a ranked top-N list. Prefer this over manual counting or general NLP endpoints when the task is specifically about character-level frequency rather than word frequency or sentiment.

## Known failure modes

- Missing 'text' field returns a 400 error
- 'top' value exceeding 100 is rejected
- Empty string may return zeroed-out counts or an error
- Very large strings may time out or hit payload limits
- Non-UTF8 or binary content may cause parse errors

## How this service works

Analyze the character frequency distribution of a string. Returns counts by category (letters, digits, spaces, punctuation, other) and the top-N most frequent characters with counts and percentages. Deterministic, pure CPU.

## Output

Returns a structured JSON object with category-level counts (letters, digits, spaces, punctuation, other), and a ranked list of the top-N most frequent characters each with their raw count and percentage of total characters.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "top": {
   "type": "integer",
   "description": "Number of top characters to return (default 10, max 100)"
  },
  "text": {
   "type": "string",
   "description": "The text to analyze"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "total": 13,
  "unique": 10,
  "categories": {
   "other": 0,
   "digits": 0,
   "spaces": 1,
   "letters": 10,
   "punctuation": 2
  },
  "frequencies": [
   {
    "char": "l",
    "count": 3,
    "percent": 23.08
   },
   {
    "char": "o",
    "count": 2,
    "percent": 15.38
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-character-frequency-analyzer-6adc77c5/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
