Overview
Optical Character Recognition (OCR) provides a flexible, standalone endpoint for extracting text data from documents across multiple formats, including PDF, JPG, and PNG. The Tesouro OCR returns a structured JSON response with all detected text data for contextual analysis, enabling use cases such as receipt parsing, contract analysis, or custom form data extraction. The response retains the extracted content without post-processing, allowing you to integrate and manipulate the data according to your specific requirements.This OCR endpoint is a generic one and is not meant to replace the existing OCR for Accounts
Payable (AP).
Considerations and limitations
- The OCR process is asynchronous and the processing time may vary according to the document size.
- The minimum image file size is 100 KB.
- The maximum image file size is 20 MB.
- Multipage PDF files can have up to 100 pages.
Covered languages
While this is not an exhaustive list, Tesouro OCR guarantees tested coverage for the following languages:- Arabic
- Bulgarian
- Catalan
- Chinese
- Czech
- Danish
- Dutch
- English
- Estonian
- Finnish
- French
- Georgian
- German
- Greek
- Hebrew
- Hungarian
- Italian
- Japanese
- Latvian
- Lithuanian
- Norwegian
- Polish
- Portuguese
- Romanian
- Russian
- Serbian
- Slovak
- Slovenian
- Spanish
- Swedish
- Thai
- Turkish
- Ukrainian
Create an OCR task
There are two ways you can send a document for OCR recognition: The OCR scanning might take up to 10-15 seconds, so it is recommended to poll the document every 5 seconds. In the meantime, the document’sstatus field is set as processing and the recognized_data field is not populated yet.
The webhook ocr_task.finished is triggered once the OCR has finished processing the file and storing the extracted data. The webhook will be triggered only if the x-organization-id header parameter is provided.
Process file via URL
To process a file, thus creating an OCR task, callPOST /ocr-tasks. The query parameter document_type is optional and its possible values are invoice, credit_note, and receipt. If document_type is not specified, the system will attempt to determine it automatically:
202 Accepted response contains the information found in the file:
Upload from file
You can upload files in the PDF, PNG, or JPG format by callingPOST /ocr-tasks/upload-from-file. The query parameter document_type is optional and its possible values are invoice, credit_note, and receipt. If document_type is not specified, the system will attempt to determine it automatically:
202 Accepted response contains the id and other parameters of the file:
List all OCR tasks
To obtain a list of all OCR tasks, callGET /ocr-tasks.
Retrieve a specific OCR task
To obtain information about a specific OCR task, callGET /ocr-tasks/{task_id}.