Extract text from an image via OCR. $0.02 per request.
Send a photo, screenshot, or scanned document as an image. Get back the transcribed text, its detected language, and a word count. Handles handwriting-adjacent print, receipts, signs, and scanned pages.
| Method | POST |
|---|---|
| Path | /ocr |
| Content-Type | multipart/form-data |
| field | required | description |
|---|---|---|
file | yes | PNG, JPEG, WEBP, or GIF image, max 8MB |
curl -X POST https://ocr-api.pdfextractapi.workers.dev/ocr \
-F "file=@scan.png"
{
"text": "INVOICE #4471\nTotal Due: $128.50\nDue Date: 2026-09-15",
"language": "en",
"word_count": 7
}
Errors return a non-200 status with { "error": { "code": "...", "message": "..." } }. Common codes: missing_input, file_too_large, unsupported_media_type.
This endpoint is paid per-request via the x402 protocol (HTTP 402 + USDC). Unpaid requests receive a 402 response with payment instructions.