Introducing DOCSCAN: The Ultimate Global ID Document Scanning API

Introducing DOCSCAN: The Ultimate Global ID Document Scanning API

In today's fast-paced digital landscape, ensuring the authenticity of user identities is crucial for businesses. Enter PixLab's cutting-edge DOCSCAN API, a powerful tool designed to streamline the eKYC (electronic Know Your Customer) process. This AI-powered platform offers robust ID document scanning and data extraction capabilities, making it a game-changer for developers and businesses alike.

Key Features of DOCSCAN API

  1. Comprehensive Document Support

    • The DOCSCAN API supports over 11,000 types of ID documents from 197+ countries, including passports, ID cards, driving licenses, visas, birth certificates, and death certificates. No other KYC platform offers such extensive coverage, making DOCSCAN an industry leader.
  2. Advanced Features

    • The API includes highly accurate text scanning and automatic face detection and cropping. This ensures precise extraction of essential details from documents, such as full name, issuing country, document number, address, and expiry date.
  3. Developer-Friendly Integration

    • DOCSCAN is designed with developers in mind. The single REST API endpoint simplifies the integration process, allowing for quick and easy implementation into any application.

Let's dive into how you can integrate this powerful tool into your application.

Versatile Use Cases

DOCSCAN is ideal for various industries and applications, including:

  • KYC (Know Your Customer): Enhance security across digital platforms.

  • User Verification: Ensure authenticity in user profiles.

  • Financial Services: Facilitate international market expansion.

  • Fraud Detection: Combat identity theft and fraudulent activities.

  • E-commerce: Prevent chargebacks and combat credit card fraud.

  • Healthcare: Enhance patient care with secure identity verification.

  • Travel & Hospitality: Ensure secure, seamless check-in processes for travelers.

Easy Integration with DOCSCAN API

Integrating the DOCSCAN API into your application is straightforward. Here’s a step-by-step guide to get you started:

  1. Get Your API Key

    • First, you need to sign up at PixLab and generate your API key. This key is essential for authenticating your requests to the DOCSCAN API.
  2. Endpoint and Parameters

    • The primary endpoint for DOCSCAN is https://api.pixlab.io/docscan. You can make GET or POST requests to this endpoint, depending on your preference for uploading the document image.
  3. Making a Request

    • Here’s a simple example using JavaScript to scan a passport image:
const apiKey = 'YOUR_PIXLAB_API_KEY'; // Replace with your PixLab API Key
const imageUrl = 'http://example.com/passport.png'; // URL of the passport image

const url = `https://api.pixlab.io/docscan?img=${encodeURIComponent(imageUrl)}&type=passport&key=${apiKey}`;

fetch(url)
    .then(response => response.json())
    .then(data => {
        if (data.status !== 200) {
            console.error(data.error);
        } else {
            console.log("Cropped Face URL: " + data.face_url);
            console.log("Extracted Fields: ", data.fields);
        }
    })
    .catch(error => console.error('Error:', error));
  1. Handling the Response

    • The API responds with a JSON object containing the scanned information. This includes URLs to the cropped face image and detailed extracted fields like full name, issuing country, document number, and more.

Additional Code Samples

Python

Python code snippet for making a GET request to the PixLab DocScan API. The code imports the 'requests' library, sets the API key and image URL, assembles the parameters including the image URL, type, and API key, and checks the response status. If successful, it prints the cropped face URL and extracted fields; otherwise, it prints an error message.

PHP

A PHP code snippet designed to use the PixLab API. The script assigns the API key and an image URL of a passport, constructs the request URL, fetches the response, decodes the JSON data, and checks the status. If the status is not 200, it prints an error message; otherwise, it displays the cropped face URL and extracted fields.

Ruby

A Ruby code snippet displayed on a terminal with a purple gradient background. The code uses the , , and  libraries and demonstrates how to make a GET request to the PixLab API to scan a passport image. It includes placeholders for the API key and the image URL and handles the response to display either an error message or extracted data.

Java

A Java program displayed on a purple background is shown, demonstrating how to use the PixLab API for scanning documents. The code includes importing libraries, setting up an API key and image URL, making an HTTP GET request, reading the response, and handling JSON data for extracted fields and the cropped face URL. Error handling and connection management are also included.

Comprehensive HTTP Response

The DOCSCAN API endpoint always returns a JSON object. Below are the fields typically included in the response:

  • status: HTTP status code (200 indicates success).

  • type: Type of the scanned document.

  • face_url: URL to the cropped image of the face from the document.

  • mrz_raw_text: Extracted raw MRZ text (for Passports and Visas only).

  • fields: A JSON object containing extracted data such as fullName, issuingCountry, documentNumber, address, dateOfBirth, dateOfExpiry, sex, nationality, issuingDate, checkDigit, personalNumber, finalCheckDigit, issuingState, issuingStateCode, religion.

How Does the PixLab DocScan Work?

Do you want to know, what happens when you scan a driving license using the Docscan API? Let’s understand the process step by step. I am summarizing the point here, but you can read more about it in their official documentation.

1. At first the user’s face is detected using the face detectAPI.

2. After getting the face coordinate, you can crop and extract the image using image processing API from Pixlab.

3. Then using Docscan API, Pixlab extracts the information about the user.

4. After the processing is done, the image is deleted from the server. Pixlab doesn’t store any of the images for future reference. This is a very good move for privacy.

5. Underthe hood, Pixlab uses PP-OCR which is a practical ultra-lightweight OCR system that is mainly composed of three parts: Text Detection, Bounding Box Isolation, & Text Recognition. Thus Pixlab can generate accurate results by scanning a driver’s license.

Real-World Example

Let's consider a practical example. Suppose you want to verify a user's passport. By using the DOCSCAN API, you can extract all relevant details and store them in your database for future reference. The API also crops the user's face from the passport image, which can be used for profile verification.

Screenshot of a JavaScript (JSX) code snippet from a file named . The code imports  and a CSS file, defines and exports a function , which returns a  with  containing the . The screenshot has a black background with syntax highlighting.

Screenshot of a JavaScript file named "DocScanComponent.jsx". It imports React and Axios libraries, defines a component that scans a document using the Pixlab API, and handles different states such as image URL, scan results, loading, and error. The component includes an API key, input field for an image URL, and a button to initiate the scan. The result is displayed below the button if available.

This is a demo passport image. The extracted data using Pixlab Docscan API is listed below.

A passport from Utopia for Anna Maria Eriksson. The passport type is P and the number is L898902C3. Nationality is Utopian, date of birth is 12 August 1974, place of birth is Zenith, and sex is female. The passport was issued on 16 April 2007 and expires on 15 April 2012. The holder's signature is Anna Maria Eriksson. A photo of Anna Maria Eriksson is on the left side of the passport.

Example Output for a Passport Scan

Key Takeaways:

  • DOCSCAN API supports 11,000+ document types from 197+ countries

  • Easy integration with a single REST API endpoint

  • Advanced AI for accurate text scanning and face detection

  • Streamlines KYC, user onboarding, and fraud prevention processes

  • Compatible with multiple programming languages

Conclusion

PixLab's DOCSCAN API offers a comprehensive and efficient solution for eKYC processes. With support for a vast array of documents, advanced scanning features, and a developer-friendly interface, integrating this API into your application can significantly enhance your identity verification processes.

To learn more, explore the DOCSCAN API documentation and get started today. Revolutionize your eKYC process with PixLab!


For additional resources, code samples, and community-contributed articles, visit the PixLab GitHub Repository and join the conversation with fellow developers.