Document OCR | PDF to Markdown | Invoice, Table & Image to Text avatar

Document OCR | PDF to Markdown | Invoice, Table & Image to Text

Pricing

from $4.00 / 1,000 page ocr'ds

Go to Apify Store
Document OCR | PDF to Markdown | Invoice, Table & Image to Text

Document OCR | PDF to Markdown | Invoice, Table & Image to Text

Read PDF files and images and get the text as Markdown. Tables, headings, and reading order stay correct. 96.7% text accuracy on a 39-document test of receipts, forms, and reports. More than 100 languages. Pay per page.

Pricing

from $4.00 / 1,000 page ocr'ds

Rating

0.0

(0)

Developer

Scott Shinn

Scott Shinn

Maintained by Community

Actor stats

0

Bookmarked

18

Total users

11

Monthly active users

12 days ago

Last modified

Share

Document OCR API: PDF and Image to Markdown

This Actor reads PDF files and images. It gives you the text as Markdown. Tables stay as tables. Headings stay as headings. The text stays in the correct reading order.

You can use the output for search indexes, RAG pipelines, and data extraction.

Accuracy

We use a vision-language OCR model that runs on our own GPU servers.

We tested the model on 39 real documents with known correct text:

Document typeDocumentsText accuracy
Receipts1297.5%
Forms1298.3%
Mixed documents (reports, letters, tables)1594.8%
All documents3996.7%

Text accuracy is the percentage of words in the correct text that the OCR output also contains.

On the public OmniDocBench document parsing benchmark, the model scores 96.3 out of 100.

The average time for one page is approximately 9 seconds.

How to use this Actor

  1. Put one or more URLs in the imageUrls field. Each URL must point to a PDF file or an image.
  2. If a PDF has many pages, set maxPages to limit the number of pages.
  3. Start the Actor.
  4. Get the results from the dataset.

Each URL must be public. The Actor cannot open files that need a login.

Example

Input:

{ "imageUrls": ["https://templates.invoicehome.com/invoice-template-us-neat-750px.png"] }

Output (part of one dataset item):

## INVOICE
East Repair Inc.
1912 Harvest Lane
New York, NY 12210
INVOICE # US-001
INVOICE DATE 11/02/2019
DUE DATE 26/02/2019

The Actor also returns the line items as a Markdown table:

QTYDESCRIPTIONUNIT PRICEAMOUNT
1Front and rear brake cables100.00100.00
2New set of pedal arms15.0030.00
3Labor 3hrs5.0015.00

Input

FieldTypeDescription
imageUrlsarray of stringsRequired. The URLs of the PDF files and images.
maxPagesintegerOptional. The maximum number of pages to read from each PDF. 0 means no limit.

Output

You get one dataset item for each URL:

{
"url": "...",
"ok": true,
"numPages": 1,
"markdown": "## INVOICE\n\nEast Repair Inc. ...",
"pages": [{ "markdown": "...", "blocks": [] }]
}
FieldDescription
urlThe input URL.
oktrue if the Actor read the document. false if it did not.
numPagesThe number of pages that the Actor read.
markdownThe text of all pages. A --- line separates the pages.
pagesOne object for each page. Each object has the Markdown of that page and its blocks.
blocksThe layout regions of the page. Each block has a type (for example, text, table, or title) and a bounding box.
errorThe cause of the failure. This field is only present when ok is false.

If one URL fails, the Actor writes an item with ok: false and continues with the next URL.

Supported documents

  • Invoices, receipts, and financial statements, with tables.
  • Forms.
  • Scanned pages and photos of documents.
  • Pages with more than one column.
  • Pages with mathematical formulas.
  • Text in more than 100 languages, for example English, Spanish, Arabic, Hindi, Chinese, Japanese, and Russian.

Printed text gives the best results. Handwriting and low-quality scans give lower accuracy.

Price

You pay for each page that the Actor reads:

  • One image is one page.
  • A PDF with 10 pages is 10 pages.

You do not pay for a URL that fails. There is no monthly fee.

Limits

  • The Actor reads one page at a time. A large batch takes more time, but the speed stays constant.
  • Each URL must be public.
  • A very large PDF can take a long time. Use maxPages to control the time and the cost.