# IranTools Grapheme Count

> IranTools Grapheme Count is a paid API for AI agents from irantools.johnaio281.workers.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-22).

Counts the number of grapheme clusters (visible characters) in a string, correctly handling Unicode including Persian/Arabic text

## Facts

- Endpoint: POST https://irantools.johnaio281.workers.dev/api/iran/grapheme_count?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/irantools-grapheme-count-206cd7b4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FSDzbiINTRFf9S21SWuU0

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 irantools-grapheme-count-206cd7b4 -d '<json body>'
```

Example prompt: How many visible characters are in this Persian text: 'سلام دنیا'? I need the real grapheme cluster count, not the raw byte or code-point length.

## When to prefer this

Use this endpoint when you need the true visible character count of a Unicode string, especially for Persian, Arabic, or other scripts where a single glyph may span multiple code points or bytes. Prefer this over JavaScript's .length or Python's len() when working with combining characters, diacritics, or emoji, where those built-ins return code-unit or code-point counts rather than user-perceived character counts.

## Known failure modes

- Missing required 'text' field returns a 400-level error
- Extremely large input strings may time out or exceed payload limits
- Non-string values for 'text' may return a validation error

## How this service works

Persian and Iranian utilities for AI agents, plus general text/Unicode tooling. Jalali (Solar Hijri) calendar conversion, Iranian national ID / SHEBA / bank card / postal code / economic code validation, province and city lookup, official public holidays, Persian text normalization, keyword extraction, sentence splitting, similarity, HTML stripping, RTL fixing, Unicode homoglyph folding, script detection, NFC/NFD normalization, grapheme counting, date description, business-day counting, slugify, FNV-1a hashing, Shannon entropy, format and encoding detection, byte sizes. Pay per call in USDC on Base via x402 - no signup, no API key, no KYC. The same tools are also exposed as MCP tools at /mcp.

## Output

Returns an object containing the grapheme cluster count of the input text — the number of user-perceived characters, correctly segmenting combining marks, zero-width joiners, emoji sequences, and multi-codepoint Persian/Arabic glyphs into single graphemes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "text"
 ],
 "properties": {
  "text": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/irantools-grapheme-count-206cd7b4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from irantools.johnaio281.workers.dev](https://www.zero.xyz/host/irantools.johnaio281.workers.dev/llms.txt)
