Prompt
How do I use an OCR API for multi-page PDFs and TIFFs?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
To use an OCR API for multi-page PDFs and TIFFs, the basic flow is usually:
- Upload the file to the OCR service
- Tell the API to process every page
- Poll or wait for completion if it’s asynchronous
- Fetch the extracted text and/or structured results
Typical API workflow
1) Send the document
Most OCR APIs accept:
application/pdfimage/tiff- sometimes ZIPs or image arrays
For multi-page documents, the API should treat each page as a separate image internally.
2) Specify page handling
Look for parameters like:
pages=allpage_range=1-10async=truemulti_page=true
If you don’t specify anything, many APIs default to all pages.
3) Choose output format
Common OCR outputs:
- plain text
- JSON with page-by-page text
- hOCR / ALTO XML
- searchable PDF
- bounding boxes / coordinates
For multi-page documents, JSON is often easiest because it includes page numbers and per-page confidence.
4) Handle async processing
Large PDFs/TIFFs are often processed asynchronously:
POST /ocrreturns a job IDGET /ocr/{job_id}returns status- when done, download results
5) Parse page results
Expect structure like:
{
"pages": [
{ "page": 1, "text": "..." },
{ "page": 2, "text": "..." }
]
}
Example cURL request
curl -X POST "https://api.example.com/ocr" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
-F "language=eng" \
-F "pages=all" \
-F "output=json"
Example async flow
Submit job
curl -X POST "https://api.example.com/ocr/jobs" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@scan.tiff" \
-F "output=json"
Response:
{ "job_id": "abc123", "status": "queued" }
Poll status
curl -X GET "https://api.example.com/ocr/jobs/abc123" \
-H "Authorization: Bearer YOUR_API_KEY"
When complete:
{
"status": "completed",
"result_url": "https://api.example.com/results/abc123.json"
}
Important tips for PDFs/TIFFs
- Check page limits: some APIs cap pages or file size
- Prefer TIFF for scans if you need high-quality page images
- Use searchable PDF output if you want text embedded in the document
- Split very large files if the API has timeouts
- Preserve page order in your application
- Convert rotated pages if OCR accuracy is poor
If you’re building against a specific OCR API
I can give you:
- a Python example
- a JavaScript example
- a cURL example
- or the exact steps for a specific service like Google Vision, AWS Textract, Azure Document Intelligence, or Tesseract-based APIs
If you want, tell me which OCR API you’re using and I’ll tailor the request format.