# IranTools Encoding Detection

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

Detects the character encoding of a given byte sequence (e.g., UTF-8, ISO-8859-1, Windows-1256)

## Facts

- Endpoint: POST https://irantools.johnaio281.workers.dev/api/iran/detect_encoding?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/irantools-encoding-detection-71bdfc23
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_RDGOuAKFyJxnqGduxySa-

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-encoding-detection-71bdfc23 -d '<json body>'
```

Example prompt: Can you detect the encoding of these raw bytes so I know how to decode them before processing the Persian text: 'SGVsbG8gV29ybGQ='?

## When to prefer this

Use this endpoint when you need to identify the character encoding of raw bytes, especially for Persian, Arabic, or other Middle Eastern text that may use Windows-1256, CP1256, or similar legacy encodings. It is part of a broader IranTools suite and is particularly well-suited for pipelines that process Iranian documents, legacy files, or scraped Persian web content before normalization or Unicode conversion.

## Known failure modes

- Missing or empty 'bytes' field returns a validation error
- Ambiguous byte sequences may return low-confidence or multiple candidate encodings
- Very short byte inputs may not provide enough signal for accurate detection
- Non-base64 or malformed byte strings may cause parsing errors
- Extremely rare encodings may not be recognized

## 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 a JSON object indicating the detected encoding name (e.g., UTF-8, ISO-8859-1, Windows-1256, CP1256) along with likely confidence or metadata about the detection result.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/irantools-encoding-detection-71bdfc23/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)
