Utilities

Arabic Text Processing

Arabic text processing with 8 operations including normalization, transliteration, script detection, fuzzy bilingual name matching, number conversion, word counting, and sentiment analysis. Supports up to 10,000 characters per request.

Endpoint:/api/v1/arabic/process
Methods:GETPOST
Latency:~5ms

Try it out

POST/api/v1/arabic/process

Parameters

Used for this request only; it is not saved.

Code

curl
curl -X POST "https://khaleejiapi.dev/api/v1/arabic/process?operation=remove_diacritics&text=%D9%85%D9%8E%D8%B1%D9%92%D8%AD%D9%8E%D8%A8%D9%8B%D8%A7%20%D8%A8%D9%90%D8%A7%D9%84%D8%B9%D9%8E%D8%A7%D9%84%D9%8E%D9%85&options.compareTo=Mohammed%20Abdullah" \
-H "Authorization: Bearer your_api_key"

Methods

GET — API Info

Returns the list of supported operations and their descriptions. No parameters needed.

POST — Process Text

Process Arabic text with the specified operation. Send operation, text, and optional options in the request body.

POST Request Body

FieldTypeRequiredDescription
operationstringRequiredProcessing operation (see Operations below)
textstringRequiredText to process (max 10,000 characters); first name for name_match
options.directionstringOptionalFor convert_numbers: 'to_arabic' or 'to_western'
options.compareTostringOptionalSecond name to compare (required for name_match)

Operations

remove_diacritics

Strip diacritical marks (tashkeel) from Arabic text

مَرْحَبًا → مرحبا

normalize

Normalize Arabic characters (alef variants → ا, taa marbuta → ه, alef maqsurah → ي, diacritics, and whitespace)

إبراهيم → ابراهيم

transliterate

Convert Arabic text to Latin transliteration

مرحبا → mrhba

detect_script

Detect whether text is Arabic, Latin, mixed, or other script

Returns { script, confidence, details }

convert_numbers

Convert between Arabic-Indic (٠١٢) and Western (012) numerals

١٢٣ → 123 (use options.direction)

word_count

Count words, characters, sentences, and paragraphs

Returns { words, characters, sentences, paragraphs }

sentiment

Lexicon-based sentiment analysis for Arabic text

Returns { sentiment, score, positive/negative counts }

name_match

Compare two Arabic, Latin, or mixed-script names using normalized edit distance; treat the score as a review aid, not identity verification

محمد عبد الله vs Mohammed Abdullah → { matchScore, isMatch, method }

Response Fields

operation

The operation that was performed

original

The original input text

result

The processed text result (string or object depending on operation)

metadata

Operation-specific metadata (counts, statistics, etc.)

Rate Limits

PlanRequests/MonthRate Limit
Free1,00020 req/min
Starter10,00060 req/min
Professional100,000300 req/min
Business500,000500 req/min

Debugging & Support

Include X-Request-ID when contacting support

Every response from KhaleejiAPI includes an X-Request-ID header — a unique identifier that lets our support team pull the exact log entry for your request within seconds. Always share it when reporting an unexpected error or unexpected result.

How to capture it

JavaScript / fetch

const res = await fetch("https://khaleejiapi.dev/api/v1/...", {
  headers: { Authorization: "Bearer YOUR_API_KEY" },
});
const requestId = res.headers.get("x-request-id");
console.log("Request ID:", requestId);
// → e.g. "req_01j9xkz4vp8..."

cURL

curl -si "https://khaleejiapi.dev/api/v1/..." \
  -H "Authorization: Bearer YOUR_API_KEY" | grep -i x-request-id
# → x-request-id: req_01j9xkz4vp8...

Browser DevTools

Open DevTools (F12) → Network tab → click the failing request → scroll to the Response Headers section → copy the value next to x-request-id.

For a full list of error codes and guidance on common issues, see the Troubleshooting guide.