Prompt

How do I OCR scanned PDFs through an API?

Technology / Developer Tools1 observationLast seen Oct 12, 2026

Latest observation

Oct 12, 2026OpenAI APIWeb search: off

To OCR scanned PDFs through an API, you usually do this in one of two ways:

  1. Use a document OCR API directly
  2. Extract PDF pages as images, then send images to an OCR API

Typical flow

  1. Upload the scanned PDF to the OCR service
  2. Start an OCR job via API
  3. Poll for completion or receive a webhook callback
  4. Download results as text, JSON, searchable PDF, etc.

Common API options

Examples of services that support OCR for PDFs:

  • Google Cloud Document AI / Vision
  • AWS Textract
  • Azure AI Document Intelligence
  • OCR.Space
  • PDF.co
  • ABBYY Cloud OCR
  • Tesseract-based custom API if you host your own

Example: general REST workflow

1) Send the PDF

curl -X POST https://api.example.com/ocr \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@scanned.pdf"

2) Get a job ID

{
  "job_id": "abc123",
  "status": "processing"
}

3) Poll status

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.example.com/ocr/abc123

4) Retrieve result

{
  "status": "completed",
  "text": "Hello world...",
  "pages": [...]
}

If the API only accepts images

If the OCR API doesn’t accept PDFs, convert each page to an image first:

  • Use pdftoppm, imagemagick, poppler, or pdf2image
  • Send each page image to the OCR endpoint
  • Merge results in order

Important considerations

  • Scanned PDFs may need preprocessing: deskew, denoise, rotate, increase contrast
  • Multi-page PDFs: check file size/page limits
  • Output format: plain text vs structured JSON vs searchable PDF
  • Async handling: large PDFs often need job-based APIs
  • Security: encrypted PDFs may need unlocking first

Quick recommendation

If you want the simplest path:

  • Use Azure Document Intelligence or AWS Textract for production OCR
  • Use OCR.Space for lighter/simple integrations
  • Use Tesseract if you want to self-host and avoid per-page API costs

If you want, I can show you:

  • a Python example
  • a Node.js example
  • or a specific provider setup like AWS, Google, or Azure

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.