# Farsi Tools - Persian Text Statistics

> Farsi Tools - Persian Text Statistics is a paid API for AI agents from farsi-tools.johnaio281.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-29).

Computes character, word, line, and ZWNJ statistics for a given Persian (Farsi) text string

## Facts

- Endpoint: GET https://farsi-tools.johnaio281.workers.dev/api/fa/stats?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-29
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/farsi-tools-persian-text-statistics-79105cc8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1OA-v99P10Hpob4FnwPVW

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 farsi-tools-persian-text-statistics-79105cc8
```

Example prompt: Can you give me the character count, word count, line count, and ZWNJ usage for this Persian text: 'سلام دنیا'?

## When to prefer this

Choose this endpoint when you need to compute basic text statistics (character, word, line, ZWNJ counts) specifically for Persian/Farsi text. It is the right choice when working with right-to-left Persian Unicode content and especially when ZWNJ character detection is needed, which general-purpose text tools often handle incorrectly for Persian.

## Known failure modes

- Missing 'text' query parameter returns an error
- Input exceeding 100,000 characters may be rejected
- Non-Persian or empty text may return zero counts without error
- Payment failure (x402) results in 402 response before processing
- Malformed JSON body returns 400 error

## How this service works

Persian (Farsi) and Iranian utility API for AI agents. Text normalization, transliteration, Jalali (Solar Hijri) calendar conversion, Persian digits and number-to-words, Iranian national ID / Sheba (IBAN) / mobile / landline / postal code / bank card (Luhn PAN) / company ID / economic code validators, Iranian provinces and cities, official Jalali holidays, Rial-Toman conversion. Also a FIXED-PRICE deliverable SKU: Persian/Arabic data cleanup at $0.90, $9 or $25 flat per file (not per call) - upload a CSV, TSV or text file and get it back normalized, with an optional Latin transliteration column. Pay per request in USDC on Base via x402 - no signup, no API key, no KYC.

## Output

Returns a JSON object with a 'stats' key containing: 'chars' (total character count), 'words' (word count), 'lines' (line count), and 'zwnj' (count of zero-width non-joiner characters) for the submitted Persian 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Persian (Farsi) text or value to process. Max 100000 characters."
      },
      "options": {
       "type": "object",
       "description": "optional, e.g. {\"digits\":\"ascii\"}"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "stats": {
   "zwnj": 0,
   "chars": 9,
   "lines": 1,
   "words": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/farsi-tools-persian-text-statistics-79105cc8/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from farsi-tools.johnaio281.workers.dev](https://www.zero.xyz/host/farsi-tools.johnaio281.workers.dev/llms.txt)
