UK Driving Licence OCR & Field Extraction API

Automate identity verification for UK users. Instantly parse DVLA standard numbered fields (such as Field 5 for Licence Number and Field 8 for Address) from any UK driving licence. Upload an image below to test the extraction accuracy for free.

Diagram demonstrating the OCR API scanning a UK driving licence, perfectly mapping numbered fields like Field 5 and Field 8 directly into a structured JSON payload.

The Complexity of DVLA Numbered Fields

The UK driving licence relies on a specific numbered field system established by the DVLA (Driver and Vehicle Licensing Agency). Critical identity data isn't labeled with clear words; instead, Field 1 represents the Surname, Field 5 is the unique 16-character Driving Licence Number, and Field 8 holds the residential address. Standard text-recognition engines frequently misalign these tiny reference numbers with the text, struggle with the multi-line formatting of UK addresses, or misread the alphanumeric patterns in the license number against complex background security guilloches. To see how our models perfectly map these visual cues without hallucinating, explore our comprehensive driver license OCR capabilities.

High-Speed Edge Routing & SDK-Free Integration

Our API is specifically trained on UK DVLA document topographies. Delivered as a pure REST API, it allows you to completely bypass heavy, performance-draining SDK integrations. Simply send a direct file upload or a Base64-encoded string, and our engine processes it natively. Because our core infrastructure is deployed on Cloudflare's global edge network (rather than centralized servers), authentication and processing occur with ultra-low latency for UK-based requests, ensuring a seamless onboarding experience for your users.

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 →

Core Applications in the UK Market

Fintech & Regulated e-Gaming (KYC)

Accelerate user acquisition for neobanks, crypto exchanges, and regulated sports betting platforms. Capture structured identity data reliably, extracting Field 8 (Address) to cross-reference with credit bureaus instantly. Explore our pricing plans for high-volume KYC workflows.

Mobility & Car Rental

Seamlessly onboard drivers by instantly verifying their DVLA licence number (Field 5) and authorized vehicle classes (Field 9). Discover more about how we power the transport sector with our mobility driver verification solutions.

Gig Economy Courier Onboarding

Automate the vetting process for delivery riders and drivers. Quickly scan and validate the Date of Expiry (Field 4b) and category entitlements without manual human review.

Technical Specs

  • Strict Field Mapping: Explicit logic linking UK DVLA designators (1 for Surname, 5 for Licence Number, 8 for Address) directly to standardized JSON keys.
  • Field 3 Parsing: Intelligently separates the combined Date of Birth and Place of Birth often found clustered together in Field 3.
  • Edge Performance: API traffic is routed natively via Cloudflare Workers, ensuring maximum uptime, bypassing slow central gateways, and keeping data processing highly secure.
  • Flexible Data Inputs: Natively processes direct file uploads, Base64 strings, or URLs. No client-side SDK installation is required.

Key Features

  • Date Normalization: Translates the UK `DD.MM.YYYY` date format into strict ISO-compliant `YYYY-MM-DD` strings for seamless database insertion.
  • Multi-line Address Parsing: Accurately detects and reconstructs the multi-line residential address (Field 8) into a single, clean string.
  • Data Cleansing: Automatically handles and cleanses base64 payloads, stripping invisible characters that normally break REST requests.

Integration & AI Prompts

Send document images directly via Base64 or multipart file uploads. Our API automatically sanitizes incoming Base64 payloads (stripping illegal whitespace and newlines) to prevent request failures. For complete payload specifications and error handling, consult our developer documentation.

import requests
import base64

# 1. Prepare Base64 Image of the UK Driving Licence
with open("uk_licence_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"
}

# Direct Base64 injection
payload = {
    "img": base64_image 
}

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

if result.get('success'):
    data = result['data']
    print(f"✅ Licence Number (Field 5): {data['document_number']}")
    print(f"✅ Address (Field 8): {data['address']}")
    print(f"✅ Vehicle Class (Field 9): {data['vehicle_class']}")

Standardized JSON Output

Review how the API processes the standardized UK DVLA format, mapping the numbered fields into clear, descriptive JSON keys while normalizing dates.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "GBR",
    "region": null,
    "document_number": "SMITH920515C99BW",
    "personal_number": null,
    "surname": "SMITH",
    "given_names": "EMMA JANE",
    "sex": null,
    "date_of_birth": "1992-05-15",
    "place_of_birth": "LONDON",
    "date_of_issue": "2020-08-10",
    "date_of_expiry": "2030-08-09",
    "date_of_first_issue": null,
    "issuing_authority": "DVLA",
    "address": "12 HIGH STREET, CAMDEN, LONDON, NW1 8AA",
    "vehicle_class": "AM, A, B1, B, f, k, q",
    "extra_details": {}
  }
}

Frequently Asked Questions

Can I test the UK driving licence scanner for free?

Yes! We provide a free image upload testing widget at the top of this page. Upload a photo of any UK driving licence to instantly evaluate the extraction accuracy of Field 5, Field 8, and other data points.

Does the API require a specific SDK to work?

No, StructOCR operates purely as a REST API. You simply pass an image file or a Base64 string directly to our endpoint, eliminating the need to install and maintain heavy SDKs in your mobile or web applications.

How does the API handle the UK Driving Licence Address (Field 8)?

Field 8 is often printed across multiple lines on the card. Our parsing logic accurately detects the entire block and reconstructs it into a single, comma-separated address string, making it immediately usable for KYC address verification.

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