ForHosting KIT · OCR & Data Extraction

Is this PDF scanned?

Before you run a document through an OCR pipeline, you need one honest fact: does it already contain a text layer, or is it just a picture of a page? This endpoint answers that in a single call, so you stop wasting OCR cycles on files that never needed them.

● StablePer request + per document$0.002
Use it from WebAPIEmailApp soonTelegram soon

Run this on our servers with your account. Free tools run in your browser; this one bills your KIT balance per the price above.

Why this question matters more than it looks

Most document pipelines assume every incoming PDF is the same, but in practice a folder of 'contracts' or 'invoices' is a mix: some were exported straight from Word or an accounting system with a full text layer, others are flatbed scans, faxes, or photos of paper stapled into a PDF wrapper. Running OCR on the first group is pure waste — you pay for recognition work on text that was already machine-readable. Skipping OCR on the second group means silent failures downstream, where search, indexing or data extraction quietly return nothing because there was never any text to find.

What the endpoint actually checks

The task opens the PDF and inspects its internal structure page by page: it looks for an extractable text layer, measures how much of each page is covered by embedded fonts versus raster images, and flags pages that are effectively photographs with no underlying text. The result comes back as a clear verdict per document — native, scanned, or mixed for files where some pages have text and others do not — along with a simple page-level breakdown so you can route each page correctly instead of treating the whole file as one unit.

A short note on why this problem exists at all

PDF was designed in the early 1990s as a page-description format, not a text format, so it has always been possible to build a perfectly valid PDF that is nothing but an image, with no notion of characters, words, or reading order. Decades later this quirk still trips up pipelines: a scanner, a fax-to-PDF gateway, or an old archival system can all produce files that look identical to a human eye but are structurally opposite from what an automated system expects.

How it fits into a larger workflow

Call this endpoint as the first gate in any document pipeline, right after upload and before extraction, classification or search indexing. Route native results straight to text extraction, send scanned results to your OCR step, and split mixed results page by page so neither path does unnecessary work. Because the task is asynchronous, you can fan it out across an entire intake queue and let the webhook tell each downstream worker what to do next, without a human ever opening a file to check.

Pre-filtering an OCR queue

A document intake system checks every incoming PDF first and only forwards the scanned ones to OCR, cutting OCR spend on files that were already digitally native.

Auditing a legacy archive

A legal or accounting team migrating a ten-year-old file share runs this check across the whole archive to know, before any project plan is written, how many files actually need OCR.

Smart routing in a SaaS upload flow

A document-management product uses the verdict to decide in real time whether to show a 'text extracted' preview instantly or queue the file for OCR processing.

Quality control on scanning vendors

An operations team spot-checks batches delivered by a third-party scanning vendor to confirm the PDFs actually carry a text layer as contracted, not just images.

What exactly does the scanned-or-native check return?

A verdict of native, scanned, or mixed for the document, plus a per-page breakdown so you know which pages carry a real text layer and which don't.

Is this the same as running OCR?

No, it never performs text recognition. It only inspects the PDF's internal structure to tell you whether OCR is needed at all.

Is there a free tier for this API?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

How much does a scanned-vs-native check cost?

$0.002 per request, a small enough cost to run on every document before deciding whether OCR is worth paying for.

How do I get the result back?

The task runs asynchronously and returns a task_id immediately; the verdict is delivered via a signed webhook, which we recommend, or through a signed link valid for 24 hours.

What happens with password-protected or corrupted PDFs?

The task attempts the check up to three times automatically; if it still can't be completed, you get a clear error and, since it never charged you for a failed attempt, no cost either.

Can it handle mixed-content PDFs where only some pages are scanned?

Yes, that's exactly what the mixed verdict is for, and the page-level breakdown tells you precisely which pages need OCR and which don't.

Is my document data stored after the check?

Results and source files are deleted after the retention window and are never used for training, so you can run this on sensitive documents without a data-retention concern.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/ocr/scanned-or-native

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/ocr/scanned-or-native \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ocr.scanned_or_native",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
max_pages10
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
413input_too_largeThe file exceeds the size limit.

Read the full KIT documentation →