Romania Driver License OCR API with Node.js

Extract licence number, names, dates, and vehicle class from the Romania permis de conducere with the StructOCR Node.js SDK.

Reading the permis de conducere

It follows the EU photocard layout, where numbered fields hold the surname (1), given names (2), date and place of birth (3), issue and expiry dates (4a, 4b), issuing authority (4c), licence number (5), and categories (9). Romanian licences also show the holder’s CNP personal number. Typing these fields by hand slows down rental, onboarding, and fleet workflows and introduces formatting errors.

Structured Fields from One API Call

The Driver License OCR API returns the licence number, holder name, dates, issuing authority, address, and vehicle class when they are printed and legible; missing fields are null. Try a sample with the free driver license scanner. For coverage, pricing, and the full field list, see the driver license OCR API overview.

Common Integration Scenarios

  • Vehicle rental: Pre-fill Romania licence details before handover and keep the agent’s confirmation step.
  • Driver onboarding: Move licence fields into a review queue without retyping the card.
  • Fleet records: Track licence classes and expiry dates for internal compliance reminders.
Need more testing? Create a free account to get 200 free credits (equals 100 Driver License scans).

Romania Driver License OCR API with Node.js

The official Node.js SDK reads a local file and calls /v1/driver-license from your backend.

Prerequisite: `npm install structocr`; set the server-side `STRUCTOCR_API_KEY` environment variable.

Prefer another stack? Open the Python SDK + FastAPI integration.

const StructOCR = require("structocr");

const client = new StructOCR(process.env.STRUCTOCR_API_KEY);

async function main() {
  const result = await client.scanDriverLicense("driver-license.jpg");
  if (result.success) {
    const data = result.data;
    console.log(data.document_number);
    console.log(data.given_names, data.surname);
  } else {
    console.error(result.error);
  }
}

main().catch(console.error);

Technical Specs

  • •Endpoint: POST /v1/driver-license
  • •Input: Base64-encoded JPG, PNG, WebP, or PDF in JSON (Max 4.5MB)
  • •Authentication: Server-side x-api-key header handled by the SDK
  • •Cost: 2 credits per successful scan; failed requests are not billed
  • •Output: Structured JSON

Key Features

  • •Local layout: Handles the permis de conducere layout and its printed field labels.
  • •Licence fields: Returns licence number, vehicle class, and validity dates when visible.
  • •Normalized dates: Dates are returned as YYYY-MM-DD regardless of the printed format.
  • •Server-side key: The SDK keeps your API key on the backend.

JSON Response Example

Fictional values showing the normalized shape; fields not present on the card are null.

{
  "success": true,
  "data": {
    "type": "drivers_license",
    "country_code": "ROU",
    "region": "Bucharest",
    "personal_number": "2900412000000",
    "surname": "POPESCU",
    "given_names": "IOANA",
    "sex": null,
    "date_of_birth": "1990-04-12",
    "place_of_birth": null,
    "date_of_issue": "2023-05-02",
    "date_of_expiry": "2033-05-01",
    "date_of_first_issue": null,
    "issuing_authority": "DRPCIV",
    "address": null,
    "vehicle_class": "B",
    "extra_details": {},
    "document_number": "000000000"
  }
}

Frequently Asked Questions

Which fields does the API return for a Romania licence?

Typically country_code, region, document_number, personal_number, names, sex, birth details, issue and expiry dates, issuing_authority, address, and vehicle_class, when printed and legible.

Does OCR verify that the licence is valid?

No. It extracts printed data. Validity and authenticity checks need the issuing authority’s records or your own review process.

Is there a version for the other SDK language?

Yes. A paired Python version of this tutorial covers the same document.

You May Also Like

Related tutorials, platform guides, and comparisons

Country Tutorial

Romania Driver License OCR API with Python

Extract licence number, names, dates, and vehicle class from the Romania permis de conducere with the StructOCR Python SDK.

Python · Driver License
Tutorial

Node.js Driver License Verification API

Stop manual driver license checks. Our Node.js API delivers verified data in JSON within <4s, secured by AES-256 encryption and SOC2 compliance. Upload an image for a free test!

Node.js · Driver License
Tutorial

Node.js US Driver License PDF417 API Tutorial

Decode US driver license PDF417 barcodes with Node.js. Send a license-back image, parse AAMVA fields, and handle unreadable barcode errors safely.

Node.js · Driver License
Country Tutorial

Taiwan Driver License OCR API with Node.js

Extract licence number, names, dates, and vehicle class from the Taiwan Taiwan driver license with the StructOCR Node.js SDK.

Node.js · Driver License
Country Tutorial

Canada Driver License OCR with Node.js SDK

Extract structured fields from a Canada provincial driver licence with the StructOCR Node.js SDK and TypeScript + Express.

Node.js · Driver License
Country Tutorial

Egypt Driver License OCR API with Node.js

Extract licence number, names, dates, and vehicle class from the Egypt Egyptian driving licence with the StructOCR Node.js SDK.

Node.js · Driver License
Country Tutorial

UK Driver License OCR with Node.js SDK

Extract structured fields from a United Kingdom photocard driving licence with the StructOCR Node.js SDK and TypeScript + Express.

Node.js · Driver License
Country Tutorial

US Driver License OCR with Node.js SDK

Extract structured fields from a United States state-issued driver license with the StructOCR Node.js SDK and TypeScript + Express.

Node.js · Driver License
Country Tutorial

UK Driver License OCR with Python SDK

Extract structured fields from a United Kingdom photocard driving licence with the StructOCR Python SDK and FastAPI.

Python · Driver License
Country Tutorial

US Driver License OCR with Python SDK

Extract structured fields from a United States state-issued driver license with the StructOCR Python SDK and FastAPI.

Python · Driver License

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