# Text & Number Toolkit (`thenightowl/text-number-toolkit`) Actor

Amounts and numbers in words in 56 languages with correct Arabic cheque grammar; CLDR number formatting and parsing (lakh grouping, Arabic-Indic digits); digit conversion, Arabic normalisation, transliteration, script detection; date parsing in 200 locales + Hijri. MCP server + REST. No logging.

- **URL**: https://apify.com/thenightowl/text-number-toolkit.md
- **Developed by:** [Mohamad Najia](https://apify.com/thenightowl) (community)
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Text & Number Toolkit — amounts in words, locale numbers, Arabic text, human dates — for AI agents

**MCP server + REST API.** Ten deterministic tools for the multilingual chores agents fumble: writing **AED 1,250.50 on a
cheque in Arabic** with the right grammar (*فقط ألف ومئتان وخمسون درهماً وخمسون فلساً لا غير*), formatting
**₹12,34,567.89** the Indian way, reading *1.234,56* as a German reader would, turning *١٥ رمضان ١٤٤٧* or *3 mars 2026* into
an ISO date, cleaning Arabic text for search, and romanising any script to ASCII.

No AI inside — rules and Unicode/CLDR data — so results are exact, repeatable and cheap. Every answer states its confidence,
what was assumed, and the standard behind it. Nothing is logged.

### Tools (10)

| tool | what | price |
|---|---|---|
| `amount_to_words` | money in words, 56 languages; Arabic with number–noun agreement and the right minor unit for 28 currencies; `cheque` style | $0.001 |
| `number_to_words` | cardinal / ordinal / year in 56 languages | free\* |
| `format_number` | CLDR formatting: decimal, currency, percent; lakh grouping, Arabic-Indic digits, symbol placement | $0.001 |
| `parse_number` | read `1.234,56`, `١٬٢٣٤٫٥٦`, `12 345,6` into an exact decimal; flags heuristic reads | $0.001 |
| `convert_digits` | Western ↔ Arabic-Indic ↔ Persian digits inside any text | free\* |
| `normalize_arabic` | strip tashkeel/tatweel, unify alef, optional ة→ه ى→ي, digits, punctuation; reports what changed | $0.001 |
| `transliterate` | any script → ASCII (slugs, matching); Arabic names flagged low-confidence | $0.001 |
| `detect_script` | scripts, direction, mixed-script flag, digit systems, Persian/Urdu hints | free |
| `parse_date` | human dates in 200 locales + relative phrases + **Hijri** (Umm al-Qura) → ISO, with precision and language | $0.002 |
| `list_languages` | supported languages and curated currencies | free |

\* free on the self-hosted endpoint without a key (rate-limited); metered on Apify.

### Why the Arabic amount grammar matters

Arabic counted nouns change form with the number: *درهم واحد* (1), *درهمان* (2), *ثلاثة دراهم* (3–10), *أحد عشر درهماً*
(11–99), *مائة درهم* (100), *مئتا دينار* (200). Generic libraries get this wrong, and a cheque or contract with the wrong form
looks amateurish at best. This toolkit encodes the rule and the correct minor units (فلس، هللة، قرش، بيسة…) for the GCC,
Levant, North Africa and major world currencies; anything else falls back to the CLDR name and says so.

### Example

```json
// parse_date {"text": "١٥ رمضان ١٤٤٧"}
{"result": {"input": "١٥ رمضان ١٤٤٧", "calendar": "hijri", "hijri": "1447-09-15", "date": "2026-03-04", "weekday": "Wed", "language": "ar"},
 "data_confidence": "medium",
 "estimated_items": ["Hijri→Gregorian by the Umm al-Qura calendar (±1 day vs. local moon sighting)"],
 "sources": ["https://github.com/dralshehri/hijridate"], "data_version": "2026.10.31-1", "warnings": [], "disclaimer": null}
```

### Connect

- **Apify (metered):** Standby URL + `/mcp`, header `Authorization: Bearer <your Apify token>`.
- **Self-hosted:** `claude mcp add textkit --transport http https://textkit.noahsarch.tech/mcp --header "X-API-Key: <key>"` — one Noah's Arch key works for all our agents.
- **REST:** `POST https://textkit.noahsarch.tech/v1/tools/<tool>`; OpenAPI at `/openapi.json`, docs at `/docs`.

### Built on

[num2words](https://github.com/savoirfairelinux/num2words) (56 languages), [Babel](https://babel.pocoo.org/) (CLDR),
[dateparser](https://github.com/scrapinghub/dateparser) (200 locales), [hijridate](https://github.com/dralshehri/hijridate)
(Umm al-Qura), [anyascii](https://github.com/anyascii/anyascii), plus our own Arabic grammar and normalisation layer.
All pure Python; no network at request time.

***

### بالعربية

**عدّة النصوص والأرقام** — عشر أدوات حتمية لوكلاء الذكاء الاصطناعي: كتابة المبالغ بالحروف في 56 لغة مع قواعد العدد والمعدود
الصحيحة بالعربية (درهم واحد، درهمان، ثلاثة دراهم، أحد عشر درهماً) والوحدات الصغرى الصحيحة (فلس، هللة، قرش…) للشيكات والعقود؛
تنسيق الأرقام وقراءتها حسب كل منطقة؛ تحويل الأرقام الهندية/اللاتينية؛ تطبيع النص العربي للبحث؛ النقحرة إلى ASCII؛ وقراءة التواريخ
المكتوبة بلغة بشرية في 200 لغة بما فيها التواريخ الهجرية. لا ذكاء اصطناعي داخلها ولا تسجيل للاستعلامات.

# Changelog

This Actor's version history is a separate document: https://apify.com/thenightowl/text-number-toolkit/changelog.md

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `mcpEndpoint` (type: `string`):

Point your MCP client here (Authorization: Bearer <Apify token>). 10 tools: amount_to_words, number_to_words, format_number, parse_number, convert_digits, normalize_arabic, transliterate, detect_script, parse_date, list_languages.

## `readiness` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("thenightowl/text-number-toolkit").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("thenightowl/text-number-toolkit").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call thenightowl/text-number-toolkit --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenightowl/text-number-toolkit"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BRUpFsBnclgZwc2kB/builds/QnhzvhsrkfKfbDVpM/openapi.json
