Canadian Driver's Licence OCR API

Read the Canadian driver's licence from a photo and get the licence number, name, dates and classes as structured JSON. Upload an image below to test it free.

200 free credits = 100 Driver License scans, no credit card. Then from $5 for 500 credits, pay as you go. See pricing

Diagram of the API reading a Canadian driver's licence and returning the fields as JSON.

What Makes the Canadian driver's licence Hard to Parse

The Canadian driver's licence is issued by the provinces and territories (for example ServiceOntario, ICBC in British Columbia, SAAQ in Quebec and Alberta registry agents). Canadian licences are issued province by province. They follow the North American (AAMVA) card layout with numbered fields, but each province uses its own licence number format; Ontario's, for example, is a letter followed by 14 digits printed in groups. Quebec cards are printed in French, and licence classes differ by province (G, G1 and G2 in Ontario; Class 5 and 7 in British Columbia and Alberta).

One API Call, Named Fields

The StructOCR Driver License OCR API returns the licence number (field 4d), name (fields 1 and 2), date of birth (field 3), issue and expiry dates (fields 4a and 4b), address (field 8) and licence class (field 9). Dates are returned as YYYY-MM-DD whatever order the card prints them in. Send a JPG, PNG, WebP or PDF as Base64 JSON or as a multipart upload; there is no SDK to embed in your app, although official Python and Node.js SDKs are available. Step-by-step code is in the Python guide and Node.js guide. Usage is billed per successful scan with pay-as-you-go pricing.

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 · PDF · TIFF  ·  up to 500 files · max 4.5 MB each

No document handy?

No files selected
Need more testing? Create a free account to get 200 free credits (equals 100 Driver License scans).

Where Teams Use It in Canada

Car Rental and Fleet

Read the renter's licence class and expiry date at pickup and keep the record with the rental agreement.

Fintech and Lending Onboarding

Prefill name, date of birth and address from the front of the licence during account opening.

Delivery and Courier Platforms

Collect driver licence details across provinces with one integration instead of per-province parsing.

Technical Specs

  • Endpoint: POST https://api.structocr.com/v1/driver-license
  • Input: JPG, PNG, WebP or PDF up to 4.5 MB, as Base64 JSON or multipart upload
  • Price: 2 credits per successful scan; new accounts get 200 free credits (100 scans)
  • Retention: Images and results are kept for at most 24 hours for quality spot-checks, then deleted

Key Features

  • Named fields: The licence number (field 4d), name (fields 1 and 2), date of birth (field 3), issue and expiry dates (fields 4a and 4b), address (field 8) and licence class (field 9).
  • Normalized dates: Dates are returned as YYYY-MM-DD whatever order the card prints them in.
  • Good to know: The back of most Canadian licences carries a PDF417 barcode with the same AAMVA record. If your users can photograph the back, the Driver License PDF417 API decodes it; province guides are available for Ontario, British Columbia, Alberta and Quebec.

Integration & AI Prompts

Install the official SDK and pass a photo of the licence. Full request and response details are in the driver license API reference.

# pip install structocr
import os
from structocr import StructOCR

client = StructOCR(api_key=os.environ["STRUCTOCR_API_KEY"])
result = client.scan_driver_license("licence.jpg")

if result.get("success"):
    data = result["data"]
    print(data["document_number"], data["surname"], data["date_of_expiry"])

Standardized JSON Output

An illustrative response for a Canadian driver's licence, with fictional values.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "CAN",
    "region": "ON",
    "document_number": "A1234-56789-01234",
    "personal_number": null,
    "surname": "TREMBLAY",
    "given_names": "MARIE",
    "sex": null,
    "date_of_birth": "1988-11-03",
    "place_of_birth": null,
    "date_of_issue": "2023-11-03",
    "date_of_expiry": "2028-11-03",
    "date_of_first_issue": null,
    "issuing_authority": null,
    "address": "100 SAMPLE AVE, TORONTO ON M5V 1A1",
    "vehicle_class": "G"
  }
}

Frequently Asked Questions

Can I test the Canadian driver's licence scan for free?

Yes. Upload a photo in the live demo on this page without an account, or create an account to get 200 free credits, enough for 100 licence scans through the API.

Should I read the front or the PDF417 barcode on the back?

Use the front when you only have a selfie-style photo of the card; use the barcode when users can photograph the back, since it carries the structured AAMVA record. Many teams accept either.

Are Quebec licences supported?

Yes. French labels are read like the English ones, and the response uses the same JSON keys for every province.

Do I need an SDK?

No. It is a plain REST API that accepts Base64 JSON or a multipart upload. Official Python and Node.js SDKs are available if you prefer them.

Explore More Driver License OCR Solutions

SOLUTION

Cannabis Dispensary ID Scanning with a PDF417 API

Scan US driver licenses and state ID cards for cannabis dispensaries. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

Car Rental Driver License PDF417 Data Capture

Use PDF417 and AAMVA parsing for vehicle rental check-in. Pre-fill document_number, date_of_expiry, vehicle_class, handle unreadable barcodes, and keep API credentials server-side.

Driver License OCR
SOLUTION

Car Sharing Driver Licence Capture with OCR

How car-sharing and subscription services can capture driver licence data with OCR for compliance workflows, with confirmation steps and clear limits on what OCR does.

Driver License OCR
SOLUTION

Casino Entry and Player Registration with ID Barcodes

Scan US driver licenses and state ID cards for casino entry and player registration. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

Check Cashing and Money Transfer ID Capture with PDF417

Scan US driver licenses and state ID cards for check cashing and money transfer. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

Consumer Loan Application Prefill from ID Barcodes

Scan US driver licenses and state ID cards for consumer lending. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

Coworking Space Member and Guest ID Registration

Scan US driver licenses and state ID cards for coworking spaces. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

CPF Extraction from Driver License API

Accurately extract the CPF (Tax ID) and RG from Brazilian driver licenses (CNH). Try our free image upload tool and integrate our fast, edge-routed OCR API.

Driver License OCR
SOLUTION

Crypto ATM and Kiosk ID Capture with a PDF417 API

Scan US driver licenses and state ID cards for crypto ATMs and kiosks. Pre-fill AAMVA fields from the PDF417 barcode and route unreadable cards to a retake.

Driver License OCR
SOLUTION

Delivery Driver Onboarding with a License Barcode API

Use PDF417 and AAMVA parsing for delivery platforms. Pre-fill given_names, surname, date_of_expiry, handle unreadable barcodes, and keep API credentials server-side.

Driver License OCR

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

From tutorial to production in 5 minutes.

You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.

Instant Access Cancel Anytime No Credit Card