Simplify KYC with PAN and Aadhaar Card OCR
Tags: ocr, opensource, javascript, aadhaar
Published: 2023-09-11 09:45:48

In the digital age, identity verification is a crucial aspect of various financial and government processes. In India, two primary documents serve as the foundation for such verification - the [Permanent Account Number](https://en.wikipedia.org/wiki/Permanent_account_number) (PAN) card and the [Aadhaar](https://en.wikipedia.org/wiki/Permanent_account_number) card. These documents contain essential information for KYC, but manually extracting data from them can be time-consuming and error-prone.

To address this challenge, I built the [PAN and Aadhaar OCR Extractor](https://www.npmjs.com/package/pan-aadhaar-ocr), a Node.js package that simplifies the extraction of PAN and Aadhaar card numbers from scanned images using Optical Character Recognition (OCR) technology. It is designed to be lightweight and performant, making it suitable for a wide range of KYC applications.

**Getting Started with Installation**

The installation process is straightforward, and you can choose your preferred package manager:

Using npm:

```bash
npm install pan-aadhaar-ocr
```

Using yarn:

```bash
yarn add pan-aadhaar-ocr
```

**Using the PAN and Aadhaar OCR Extractor**

Once installed, you can start using the package right away. Here's a simple example of how to extract a PAN number from a scanned image:

```javascript
const { extractCardDetails } = require('pan-aadhaar-ocr');

const imagePath = 'path/to/your/image.jpg'; // Provide the path to your PAN or Aadhaar card image
const cardType = 'PAN'; // Specify the card type as 'PAN' or 'AADHAAR'

extractCardDetails(imagePath, cardType)
    .then((extractedDetails) => {
        console.log(`PAN Number: ${extractedDetails.Number}`);
    })
    .catch((err) => {
        console.error(err);
    });
```

You can also use async-await for a more streamlined experience:

```javascript
try {
    const extractedDetails = await extractCardDetails(imagePath, cardType);
    console.log(extractedDetails);
} catch (err) {
    console.error('Something went wrong while extracting card details');
}
```

**Supported Card Types**

The [PAN and Aadhaar OCR Extractor](https://www.npmjs.com/package/pan-aadhaar-ocr) supports two essential card types:

1. **PAN**: The [Permanent Account Number](https://en.wikipedia.org/wiki/Permanent_account_number) (PAN) is a unique alphanumeric identifier issued by the [Income Tax Department of India](https://incometaxindia.gov.in/). It plays a significant role in financial and tax-related processes. 

2. **AADHAAR**: [Aadhaar](https://en.wikipedia.org/wiki/Permanent_account_number) is a 12-digit unique identity number issued by the Unique Identification Authority of India ([UIDAI](https://uidai.gov.in/)). It is a vital identification document used for various government and private sector services.

**PAN & Aadhaar Validation**

For comprehensive KYC processes, you can use additional APIs for PAN and Aadhaar validation:

- [PAN Verification](https://developer.sandbox.co.in/reference/pan-verification-basic-api)
- [Aadhaar Verification](https://developer.sandbox.co.in/reference/aadhaar-okyc-generate-otp-api)

## Extract PAN/Aadhaar number using OCR 

The [PAN and Aadhaar OCR Extractor](https://www.npmjs.com/package/pan-aadhaar-ocr) is a solution that simplifies data extraction from PAN and Aadhaar card for the KYC processes. With automation at its core, it eliminates errors, saves time, and enhances efficiency. Embrace this tool to streamline your data extraction process and stay ahead in the digital era. Contributions are welcome! Feel free to open issues or submit pull requests via the [GitHub repository](https://github.com/vinitshahdeo/pan-aadhaar-ocr).

---

**Made with ❤️ by [Vinit Shahdeo](https://twitter.com/Vinit_Shahdeo) for India 🇮🇳**