Skip to content
Webfold Docs
Esc
↑↓navigate↵open⌘Jpreview

Extract text from a PDF, with OCR for scans

Reads the PDF’s own text layer first (method: text). If there is none, renders the pages and recognises them with Tesseract (method: ocr). Up to 25 MiB decoded. Concurrent OCR jobs are capped per instance and extra requests get 503; retry shortly. Metered as ocr.pdf.

POST/v1/ocr
Authorization
AuthorizationBearer token (JWT) · headerrequired

Bearer API key issued for your account. Send Authorization: Bearer <key>.

Request body
requiredapplication/json
content_base64stringrequired

The PDF, base64. Up to 25 MiB decoded.

languagesstring

Tesseract language codes.

default: "eng"
max_pagesinteger
min 1 · max 200 · default: 20
timeout_secsinteger
min 1 · max 300 · default: 120
Responses
200

The PDF as Markdown

methodstringrequired

text when the PDF's own text layer was read, ocr when pages were recognised.

Allowed:textocr
bytesintegerrequired
charactersintegerrequired
markdownstringrequired
400

Bad request

string
401

Missing or invalid bearer token

string
403

Billing or plan entitlement blocked the request

string
502

Upstream service (arXiv, YouTube, web page) failed

string
503

The backing service is not configured or is busy

string
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'https://api.webfold.ai/v1/ocr' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content_base64": "string",
  "languages": "eng+deu",
  "max_pages": 20,
  "timeout_secs": 120
}'
Response
{
  "method": "text",
  "bytes": 0,
  "characters": 0,
  "markdown": "string"
}