Skip to content

Driving License OCR API

New

Read an uploaded driving license image and get the printed card details back as structured fields. Nobody retypes the attachment into your onboarding record.

Overview

Driving License OCR reads a photographed or scanned license and returns what is printed on the card as fields your application can store. Teams that onboard drivers, riders, renters or customers presenting a license as identity otherwise retype the same document thousands of times. Your application submits a license image it has already collected. The service reads it and returns the fields it can pull out, ready to pre-fill a form or fill a record. The fields available depend on the document, the layout used by the issuing state and how legible the image is. Extraction is a capture step. OCR reports what a document shows, and confirming the license itself is a separate check. Collect the document with the holder's informed consent and use the result only for that purpose.

Coverage
Driving licenses issued across Indian states and union territories
Input
A driving license image or scan, collected with the holder's consent
Output
Structured fields read from the card, where the document and image allow
Typical users
Logistics, gig and staffing platforms, rental and leasing, lending, insurance
Coverage note
Card layouts differ by issuing state; recovered fields vary by document

The overview and the sections after the reference are the FinSour API catalog’s own record for this service, rendered unaltered.

Endpoint URL and method

POSThttps://gateway.staging.finsour.io/v1/documents/driving-licence

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Authentication

Scheme API key travels in the X-Api-Key header

Send your API key in this header on every call, from your own server: a key sent from a browser is refused. A key starting fs_test_ calls the sandbox and one starting fs_live_ calls production, at the same address. Create keys in the FinSour console.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Request parameters

Content type multipart/form-data

Headers

NameTypeRequiredDescriptionConstraints
Idempotency-KeystringRequiredA key you generate for each attempt. Sending the same key again returns the first answer instead of running the check twice; the same key with a different body is refused.8 to 255 characters. Matches ^[A-Za-z0-9._:-]+$
FinSour-VersionstringRequiredSend 2026-11-01 on this call and on every poll to get the receipt and the result described on this page. A call without it is served under 2026-09-01, whose job has a different shape.—

Body

NameTypeRequiredDescriptionConstraints
filefileRequiredThe document to read.—
payloadstring (JSON)RequiredA JSON string carrying the call's options.—
payload.optionsobjectRequiredSettings for this call. This API requires consent.—
payload.options.referencestringOptionalYour own reference for this call. It comes back unchanged as meta.reference.1 to 128 characters
payload.options.consentobjectRequiredThe person's consent to this check.—
payload.options.consent.obtainedbooleanRequiredSend true once the person has agreed to the check.Always true
payload.options.consent.atstring (date-time)RequiredWhen the person gave consent.—
payload.options.consent.purposestringRequiredWhat the check is for, for example kyc.1 to 64 characters

Request samples

cURL

curl -X POST https://gateway.staging.finsour.io/v1/documents/driving-licence \
  -H "X-Api-Key: $FINSOUR_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "FinSour-Version: 2026-11-01" \
  -F "file=@<path-to-document>" \
  -F 'payload={"options":{"consent":{"obtained":"<obtained>","at":"<at>","purpose":"<purpose>"}}}'

Node.js

import { openAsBlob } from "node:fs";

const form = new FormData();
form.append("file", await openAsBlob("<path-to-document>"));
form.append("payload", JSON.stringify({
  "options": {
    "consent": {
      "obtained": "<obtained>",
      "at": "<at>",
      "purpose": "<purpose>"
    }
  }
}));

const response = await fetch("https://gateway.staging.finsour.io/v1/documents/driving-licence", {
  method: "POST",
  headers: {
    "X-Api-Key": process.env.FINSOUR_API_KEY,
    "Idempotency-Key": crypto.randomUUID(),
    "FinSour-Version": "2026-11-01",
  },
  body: form,
});

console.log(response.status, await response.json());

Python

import os
import uuid
import json

import requests

response = requests.post(
    "https://gateway.staging.finsour.io/v1/documents/driving-licence",
    headers={
        "X-Api-Key": os.environ["FINSOUR_API_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
        "FinSour-Version": "2026-11-01",
    },
    files={"file": open("<path-to-document>", "rb")},
    data={"payload": json.dumps({
        "options": {
            "consent": {
                "obtained": "<obtained>",
                "at": "<at>",
                "purpose": "<purpose>",
            },
        },
    })},
    timeout=30,
)

print(response.status_code, response.json())

Generated from the fields above. Replace each value in angle brackets with your own; the key is read from FINSOUR_API_KEY.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Response schema

Status 202 · content type application/json

NameTypePresentDescriptionConstraints
dataobjectAlwaysThe job that will read the document.—
data.jobIdstringAlwaysThe job's id. Poll GET /v1/jobs/{jobId} with it.Matches ^[0-9A-HJKMNP-TV-Z]{26}$
data.statusstringAlwaysAlways queued: the job is accepted and has not started.Always "queued"

The result

Poll GET /v1/jobs/{jobId}. Once the job has finished, data holds these fields:

NameTypePresentDescriptionConstraints
jobIdstringAlways——
statusstringAlways—One of queued, processing, completed, needs_review, unreadable, failed, expired, cancelled
documentTypestring or nullAlwaysThe kind of document found, once it has been read; null before that.—
confidencenumber or nullAlwaysThe document's confidence, 0 to 1, to two places; null until it has been read.Minimum 0. Maximum 1
fieldsobjectAlwaysWhat was read. Every key is always present: null means the document does not carry it, or it could not be read with enough confidence.—
fields.maskedNumberstring or nullAlways——
fields.namestring or nullAlways——
fields.relationNamestring or nullAlways——
fields.dobstring or nullAlwaysISO date, YYYY-MM-DD; a year or month alone is YYYY or YYYY-MM.—
fields.issueDatestring or nullAlwaysISO date, YYYY-MM-DD; a year or month alone is YYYY or YYYY-MM.—
fields.validTillstring or nullAlwaysISO date, YYYY-MM-DD; a year or month alone is YYYY or YYYY-MM.—
fields.vehicleClassesarray of stringsAlways——
fields.bloodGroupstring or nullAlways——
fields.addressstring or nullAlways——
fieldsToReviewarray of stringsAlwaysWhen status is needs_review, the fields a person should confirm; empty otherwise.—
failureReasonstringSometimesPresent only when status is unreadable or failed.One of UNREADABLE_IMAGE, LOW_CONFIDENCE, DOCUMENT_TYPE_MISMATCH, UNSUPPORTED_MEDIA_TYPE, FILE_TOO_LARGE, INPUT_CORRUPT, PAGE_LIMIT_EXCEEDED, TIMEOUT, PROCESSING_ERROR

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Error codes

CodeStatusMeaningRetrying
API_VERSION_UNSUPPORTED400That API version is no longer supported.Do not retry automatically
IDEMPOTENCY_KEY_INVALID400That Idempotency-Key does not meet the required format.Do not retry automatically
IDEMPOTENCY_KEY_REQUIRED400An Idempotency-Key header is required for this request.Do not retry automatically
REQUEST_MALFORMED400The request could not be parsed.Do not retry automatically
AUTH_KEY_EXPIRED401The API key is not valid.Do not retry automatically
AUTH_KEY_INVALID401The API key is not valid.Do not retry automatically
AUTH_KEY_MISSING401No API key was presented.Do not retry automatically
AUTH_KEY_REVOKED401The API key is not valid.Do not retry automatically
INSUFFICIENT_BALANCE402The available balance is not enough for this request.Do not retry automatically
AUTH_IP_NOT_ALLOWED403This API key may not be used from this address.Do not retry automatically
ENTITLEMENT_MISSING403This organization is not entitled to that product in this environment.Do not retry automatically
ORGANIZATION_SUSPENDED403This organization is not active.Do not retry automatically
PRODUCT_NOT_AVAILABLE403That product is not available.Do not retry automatically
PRODUCT_RETIRED403That product has been withdrawn.Do not retry automatically
SCOPE_INSUFFICIENT403This API key does not carry the scope this product requires.Do not retry automatically
PRODUCT_NOT_FOUND404No such product.Do not retry automatically
IDEMPOTENCY_KEY_REUSED409That idempotency key was already used for a different request.Do not retry automatically
PRICE_UNAVAILABLE409No active price covers this product right now.Safe to retry
REQUEST_IN_PROGRESS409An earlier attempt with this key is still running.Safe to retry
SETTLEMENT_PENDING409This request is awaiting reconciliation by an operator.Do not retry automatically
API_VERSION_SUNSET410That API version passed its announced sunset date.Do not retry automatically
REQUEST_TOO_LARGE413The request body is too large.Do not retry automatically
OCR_UNSUPPORTED_MEDIA_TYPE415That document format is not accepted.Do not retry automatically
UNSUPPORTED_MEDIA_TYPE415That content type is not accepted on this route.Do not retry automatically
CONSENT_REQUIRED422This product requires an explicit consent flag.Do not retry automatically
SANDBOX_FIXTURE_MISSING422No sandbox fixture exists for this input. Use a different test value.Do not retry automatically
UPSTREAM_REJECTED422The upstream source rejected the input.Do not retry automatically
VALIDATION_FAILED422The request payload is invalid.Do not retry automatically
CONCURRENCY_LIMIT429Too many simultaneous requests.Safe to retry
OCR_QUEUE_SATURATED429The document queue is full. Retry shortly.Safe to retry
QUOTA_EXCEEDED429The allowance for this window is spent.Do not retry automatically
RATE_LIMITED429Too many requests.Safe to retry
INTERNAL_ERROR500An unexpected error occurred.Safe to retry
OUTCOME_UNCERTAIN502The outcome of this request is not yet known. Retry with the same Idempotency-Key.Do not retry automatically
UPSTREAM_UNAVAILABLE502The upstream source is unavailable. Retry shortly.Safe to retry
MAINTENANCE_MODE503The service is in a maintenance window.Safe to retry
NO_PROVIDER_AVAILABLE503No provider can serve this product right now.Safe to retry
OCR_UNAVAILABLE503Document reading is unavailable right now. Retry later.Safe to retry
SERVICE_OVERLOADED503The service is shedding load. Retry shortly.Safe to retry
UPSTREAM_TIMEOUT504The upstream source did not respond in time.Safe to retry

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Rate limits

ScopeLimitWindowAt the limit
Your API key, within your organisation's limitThe figure in X-RateLimit-LimitPer minute429 RATE_LIMITED, with Retry-After in seconds. Every answer past authentication carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset.

Supplied by FinSour platform API contract (finsour development at 80e8b83bf) on . OpenAPI document at commit 436311c32, API version 2026-11-01. The beta is served from the staging gateway.

Use cases

  • Logistics and last-mile: read a delivery partner license at sign-up
  • Staffing and gig platforms: driver and field-agent document intake
  • Vehicle rental and leasing: license capture at the counter or in the app
  • Lending and NBFC: license capture in two-wheeler and used-vehicle finance
  • Insurance: driver details for motor proposals and claims
  • Travel and hospitality: photo identity capture at check-in

What this service does

  • License number, name and validity as fields

    Send a license image and get back what the service can recover. That can include the license number, the holder's name and relation name and the date of birth. The printed address, the endorsed vehicle classes and the issue and validity dates can come back as well. Which fields you get depends on the document you send, the layout used by the issuing state and how legible the image is.

  • Reads the card where drivers already upload it

    Connect the service to a web onboarding flow, a mobile or partner app, an internal dashboard or a back-office queue. The card is read where it is already uploaded. Nobody opens it again in a separate manual step.

  • Fewer keystrokes between upload and record

    Extracted values pre-fill the form that the applicant or reviewer then confirms. That removes the second round of manual data entry, along with the typing mistakes that show up later as records that do not match.

  • The hundredth license reads like the first

    Manual reading slows down as soon as a team handles licenses all day. An API workflow treats every document the same way, and images it cannot read go down an exception path.

How a check runs

  1. Collect the license image with consent

    Capture the driving license or accept an upload from the holder, after telling them what the document will be used for.

  2. Send the license image to the API

    Your application posts the collected image to the service from the onboarding step it already runs.

  3. The service reads the card

    The service processes the image and pulls out the printed details it can recover from the license.

  4. Get the license fields back

    Your application receives the available fields in a structured format it can map straight onto its own record.

  5. Confirm the details, then use them

    Pre-fill the form so the applicant or reviewer can confirm it. Unreadable documents go to an exception queue, and the confirmed values carry into onboarding, finance, rental or claims work.

Questions

What do I upload to read a driving license?
An image or scan of the driving license, collected from the holder with their consent. The extraction needs nothing else about the applicant. Where the details run across both sides of the card, send both sides.
Which driving license details does the API return?
Structured fields carrying whatever the service could read off the card. Depending on the document, that can include the license number, the holder's name and relation name, and the date of birth. It can also include the address as printed, the vehicle classes endorsed on the card, and the issue and validity dates. The exact fields available vary by data source, by the layout used by the issuing state and by the individual record.
Does driving license OCR check whether the license is valid?
No. OCR reports what the submitted document shows. Confirming that a license exists, is current and belongs to the applicant is a separate verification step. Most teams run capture first and verification straight after.
What consent do I need before reading a driving license?
A driving license is personal identity information. Take the holder's informed consent, say what the extraction will be used for, and use it only for that purpose. Limit access to the staff whose work needs it, and keep the image and the extracted data no longer than that purpose and your own policy allow.
Why does one license image return more fields than another?
Card layouts differ by issuing state, and older cards print different details from newer ones. A blurred, angled or glare-affected photo also hides text that a clean one would show. Build your integration so no single field is guaranteed, and give documents that cannot be read an exception path.
How do I get access to the Driving License OCR API?
Use Get API on this page and tell our team about your workflow. Access, supported document types, image formats, batch handling and volumes depend on the service contract you choose.

Catalog entry last updated .