{"uid":"cap_w2ITfKuh7junlCNZS-TDU","slug":"arabic-text-repair-for-pdf-and-ocr-extraction-bf786719","name":"Arabic Text Repair for PDF and OCR Extraction","description":"Repair Arabic text extracted from PDFs and OCR. Many PDFs encode Arabic as Unicode Presentation Forms: it renders identically but is a different byte sequence, so search and retrieval fail silently and invisibly. Also fixes visual-order reversal, invisible bidi controls, and Arabic-Indic digits that NFKC does not convert. Deterministic and lossless — encoding only, never wording. Essential for RAG pipelines ingesting Arabic documents.","url":"https://api.qist.info/api/arabic/repair?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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":"Arabic text extracted from a PDF, OCR engine, or document parser (max 100,000 chars)"},"reverse":{"type":"string","description":"Override visual-order detection: 'true' forces line reversal, 'false' prevents it. Omit for auto-detection."},"normalizeDigits":{"type":"string","description":"Set 'false' to keep Arabic-Indic digits (٠-٩) instead of converting to ASCII. Default converts."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_tUKtDpVoegT2xHARhF1mD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Repairs Arabic text extracted from PDFs and OCR by normalizing Unicode Presentation Forms, fixing visual-order reversal, removing invisible bidi controls, and converting Arabic-Indic digits to ASCII.","exampleAgentPrompt":"I just extracted some Arabic text from a PDF and it's full of Unicode Presentation Forms and reversed characters — can you repair it so it's properly normalized and searchable? Here's the text: [paste Arabic text here]","exampleUseCases":[{"title":"RAG pipeline Arabic document ingestion","prompt":"I'm building a RAG system that ingests Arabic PDFs and the retrieved text is full of Unicode Presentation Forms — search never matches anything. Can you repair this Arabic chunk so it's properly normalized: 'ﻣﺮﺣﺒﺎ ﺑﺎﻟﻌﺎﻟﻢ'?"},{"title":"Arabic OCR output cleanup","prompt":"My OCR engine scanned an Arabic contract and the extracted text looks visually correct but has encoding issues — bidi controls and reversed lines. Please fix this Arabic text so it's in logical order and clean Unicode: 'ﺍﻟﻌﻘﺪ ﺍﻟﻤﺒﺮﻡ ﺑﻴﻦ ﺍﻟﻄﺮﻓﻴﻦ'."},{"title":"Arabic search index repair","prompt":"I have Arabic text extracted from a legal document that fails keyword search even though it looks fine on screen — it's probably using presentation forms. Repair this text and keep the Arabic-Indic digits as-is (don't convert them to ASCII): 'ﺍﻟﻤﺎﺩﺓ ٣ ﻣﻦ ﺍﻟﻘﺎﻧﻮﻥ'."}],"resultDescription":"Returns the repaired Arabic text as a string with Unicode Presentation Forms converted to standard Arabic codepoints, visual-order reversal corrected, invisible bidi control characters removed, and Arabic-Indic digits optionally converted to ASCII — encoding only, never altering wording or meaning.","failureModes":["Input text exceeds 100,000 character limit — request rejected","Non-Arabic or empty text passed — may return unchanged or error","Invalid 'reverse' parameter value (not 'true'/'false') — behavior undefined","Network timeout for very large inputs near the character limit","Payment failure (x402 protocol) — 402 response before processing"],"whenToPreferThis":"Choose this endpoint when ingesting Arabic text from PDFs, OCR engines, or document parsers into search indexes or RAG pipelines where Unicode Presentation Forms cause silent retrieval failures. It is deterministic and lossless — ideal when you need byte-level normalization without risk of changing meaning. Prefer over generic Unicode normalization (NFKC) because it handles Arabic-specific cases NFKC misses, including visual-order reversal and Arabic-Indic digit conversion.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-13T06:34:44.400Z","isFirstParty":false,"canonicalSlug":"arabic-text-repair-for-pdf-and-ocr-extraction-bf786719"}