What it does
Recognise the text of a scanned PDF or photo, in the languages you pick, and get a searchable PDF or the text as plain text, Markdown, JSON or Word.
It reads one AVIF, BMP, CSV, DOCX, EML, GIF, JPEG, JPG, MSG, PDF, PNG, PPTX, TIF, TIFF, TSV, WEBP, XLSX or ZIP file. You get: a searchable PDF, or the recognised text.
Step by step on the website
Use OCR PDF
Open OCR PDF on the website.
Open OCR PDFAdd a scanned PDF or a photo of a document.
Choose Read for the full text, or Extract for fields and tables, then the formats you want.
Select Run OCR, then download each format when it is ready.
Settings
Every setting, with the name the page shows and the name the API uses. On the page: shown next to your file. More options: under More options. API only: not offered on the website.
| Setting | API name | Choices or values | Default | Where | What it does |
|---|---|---|---|---|---|
| Mode | mode | Read (read), Extract (extract) | Read | On the page | How to work. |
| Languages | languages | Text | en | On the page | Languages on the page, as comma-separated codes from the OCR language list, at most 10, such as "en,hi"; auto detects them. |
| Output mode | outputMode | Searchable pdf (searchable-pdf), Text (text), Markdown (markdown), Json (json), DOCX (docx), HTML (html), XLSX (xlsx), CSV (csv), Hocr (hocr), Alto (alto), Block json (block-json), Annotation json (annotation-json) | Searchable pdf | On the page | The result document: a searchable PDF with an invisible text layer, or the recognised text as plain text, Markdown, JSON, Word, HTML, Excel, CSV, hOCR, ALTO XML, block JSON or annotation JSON (every format the dashboard OCR offers). |
| Outputs | outputs | Text | On the page | Further formats from the same result, comma-separated output formats, such as "text,xlsx". Each becomes its own derived document, listed in the operation's result metadata (outputs). | |
| Features | features | Text | text,layout | More options | What to read, comma-separated: text, layout, tables, forms (labels and their filled values), signatures. Questions (queries) add the queries feature by themselves. |
| Quality | quality | Fast (fast), Standard (standard), High (high) | Standard | More options | Higher keeps more detail and makes a larger file. |
| Pages | pageRange | Text | More options | Leave empty for every page. | |
| Template id | templateId | Text | On the page, when Mode is Extract | Extract with one of your saved OCR templates (an ocrtpl_ id from Dashboard, OCR, Templates; it must be ready). Use a template, queries or a schema, not more than one. | |
| Queries | queries | Text | More options | Questions to answer from the document, one per line, up to 30 of up to 200 characters, such as "What is the policy number?". | |
| Schema | schema | Text | On the page, when Mode is Extract | Extract only: the fields to extract, as a JSON schema object (up to 64 KB). | |
| Shaping | shaping | Text | On the page, when Mode is Extract | Extract only: the columns and number style of the Excel and CSV outputs, as a JSON object; the template's layout or the default when empty. | |
| Password | password | Text | More options | Anyone opening the PDF will need it. | |
| Save history | saveHistory | On (true), Off (false) | Off | More options | Keep the OCR results for 30 days and list the job in your OCR history (otherwise they are deleted after 1 hour). |
| Webhook URL | webhookUrl | Text | More options | An OCR webhook endpoint registered on your account (Dashboard, OCR, Webhooks), told when the OCR job ends. | |
| Priority | priority | Standard (standard), Batch (batch) | Standard | More options | batch costs half the credits and can take up to 45 minutes; jobs over 200 pages always run as batch. |
| File name | outputName | Text | More options | Optional. The extension is added for you. |
Run it with the API
Upload your file with POST /api/v2/documents, then start OCR PDF with POST /api/v2/document-operations and toolId ocr-pdf. The parameters use the API names in the settings table; anything you leave out takes its default. Read the operation until its state is completed, then download the output version.
The request below uses the same starting settings as the website. The script after it does the whole journey: upload, run, wait and download.
{
"documentId": "doc_8kq2W1",
"versionId": "ver_3Jx9Lm",
"toolId": "ocr-pdf",
"parameters": {},
"idempotencyKey": "ocr-pdf-2026-11-22-1"
}#!/usr/bin/env bash
# Needs curl and jq.
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
API="${WELLFRIEND_API_URL:-https://wellfriend.dev}"
WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
AUTH="Authorization: Bearer $WELLFRIEND_API_KEY"
RUN=$(uuidgen) # reuse this value to retry safely
# upload FILE CONTENT_TYPE KEY: prints the document id and its version id
upload() {
curl -sS --fail-with-body -X POST "$API/api/v2/documents" -H "$AUTH" -H "Idempotency-Key: $3" \
-H "Content-Type: $2" -H "X-Wellfriend-Filename: $(basename "$1")" --data-binary "@$1" \
| jq -r '"\(.document.id) \(.document.currentVersion.id)"'
}
read -r DOCUMENT_ID VERSION_ID < <(upload 'input.pdf' 'application/pdf' "$RUN-upload")
# Run ocr-pdf
OP=$(jq -n --arg doc "$DOCUMENT_ID" --arg ver "$VERSION_ID" --arg key "$RUN-1" \
--argjson parameters '{}' \
'{documentId: $doc, versionId: $ver, toolId: "ocr-pdf", parameters: $parameters, idempotencyKey: $key}' \
| curl -sS --fail-with-body -X POST "$API/api/v2/document-operations" -H "$AUTH" \
-H "Content-Type: application/json" -H "Idempotency-Key: $RUN-1" --data-binary @- | jq -r .operation.id)
while :; do
RESULT=$(curl -sS --fail-with-body "$API/api/v2/document-operations/$OP" -H "$AUTH")
STATE=$(echo "$RESULT" | jq -r .operation.state)
case "$STATE" in completed) break ;; failed|cancelled|canceled) echo "$RESULT" >&2; exit 1 ;; esac
sleep 1
done
DOCUMENT_ID=$(echo "$RESULT" | jq -r .operation.outputDocumentId)
VERSION_ID=$(echo "$RESULT" | jq -r .operation.outputVersionId)
# Download the result
curl -sS --fail-with-body "$API/api/v2/documents/$DOCUMENT_ID/versions/$VERSION_ID/content" -H "$AUTH" -o 'input-wellfriend.pdf'Run it with the SDKs
The SDKs upload the file, run ocr-pdf with the same parameters and wait for the result: wf.tools.ocrPdf() in TypeScript, wf.tools.ocr_pdf() in Python, wf.Tools.OCRPDF() in Go.
// wellfriend-document-sdk: npm install wellfriend-document-sdk@latest. An ES module (top-level await): save it as .mts.
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import { Wellfriend } from "wellfriend-document-sdk";
const wf = new Wellfriend({ apiKey: process.env.WELLFRIEND_API_KEY ?? "YOUR_API_KEY" });
const result = await wf.tools.ocrPdf("input.pdf");
await result.save("input-wellfriend.pdf");# wellfriend-document-sdk: pip install -U wellfriend-document-sdk
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import os
from wellfriend import Wellfriend
wf = Wellfriend(api_key=os.environ.get("WELLFRIEND_API_KEY", "YOUR_API_KEY"))
result = wf.tools.ocr_pdf("input.pdf")
result.save("input-wellfriend.pdf")// go get wellfriend.dev/go/wellfriend@latest
package main
import (
"context"
"fmt"
"os"
"wellfriend.dev/go/wellfriend"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
apiKey := os.Getenv("WELLFRIEND_API_KEY")
if apiKey == "" {
apiKey = "YOUR_API_KEY"
}
wf := wellfriend.New(wellfriend.WithAPIKey(apiKey))
ctx := context.Background()
res, err := wf.Tools.OCRPDF(ctx, wellfriend.File("input.pdf"), nil)
if err != nil {
return err
}
return res.Save(ctx, "input-wellfriend.pdf")
}