Mexico Driving Licence (Licencia de Conducir) OCR API

Read the Mexican licencia de conducir 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 Mexican licencia de conducir and returning the fields as JSON.

What Makes the Mexican licencia de conducir Hard to Parse

The Mexican licencia de conducir is issued by each state's transit or mobility authority (for example SEMOVI in Mexico City). Mexico has no single national driving licence: each state issues its own card, so layouts, licence number formats and licence types (A, B, C, D, E and others) vary. Many cards also print the holder's CURP, which teams often want for KYC alongside the licence number.

One API Call, Named Fields

The StructOCR Driver License OCR API returns the licence number, the holder's name, date of birth, issue and expiry dates, CURP where printed and the licence type. Dates are returned as YYYY-MM-DD. 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. 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 Mexico

Plataformas de movilidad y reparto

Registrar conductores con su número de licencia, tipo y vigencia.

Renta de autos

Verificar el tipo y la vigencia de la licencia antes de entregar el vehículo.

Fintech y aseguradoras

Prellenar nombre, fecha de nacimiento y CURP desde la licencia.

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, the holder's name, date of birth, issue and expiry dates, CURP where printed and the licence type.
  • Normalized dates: Dates are returned as YYYY-MM-DD.
  • Good to know: Layouts differ by state. Test the states your users come from in the live demo before you rely on a specific field.

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 Mexican licencia de conducir, with fictional values.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "MEX",
    "region": "CDMX",
    "document_number": "A12345678",
    "personal_number": "GORA900101HDFMRN09",
    "surname": "GÓMEZ RAMÍREZ",
    "given_names": "JUAN CARLOS",
    "sex": null,
    "date_of_birth": "1990-01-01",
    "place_of_birth": null,
    "date_of_issue": "2023-02-15",
    "date_of_expiry": "2026-02-15",
    "date_of_first_issue": null,
    "issuing_authority": null,
    "address": null,
    "vehicle_class": "A"
  }
}

Frequently Asked Questions

Can I test the Mexican licencia de conducir 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.

¿Funciona con licencias de todos los estados?

La API lee los campos impresos y devuelve la misma estructura JSON. Como cada estado usa su propio diseño, prueba las licencias de tus usuarios en la demo.

Is the CURP returned?

When it is printed and legible, it is returned as personal_number.

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

Dutch Driving Licence (Rijbewijs) OCR API

Extract the licence number, surname and first names, date and place of birth, issue and expiry dates, issuing municipality and categories from the Dutch rijbewijs as JSON with one API call. Try it free in the browser; new accounts get 100 free licence scans.

Driver License OCR
SOLUTION

Nigeria Driver's Licence OCR API

Extract the licence number, the holder's name, date of birth, issue and expiry dates, address where printed and the licence class from the Nigerian driver's licence as JSON with one API call. Try it free in the browser; new accounts get 100 free licence scans.

Driver License OCR
SOLUTION

Notary and Loan Signing ID Capture with PDF417

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

Driver License OCR
SOLUTION

Pawn Shop and Secondhand Dealer Seller ID Capture

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

Driver License OCR
SOLUTION

Pharmacy Prescription Pickup ID Scanning with PDF417

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

Driver License OCR
SOLUTION

Plasma Donation Center Donor ID Check-In with PDF417

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

Driver License OCR
SOLUTION

Ride-Share Driver License Barcode Onboarding API

Use PDF417 and AAMVA parsing for ride-share onboarding. Pre-fill document_number, date_of_expiry, region, handle unreadable barcodes, and keep API credentials server-side.

Driver License OCR
SOLUTION

Saudi Arabia Driving Licence OCR API

Extract the licence number, the holder's name in Latin script, the ID or Iqama number, date of birth, expiry date and licence type from the Saudi driving licence as JSON with one API call. Try it free in the browser; new accounts get 100 free licence scans.

Driver License OCR
SOLUTION

School Visitor Management with License and ID Barcodes

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

Driver License OCR
SOLUTION

Self-Storage Rental Intake with a Driver License Barcode

Use PDF417 and AAMVA parsing for self-storage leasing. Pre-fill given_names, surname, address, 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