# Document extraction: OCR with AI: extract data from documents, PDFs and images as JSON.

> Send the address of a PDF, an image or a scanned document, say what you want to read and get back a JSON with the fields in the format your system uses.

- **HTML version:** https://dev.tolky.to/en/solutions/document-extraction
- **Language:** en

## Summary

OCR by API: PDFs, images and scanned documents become JSON in your system's format.

Data trapped in PDFs and photos, typed in by hand.
The same file, read and delivered in your system's format.

## One address. Four steps.

1. **Point to the file.** Send the public address of the PDF, image or document.
2. **Describe what you want.** Build a schema with the fields, or just ask for a description of the content.
3. **Tolky reads it.** It uses the PDF's text when there is one and reads the pages as images when the document is scanned.
4. **Get the JSON.** The fields you asked for, ready for your system to store.

## What the reading delivers

- **Scanned PDF.** A document with no text layer is read page by page, as an image.
- **PDF with text.** When the PDF already has text, the reading uses that layer and answers faster.
- **Image, DOCX and text.** Photos, images, Word documents and text files go in through the same API call.
- **Your schema.** You define name, description, properties and required fields, and the JSON comes back in that format.
- **General instructions.** Give the reading some context, such as "values are in US dollars", so the AI interprets it the right way.
- **Description without a schema.** Without a schema, the response brings a detailed description of the file's content.

## For teams that read documents every day

### Finance and accounts payable

Invoices and receipts become data with no typing.

- Invoice with number, date and amount in separate fields
- Receipt read and sent to your finance system
- A general instruction so amounts come back in the right currency

### Sign-up and onboarding

The ID document a customer sends fills in the form.

- Number, date and other document fields in your schema
- Fields ready for the sign-up form
- To verify the document and the person, Liveness Detection joins the flow

### Operations and back office

Contracts, statements and PDF forms that someone reads and types in today.

- PDF contract with the fields the operation needs
- Scanned statement or form, read page by page
- A product photo sent by a customer, described in text

## From file to data, in three parts

### PDF with text, scanned PDF, image and DOCX

The reading follows the file type: it uses the PDF's text when there is one and reads the pages as images when the document is scanned.

- PDF with text: direct reading of the text layer
- Scanned PDF: each page read as an image
- Image, DOCX and text through the same API call

### The fields in your system's format

You describe the schema with name, description, properties and required fields, and the JSON comes back in that shape. Without a schema, the response brings a detailed description of the file.

- Schema with properties and required fields
- General instructions to add context, such as "values are in US dollars"
- Response with a code, a message and the data

### Integration by API

The call carries the file's public address and the access token, and the response brings the data in the schema you asked for. The API documentation shows the complete request, end to end.

- Input through the file's public address
- Token authentication
- cURL example and response format in the documentation

## Frequently asked questions

### What is OCR and what does Tolky read?

OCR is the automatic reading of the text that sits in a file. Tolky reads images, PDFs with text, scanned PDFs, DOCX documents and text files, and returns the data as JSON.

### Does Tolky read scanned PDFs?

Yes. When the PDF has no text layer, each page is read as an image. When it has one, the reading uses the PDF's own text.

### Which file formats can I send?

Images, PDFs (with text or scanned), DOCX documents and text files.

### How do I get the data? Do I need to define a schema?

It is your choice. With a schema (name, description, properties and required fields), the JSON comes back in the fields you asked for. Without one, the response brings a detailed description of the content. General instructions, such as "values are in US dollars", help the AI interpret the document.

### Can I send several files in the same call?

Yes. Several files in the same call produce a single response, with the data gathered together. To get one result per document, send one call per document.

### How does the file need to be available?

The input is the file's public address. A link that expires or requires a login cannot be read, so use an open address while the reading runs.

### What is the difference between reading a document and verifying an identity?

Extraction reads what is written on the document. Verifying identity, with document, selfie and liveness check, is the job of Liveness Detection, and looking for signs of fraud in case files is the job of Contraprova (Anti-fraud). Both work together with extraction.

### How does authentication work and what does the response look like?

The call carries an access token in the Authorization header. The response brings a code, a message and the data in the schema you asked for. The API documentation shows the complete request.

### How do I get started?

Talk to our consultants to see extraction running on your documents and to arrange API access. The documentation has the technical step by step.

## Read the API documentation

- Read the API documentation: https://development.tolky.to/en/api/media-extraction

## Related solutions

- [Anti-fraud](https://dev.tolky.to/en/solutions/anti-fraud): Signs of document fraud and abusive litigation in case files, with the evidence behind every finding.
- [Liveness Check](https://dev.tolky.to/en/solutions/liveness-detection): Document, selfie and liveness check in one link, with the reason behind every approval.
- [CRM](https://dev.tolky.to/en/solutions/crm): Pipeline, opportunities and activities that the AI fills in from conversations.

## Next step

Stop typing what the document already says. Tell us which documents reach your operation and let's talk about how to read them and deliver the data in your system's format.

- Let's talk?: https://dev.tolky.to/en/contact
- Pricing and plans: https://dev.tolky.to/en/pricing

---

This is the Markdown version of the page. The full version, with images and navigation, is at https://dev.tolky.to/en/solutions/document-extraction

Tolky: https://dev.tolky.to
