> ## Documentation Index
> Fetch the complete documentation index at: https://pdfbase.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# OCR extraction

> Extract text from scanned documents and images using OCR.

## Phase

**Phase 3** — Ships only if \$1K+ MRR. Requires Tesseract infrastructure.

## Request

<ParamField body="source" type="object" required>
  The PDF to OCR. Same source options as other endpoints.
</ParamField>

<ParamField body="pages" type="string" default="all">
  Pages to process. OCR is computationally expensive — scope to needed pages.
</ParamField>

<ParamField body="language" type="string" default="eng">
  OCR language. Supports Tesseract language codes: `eng`, `fra`, `deu`, `spa`, `por`, `ita`, `jpn`, `kor`, `chi_sim`, `chi_tra`, `hin`, `ara`.
</ParamField>

<ParamField body="format" type="string" default="text">
  `text`, `markdown`, or `structured`. Same as text extraction.
</ParamField>

<ParamField body="dpi" type="integer" default="300">
  Resolution for page-to-image conversion before OCR. Higher = more accurate, slower. Range: 150-600.
</ParamField>

## Response

Same shape as text extraction, with additional OCR-specific fields:

```json theme={null}
{
  "id": "ext_ocr1",
  "object": "extraction",
  "status": "completed",
  "format": "text",
  "method": "ocr",
  "language": "eng",
  "pages_extracted": 3,
  "content": "Extracted text from scanned document...",
  "confidence": 0.94,
  "created_at": "2026-05-19T13:05:00Z"
}
```

<ResponseField name="confidence" type="number">
  Average OCR confidence score across all pages. Range: 0.0 to 1.0. Below 0.7 indicates poor scan quality.
</ResponseField>

## Example

```bash theme={null}
curl -X POST https://api.pdfbase.dev/v1/extract/ocr \
  -H "Authorization: Bearer pk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "source": { "url": "https://example.com/scanned-contract.pdf" },
    "language": "eng",
    "dpi": 300,
    "format": "structured"
  }'
```
