ForHosting KIT · OCR & Data Extraction

Find barcodes in a document

A scanned shipping label, purchase order or packing slip often carries two or three barcodes buried among the printed text, and a generic OCR pass reads the letters around them while missing the codes entirely. This endpoint scans the whole page specifically for barcodes and QR codes and returns each one's type, decoded value and position as JSON.

● StableFree · in your browser
Use it from WebAPIEmailApp soonTelegram soon

Runs in your browser. Free, unlimited — your data never leaves this page.

Why barcodes need a different kind of reading

Text OCR and barcode decoding are genuinely different problems: one recognizes letterforms, the other reads a pattern of bars, dots or modules encoding data that has nothing to do with the surrounding language. A scanned document that mixes both — a delivery note with a paragraph of instructions above a shipment barcode, an invoice with a QR code stamped in the corner for payment — needs both kinds of reading done at once, on the same page, without one interfering with the other.

Where documents carry barcodes that matter

Warehouses scanning inbound paperwork where the barcode on a packing slip needs to match the one on the physical package, logistics teams digitizing paper shipping labels that were never generated digitally in the first place, retailers processing supplier invoices that embed a QR code linking to payment or product detail, and archives digitizing old forms or tickets where a barcode was the only machine-readable field on an otherwise handwritten page.

What each detected code returns

Send the scanned page to POST /ocr/barcode-doc and get a task_id back immediately, since the job processes asynchronously. The result lists every barcode found on the page — its symbology (Code 128, EAN, QR, Data Matrix and the common others), the decoded value, and roughly where on the page it sits — delivered by signed webhook or a signed link valid for 24 hours.

From striped ink to a data layer on paper

The barcode itself is a mid-twentieth-century invention built to let a machine read a number faster than a person could type it, and decades later the same idea extended into two-dimensional codes that pack far more data into the same square inch. Documents still print these codes for the same reason they always did — a fast, unambiguous machine read — but a scanned copy of that paper strips away the physical scanner context, leaving just an image where the code has to be found and decoded again from scratch.

Slotting into a document intake pipeline

At $0.002 per request plus $0.005 per page, and billed only for pages that process successfully, this endpoint runs cheaply enough to sit in front of every scanned document a warehouse or back office receives, flagging which pages carry a barcode worth cross-referencing against an order or shipment record. A failed page retries automatically up to three times at no charge, and access requires prepaid balance — no free tier, which keeps throughput steady for high-volume scanning operations.

Warehouse packing slip verification

A warehouse scans an inbound packing slip and matches the extracted barcode value against the physical package's own barcode before accepting delivery.

Paper shipping label digitization

A logistics team converts a batch of scanned paper shipping labels into structured barcode data for a system that never had a digital source.

Supplier invoice QR code capture

A retailer pulls the payment or product QR code embedded in a scanned supplier invoice without a person hunting for it on the page.

Archival digitization of ticketed forms

An archive extracts the barcode from old tickets or forms as the one reliable machine-readable field on an otherwise handwritten record.

What does the Document Barcode Reader API return?

A JSON list of every barcode found on the page, including its symbology, decoded value and approximate position on the page.

How do I call the document barcode reader api?

Send the scanned page to POST /ocr/barcode-doc, get a task_id right away, and receive the decoded barcodes by webhook or a signed link once processing finishes.

Which barcode types can it read?

Common one-dimensional symbologies like Code 128 and EAN as well as two-dimensional formats like QR codes and Data Matrix, all detected on the same page.

Is there a free tier for reading barcodes in documents?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

How much does it cost per page?

$0.002 per request plus $0.005 per page, published pricing billed only when a page is processed successfully.

Can it find multiple barcodes on the same scanned page?

Yes, it detects and decodes every barcode present on the page, not just the first one it finds.

Does it work on a low-quality photo of a printed document?

Yes, though a clearer scan or photo with the barcode fully visible gives the most reliable decode.

Am I charged if a page fails to process?

No. A failed page retries automatically up to three times and is never billed; you get a clear error if it still can't be read.

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/barcode-doc

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/barcode-doc \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ocr.barcode_doc",
  "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
Per page$0.005

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 →