コンテンツにスキップ

API

Escriba は小さな REST API を公開しており、自動化(n8n、スクリプト)に便利です。認証は常に必要です。

API トークンを使う場合API_TOKEN を定義):

Terminal window
curl -H "X-API-Key: YOUR_TOKEN" \
-F "file=@document.pdf" \
https://your-domain/api/convert
# Force OCR / set language: -F "ocr=true" -F "lang=es-ES"

セッションクッキーを使う場合:

Terminal window
curl -c cookies.txt -F "password=$GOD_PASSWORD" https://your-domain/api/login
curl -b cookies.txt -F "file=@document.pdf" https://your-domain/api/convert

POST /api/convert(multipart/form-data):file または url、加えて任意の langocrpagesllm_providerllm_api_keyllm_model。レスポンス:

{ "source": "", "title": "", "markdown": "",
"words": 1234, "chars": 5678, "elapsed_ms": 87,
"pdf_type": "scanned", "ocr_applied": true, "note": null }

POST /api/redact(multipart/form-data):file(PDF または画像)、任意の langanon_strictanon_detectorsanon_rules墨消し PDF(バイナリ)を返し、X-Redacted-Entities ヘッダーに黒塗りした件数を示します。

JSON を入力し、JSON またはファイルを出力します。

エンドポイントメソッド説明
/api/exportPOSTMarkdown を対象形式(docxodtepubhtmllatexrstdocbookjatsteiopml)に変換します。
/api/compactPOSTトークンを節約するために空白を除去した Markdown。
/api/chunkPOSTトークン上限つきの RAG チャンク(.jsonl を返します)。
/api/model_pricesGETリアルタイムのモデル価格とコンテキストウィンドウ(OpenRouter、キャッシュ済み)。