Introduction

The vOCR is a robust Object Character Recognition (OCR) API, enhanced with fine-tuned vLLMs, designed to efficiently extract data from various document types in a consistent structure.

vOCR shines at the following:

  • KYC Automation: Streamlines the verification process by extracting Personally Identifiable Information (PII) from documents to verify customer identity.
  • Financial Data Extraction: Automates the extraction of financial data from statements, reports, and other financial documents for analysis and reporting.
  • Healthcare Records Management: Extracts patient information, medical history, and treatment details from healthcare records for efficient data management and analysis.
  • Classification Engines: Facilitates accurate categorization and organization of extracted data.

Let’s see the vOCR in action by building a simple ID data extractor.

Initial requirements

  • Setup a JigsawStack account (if you don’t have an account already)
  • Get your JigsawStack API key from here.

Example


Request payload

const params: BodyParams = await request.json();

// payload
const payload: OCRParams = {
  url: params.imageUrl,
  prompt: ["First name", "last name", "dob", "id"], // streamline to the data you need.
};

Make request

const data = await jigsawstack.vision.vocr(payload);

Here is the complete code

api/id-extractor.ts
export const POST = async (request: Request) => {
  try {
    const params: BodyParams = await request.json();
    const payload: OCRParams = {
      url: params.imageUrl,
      prompt: ["First name", "last name", "dob", "id"], // streamline to the data you need.
    };

    const data = await jigsawstack.vision.vocr(payload);

    // Process and store data however you want to.
    console.log(data);

    return Response.json(
      {
        message: "ID verification successful",
      },
      {
        status: 200,
      }
    );
  } catch (error) {
    handleError(error);
  }
};

Curl request

curl -X POST http://localhost:3000/api/id-extractor
   -H 'Content-Type: application/json'
   -d '{"imageUrl":"<your-image-url>"}'

Find more information on vOCR API here