Skip to main content

Scan Prompt

Endpoint​

https://api.verifik.co/v2/ocr/scan-prompt

Scan Prompt Document Scanning with AI Integration is a powerful tool designed to streamline the extraction of text from legal documents, supporting your Know Your Customer (KYC) process. This service harnesses advanced AI to automatically detect document types and utilizes proprietary technology for accurate data extraction.

Headers​

NameValue
Content-Typeapplication/json
AuthorizationBearer <token>

Parameters​

NameTypeRequiredDescription
imagestringYesImage in Base64 encoded format or a URL where the image is hosted.
cropFacebooleanNoIf you want to crop the face out of the document, pass this as true.
documentTypestringNoYou could specify the documentType so the AI doesn't have to guess what document type are we extracting.

Request​

import axios from "axios";

const { data } = await axios.post("https://api.verifik.co/v2/ocr/scan-prompt", {
image: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQ...",
cropFace: true,
documentType: "DNI"
}, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.VERIFIK_TOKEN}`
},
});
console.log(data);

Response​

{
"id": "xjicp",
"data": {
"__v": 0,
"_id": "64d3ed6aed1c7d7ea391e617",
"url": "https://cdn.verifik.co/ocr/64404b1f9856cc8cebd762e7/1691610471704-image.jpeg",
"type": "ocr",
"client": "64404b1f9856cc8cebd762e7",
"status": "ACTIVE_BUT_UNVERIFIED",
"deleted": false,
"createdAt": "2023-08-09T19:47:54.214Z",
"updatedAt": "2023-08-09T19:47:54.214Z",
"requires2FA": false,
"documentType": "CUSTOM",
"OCRExtraction": {
"fullName": "Juan Miguel Rodríguez López",
"lastName": "Rodríguez López",
"firstName": "Juan Miguel",
"documentNumber": "01101101 01100001"
},
"documentNumber": "01101101 01100001",
"imageValidated": false,
"validationMethod": "SCAN_GPT"
},
"signature": {
"message": "Certified by Verifik.co",
"dateTime": "August 9, 2023 7:47 PM"
}
}

Features​

  1. AI-Powered Document Type Extraction: Automatically identifies the type of legal document.
  2. Precise data extraction: Employs custom technology to extract relevant information with high accuracy.
  3. Flexible prompt templates: Uses pre-designed system prompts for efficient out-of-the-box extraction. Also allows users to create custom templates to refine logic, adjust extracted fields, or enhance the process by adding/removing data points.

Document match​

When documentType is CC (Colombian cédula) or DRCC (Colombian driver's license), OCRExtraction includes documentClassification:

"documentClassification": {
"requestedDocumentType": "CC",
"detectedDocumentType": "DRCC",
"detectedDocumentName": "Licencia de Conducción",
"isMatch": false,
"confidence": 1,
"reason": "El documento es una licencia de conducción del Ministerio de Transporte."
}
  • detectedDocumentType is CC, DRCC, or UNKNOWN.
  • isMatch is true only when the photo is the document you asked for.
  • A driver's license sent as CC still returns HTTP 200, and documentType stays CC. isMatch is false. Refuse that photo in your app.
  • A cédula sent as DRCC is the same in the other direction.
  • A passport, a vehicle card (TLCC), or a classification that could not run is UNKNOWN, with isMatch false.

The same scan can continue into a SmartCheck from Smart Agent. The photo is read, and a check configured on that document type, such as the Colombian cédula lookup, can run from the number OCR extracted.

Notes​

  • Use Base64 encoded images or direct URLs for the image parameter.
  • The cropFace parameter helps improve accuracy by focusing on document content.
  • Specify documentType when you know the document type for better results.