OCR extraction API
Extract text and data from ID documents using Optical Character Recognition (OCR). This API supports Australian Driver’s Licenses and Passports (any country).
Looking for a ready-made solution? Use OneSDK’s OCR module to capture document details without building your own UI.
Prerequisites
Before using the OCR API, ensure you have:
- Created an entity in Frankie via Create New Entity
- Obtained user consent (can be added during entity creation or via update)
- A base64 encoded image of the ID document (front or back)
For more information about consent requirements, see About consent.
How It Works
- Send a single ID document image to the API
- The service performs OCR and creates a document object
- The document object is attached to the entity
- The API returns the updated entity with OCR results
- Check the status in the response to determine if additional images are needed
Response Statuses
Document Validation Statuses
DOCUMENT_INVALID_INCORRECT_FILE_FORMAT
- Unsupported file formatDOCUMENT_INVALID_EXCEEDED_SIZE_LIMIT
- File size too largeAWAITING_DOCUMENT_UPLOAD_INVALID_TYPE
- Invalid document type
OCR Process Statuses
COMPLETE_OCR
- OCR completed successfullyAWAITING_OCR_RESULTS_PROVIDER_OFFLINE
- Provider service unavailableAWAITING_DOCUMENT_UPLOAD_FAILED_OCR
- Upload failed (possibly due to poor scan quality)
Document Side Statuses
AWAITING_DOCUMENT_UPLOAD_FRONT
- Front image requiredAWAITING_DOCUMENT_UPLOAD_BACK
- Back image required
OCR Data Comparison
The service automatically compares extracted OCR data with existing entity information. Any mismatches are reported in the ocr_scanned_mismatch
field.
Compared Fields
- First name
- Last name
- Date of birth
- ID document number
- State of ID document (configurable)
- ID card number (configurable)
API Usage Example
The response includes accuracy scores for each extracted field. Use these scores to determine the reliability of the OCR results.