US State ID Card PDF417 Barcode API
Read the AAMVA barcode on the back of non-driver state ID cards with the same API you use for driver licenses.
Non-Drivers Still Need to Be Checked In
Millions of US adults hold a state identification card instead of a driver license, often older customers, city residents who do not drive, and younger applicants. States print the same AAMVA PDF417 barcode on the back of these cards. A scanning flow built only around licenses either rejects them or stores them as licenses with blank class and endorsement fields.
Same Endpoint, Explicit Document Kind
Upload the card back to the PDF417 API. StructOCR decodes the barcode deterministically, parses the AAMVA DL/ID record, and returns document_kind: "id_card" with the issuing state in region. Licenses return driver_license. Try a non-sensitive sample in the free PDF417 scanner.
Where ID Card Barcodes Show Up
- Age-restricted retail: Verify date of birth from state ID cards at alcohol, tobacco, and cannabis counters with the same flow as licenses.
- Healthcare and visitor intake: Pre-fill patient or visitor name, date of birth, and address from either card type.
- Fintech and telecom onboarding: Accept the ID many applicants actually carry while recording the correct document type for KYC review.
Decode a State ID Card Back
Upload a JPG, PNG, or WebP image with the full PDF417 barcode visible. Language tutorials show the same call with document_kind handling.
Prerequisite: A server-side StructOCR API key and a clear image of the complete card back
curl -X POST https://api.structocr.com/v1/driver-license-pdf417 \
-H "x-api-key: $STRUCTOCR_API_KEY" \
-F "file=@state-id-back.jpg"Technical Specs
- •Endpoint: POST https://api.structocr.com/v1/driver-license-pdf417 (same endpoint for driver licenses and ID cards)
- •Authentication: x-api-key request header
- •Inputs: JPG, PNG, or WebP; Base64 JSON or multipart upload
- •Maximum file size: 4.5MB
- •Price: 2 credits for a successful decode; processing failures are refunded
- •Document kind: `document_kind` is `id_card` for identification-card records and `driver_license` for licenses
- •Region output: The issuing state code, such as NY or CA, when encoded in the record
- •Important: Parsing barcode data does not by itself authenticate the credential or the person presenting it
Key Features
- •One integration for both cards: Licenses and non-driver ID cards share the AAMVA PDF417 layout, so the same request handles both.
- •Explicit document kind: Branch on `document_kind` instead of guessing from missing license class fields.
- •No AI guessing: Identity fields come from a decoded PDF417 payload and AAMVA parser, never from a generative model.
- •Retake-safe errors: PDF417_NOT_DECODED returns HTTP 422 with an optional `capture_issue` hint such as `out_of_focus` or `image_too_small`.
Illustrative State ID Card Response
This response uses wholly fictional data. Some states fill vehicle_class on ID cards with their own placeholder, so rely on document_kind instead.
{
"success": true,
"data": {
"type": "drivers_license",
"document_kind": "id_card",
"source": "pdf417",
"country_code": "USA",
"region": "NY",
"document_number": "SAMPLEID123",
"surname": "SAMPLE",
"given_names": "ALEX MORGAN",
"first_name": "ALEX",
"middle_name": "MORGAN",
"name_suffix": null,
"sex": "F",
"date_of_birth": "1990-01-15",
"date_of_issue": "2025-01-15",
"date_of_expiry": "2033-01-15",
"address": "100 EXAMPLE AVE",
"city": "SAMPLE CITY",
"postal_code": "10001",
"vehicle_class": null,
"restrictions": null,
"endorsements": null,
"height": null,
"eye_color": null,
"document_discriminator": "SAMPLE-DISCRIMINATOR",
"issuer_identification_number": "636000",
"aamva_version": 10,
"jurisdiction_version": 0
}
}Frequently Asked Questions
Which US state ID cards are supported?
Cards whose back carries an AAMVA-compliant PDF417 record, which covers the standard state ID cards issued alongside driver licenses. Municipal or membership IDs without an AAMVA barcode are not supported and return a 422 error.
What about REAL ID and Enhanced ID cards?
REAL ID-compliant state ID cards use the same barcode. Enhanced IDs encode an enhanced record; they are reported as id_card when no license class is present and as driver_license for enhanced driver licenses.
Does a successful decode prove the ID card is genuine?
No. It proves a usable barcode payload was decoded and parsed. Authenticity, identity, eligibility, and fraud decisions require separate controls.
You May Also Like
Related tutorials, platform guides, and comparisons
New Jersey Driver License OCR: Extract Fields with Python
Extract visible fields from New Jersey driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
South Africa Driver License OCR: Extract Fields with Python
Extract visible fields from South Africa driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Iowa Driver License OCR: Extract Fields with Python
Extract visible fields from Iowa driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Indiana Driver License OCR: Extract Fields with Python
Extract visible fields from Indiana driver license images into JSON. Map identifiers, names and dates, with a review workflow for incomplete results.
Brazil Driver License OCR with Node.js SDK
Extract structured fields from a Brazil Carteira Nacional de Habilitação (CNH) with the StructOCR Node.js SDK and TypeScript + Express.
ASP.NET Core PDF417 Driver License API
Build a minimal ASP.NET Core API that decodes US driver license PDF417 barcodes and returns normalized AAMVA JSON with safe retake handling.
Brazil Driver License OCR with Python SDK
Extract structured fields from a Brazil Carteira Nacional de Habilitação (CNH) with the StructOCR Python SDK and FastAPI.
Australia Driver License OCR with Python SDK
Extract structured fields from a Australia state or territory driver licence with the StructOCR Python SDK and FastAPI.
Australia Driver License OCR with Node.js SDK
Extract structured fields from a Australia state or territory driver licence with the StructOCR Node.js SDK and TypeScript + Express.
VIN Barcode Scanner vs. VIN OCR: Which is Better?
Deciding between a VIN barcode scanner and VIN OCR for your mobile app? Learn why OCR is the only reliable solution for damaged, glaring, or chassis-stamped VINs.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Driver's License OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Bolt.new app. Build car rental and mobility onboarding flows right in your browser.
Add Driver's License OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API using the Cursor AI code editor. Build car rental and mobility onboarding flows rapidly.
Add Driver's License OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Lovable.dev app. Build car rental and mobility onboarding flows with zero backend.
Add Driver's License OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Replit application. Build car rental and mobility onboarding flows using Replit Agent and Secrets.
Add Driver's License OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a v0 by Vercel app. Build car rental and mobility onboarding flows with zero backend.
Add National ID OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a v0 by Vercel app. Build KYC and identity verification flows with zero backend.
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.