Automated Document Discriminator (DD) Extraction

Strengthen your fraud prevention and identity verification flows. Accurately extract the highly secure Document Discriminator (DD) and audit numbers from any US driver's license. Upload an image below to test the extraction accuracy for free.

Diagram showing the OCR API scanning the bottom edge of a US driver's license to pinpoint and extract the Document Discriminator (DD).

Why is the Document Discriminator (DD) Hard to Extract?

The Document Discriminator (DD)—also known as the audit number or item number—is a critical security feature on modern US driver's licenses. Issuing states use this unique string to track the physical card's manufacturing and issuance, making it essential for detecting counterfeit IDs. However, extracting it is notoriously difficult for standard OCR tools. The DD is often printed in a microscopic font, placed vertically on the edges, or buried within complex holographic backgrounds that vary wildly across all 50 states. To see how our models bypass these optical challenges to isolate secure fields, explore our core driver license OCR infrastructure.

Precision Extraction on the Edge

StructOCR solves the DD extraction problem by utilizing layout-aware AI models that understand the specific topography of each state's ID. Delivered as a pure REST API, you are not forced to install bulky, performance-draining SDKs into your frontend applications. Our core infrastructure is deployed on Cloudflare's global edge network, ensuring ultra-low latency for every request. The API offers maximum flexibility for developers, natively supporting direct file uploads, Base64-encoded strings, and image URLs.

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 →

Critical Use Cases for DD Extraction

Advanced KYC & Fraud Prevention

Stop synthetic identity fraud. By extracting the DD and cross-referencing it with AAMVA or state DMV databases, financial institutions can verify that the physical card presented was genuinely issued by the state. Review our pricing plans to integrate secure KYC checks.

Mobility & Fleet Onboarding

Car rental agencies and gig-economy platforms must ensure drivers hold valid, non-revoked licenses. Extracting the DD provides the necessary audit trail for compliance and insurance underwriting. Discover more about our mobility driver verification solutions.

Regulated Retail & Age Verification

For delivery of age-restricted goods (alcohol, cannabis, pharmaceuticals), scanning the front of the ID to capture both the Date of Birth and the DD ensures the highest level of compliance and regulatory protection.

Technical Specs

  • Targeted Extraction: Uses semantic mapping to locate the Document Discriminator (DD) reliably, outputting it to the standardized `card_security_number` field.
  • Architecture: Delivered entirely as an API rather than an SDK, deployed on Cloudflare Workers for instant routing and execution.
  • Input Versatility: Fully supports multipart file uploads, raw Base64-encoded strings, and direct image URLs.
  • Automated Cleansing: The API natively cleans up malformed Base64 strings (e.g., stripping newlines) to prevent integration friction.

Key Features

  • Full Profile Extraction: Alongside the DD, it captures the Driver's License Number, Full Name, Address, and standardized Dates (YYYY-MM-DD).
  • State Agnostic: Automatically recognizes and parses layouts from all 50 US states without requiring manual state selection.
  • Format Normalization: Translates complex, varied US state abbreviations and date formats into a single, predictable JSON schema.

Integration & AI Prompts

Integrating DD extraction takes minutes. Our endpoint automatically sanitizes Base64 payloads (removing illegal whitespaces) and processes files up to 4.5MB. For complete payload parameters, check our developer documentation. You can also pass the prompt below to your AI coding assistant.

import requests
import base64

# 1. Prepare Base64 Image of the US Driver's License
with open("us_id_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"
}

# Send pure Base64 string directly to the API
payload = {
    "img": base64_image 
}

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

if result.get('success'):
    data = result['data']
    print(f"✅ State: {data['region']}")
    print(f"✅ License Number: {data['document_number']}")
    print(f"✅ Document Discriminator (DD): {data['extra_details']['card_security_number']}")

Standardized JSON Output

The Document Discriminator (DD) is safely extracted and normalized into the `extra_details.card_security_number` field, ready for your backend fraud-check logic.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "USA",
    "region": "TX",
    "document_number": "12345678",
    "personal_number": null,
    "surname": "DOE",
    "given_names": "JONATHAN MICHAEL",
    "sex": "M",
    "date_of_birth": "1988-07-22",
    "place_of_birth": null,
    "date_of_issue": "2022-03-14",
    "date_of_expiry": "2028-07-22",
    "date_of_first_issue": null,
    "issuing_authority": "Texas DPS",
    "address": "456 LONGHORN DR, AUSTIN, TX 78701",
    "vehicle_class": "C",
    "extra_details": {
      "card_security_number": "0001234567890123"
    }
  }
}

Frequently Asked Questions

Can I test the Document Discriminator extraction for free?

Yes! We offer a free image upload testing widget at the top of this page. You can upload a photo of your US driver's license to instantly see how accurately the API extracts the DD and other fields.

Do I need to implement an SDK for this to work?

No, StructOCR operates purely as an API. You do not need to install any heavy SDKs. You can simply pass a file upload, a Base64-encoded string, or an image URL directly to our endpoint.

What exactly is the Document Discriminator (DD)?

The Document Discriminator (DD) is a unique audit number printed on US driver's licenses. Unlike the main driver's license number (which stays with the driver), the DD tracks the specific physical card. It is widely used by financial and rental institutions to verify that an ID is not counterfeit.

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