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/ocrAuthorization
AuthorizationBearer token (JWT) · headerrequiredBearer API key issued for your account. Send Authorization: Bearer <key>.
Request body
requiredapplication/jsoncontent_base64stringrequiredThe PDF, base64. Up to 25 MiB decoded.
languagesstringTesseract language codes.
default: "eng"
max_pagesintegermin 1 · max 200 · default: 20
timeout_secsintegermin 1 · max 300 · default: 120
Responses
200
The PDF as Markdown
methodstringrequiredtext when the PDF's own text layer was read, ocr when pages were recognised.
Allowed:
textocrbytesintegerrequiredcharactersintegerrequiredmarkdownstringrequired400
Bad request
string401
Missing or invalid bearer token
string403
Billing or plan entitlement blocked the request
string502
Upstream service (arXiv, YouTube, web page) failed
string503
The backing service is not configured or is busy
string