Malaysian Lesen Memandu (Driving License) OCR API

Automate eKYC and driver onboarding in Malaysia. Instantly extract the IC Number, license validity, and vehicle classes from a Jabatan Pengangkutan Jalan (JPJ) driving license. Upload a sample image below to test the extraction accuracy for free.

Diagram showing the OCR API scanning a Malaysian Lesen Memandu, accurately extracting the IC number and classifying the vehicle category as Class D.

The Complexity of Extracting Data from a Lesen Memandu

The Malaysian driving license (Lesen Memandu), issued by the JPJ, is a critical document for identity verification and fleet onboarding. However, standard text-recognition tools struggle with its specific layout. The most vital piece of information—the 12-digit NRIC (National Registration Identity Card) number—is often printed without a clear prefix, and vehicle classes (such as D for cars or B2 for motorcycles) are clustered tightly with issue dates. Generic models frequently misalign these fields or fail to accurately parse the dual-language (Malay/English) headers. To see how our layout-aware identity models overcome these regional data extraction challenges, explore our core driver license OCR capabilities.

Edge-Routed Speed & Zero-SDK Architecture

For the Southeast Asian market, performance and app size are critical. We deliver our Lesen Memandu OCR engine as a pure REST API, eliminating the need to force bloated SDKs onto your users' devices. StructOCR is natively deployed on Cloudflare's global edge network, meaning API requests originating from Kuala Lumpur or Penang are processed at the nearest local node for lightning-fast TTFB (Time to First Byte). Whether you send a direct file upload or a Base64-encoded string, our engine returns structured JSON instantly.

Live Demo: Driver License OCR Scanner

No registration required. Upload a file to test the extraction.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected

Ready to use this in production? Get 20 free API calls — no credit card needed.

Get 20 Free API Calls →

High-Growth Use Cases in Malaysia

Fintech & Digital Wallet eKYC

Accelerate user onboarding for e-wallets and crypto exchanges. Instantly extract the 12-digit IC number from the driving license to cross-reference with national identity databases. To remove cross-border payment friction, you can manage your API subscription natively using USDT/USDC. Explore our flexible pricing plans.

Ride-Hailing & Delivery Onboarding

Automate gig-economy fleet registration. Instantly verify if a new driver holds the correct Class B2 (motorcycle) or Class D (car) license, and check the expiration date before authorizing them to take orders. Read more about our mobility driver verification solutions.

Vehicle Rental & Tourism

Streamline car rentals across Malaysia. Capture the driver's details and license validity accurately using just a smartphone photo, removing manual data entry bottlenecks at the rental counter.

Technical Specs

  • Edge Processing Architecture: Deployed entirely on Cloudflare Workers, ensuring that API requests from Southeast Asia are handled by regional edge nodes for near-zero routing latency.
  • Input Versatility: Fully supports multipart file uploads and raw Base64 strings, eliminating the need to compile and maintain heavy native Android/iOS SDKs.
  • Base64 Auto-Cleansing: Our API intelligently sanitizes malformed Base64 payloads (e.g., stripping carriage returns and spaces) prior to processing.
  • Cryptocurrency Payments: Designed for global SaaS compliance and convenience, developers can fund API usage seamlessly via traditional credit cards or Web3-native USDT/USDC.

Key Features

  • Precise IC Extraction: Contextually isolates the 12-digit Malaysian IC number (NRIC) and maps it reliably to the `personal_number` field.
  • Categorical Accuracy: Extracts specific Malaysian vehicle class codes (e.g., B2, D, E) and maps them to `vehicle_class` for immediate fleet authorization.
  • Date Standardization: Natively converts the local date formats printed on the license into strict, database-ready `YYYY-MM-DD` ISO strings.

Integration & AI Prompts

Integrating our API into your backend takes minutes. We natively process direct file uploads, public URLs, and Base64-encoded strings—automatically stripping out illegal whitespaces or newlines to ensure your requests never fail. For comprehensive endpoint parameters, consult our developer documentation.

import requests
import base64

# 1. Prepare Base64 Image of the Malaysian Lesen Memandu
with open("malaysian_license_sample.jpg", "rb") as image_file:
    base64_image = base64.b64encode(image_file.read()).decode('utf-8')

url = "https://api.structocr.com/v1/driver-license"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}

# Pass the pure Base64 string directly
payload = {
    "img": base64_image 
}

response = requests.post(url, headers=headers, json=payload)
result = response.json()

if result.get('success'):
    data = result['data']
    print(f"✅ Extracted IC (NRIC): {data['personal_number']}")
    print(f"✅ Name: {data['surname']} {data['given_names']}")
    print(f"✅ Vehicle Category: {data['vehicle_class']}")

Standardized JSON Output

Observe how the unique data points of a Malaysian driving license are mapped into a standardized schema. The IC number is securely placed in `personal_number`, while the vehicle category is cleanly extracted to `vehicle_class`.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "MYS",
    "region": "SELANGOR",
    "document_number": "12345678",
    "personal_number": "900515-14-5566",
    "surname": "BIN ABDULLAH",
    "given_names": "AHMAD",
    "sex": "M",
    "date_of_birth": "1990-05-15",
    "place_of_birth": "KUALA LUMPUR",
    "date_of_issue": "2022-06-10",
    "date_of_expiry": "2027-05-15",
    "date_of_first_issue": null,
    "issuing_authority": "JPJ MALAYSIA",
    "address": "NO 12 JALAN MAJU, TAMAN SENTOSA, 40000 SHAH ALAM, SELANGOR",
    "vehicle_class": "D, B2",
    "extra_details": {}
  }
}

Frequently Asked Questions

Can I test the Malaysian Lesen Memandu OCR before purchasing?

Yes! You can use the free image upload testing widget at the top of this page. Upload a sample photo of a driving license to evaluate the extraction speed and accuracy instantly.

Do I need to install a heavy SDK in my mobile app?

No, StructOCR operates as a pure REST API. You can simply capture the document image using the user's native camera, convert it to a Base64 string, and POST it to our endpoint. This approach drastically reduces your app's bundle size.

Does the API extract the 12-digit IC number?

Yes. The API is specifically trained on Malaysian formats and reliably extracts the IC number (NRIC), placing it inside the structured `personal_number` field within the JSON response.

Explore More Drivers-license Solutions

Precise Data Extraction and Seamless Integration with AI-powered OCR API.

Empower your solutions with automated data extraction by integrating best-in class StructOCR via API seamlessly.

No credit card required • Full API access included