Skip to main content

Driving License OCR API

Objective

The Driving License OCR API verifies and extracts information from the user's Vietnamese Driving License.

InputOutput
An image or PDF file containing a user's driving licenseAn array containing detailed information extracted from the document

API Endpoint

readDL

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
transactionIdMandatoryA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Input

The following table provides the complete information on the parameter used in the request body for the API calls.

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
image The parameter accepts either an image or a pdf file containing the national IDMandatoryImage(JPG,JPEG and PNG) or PDF FileNot Applicable

Sample Request

The following code shows a standard cURL request for the API.

curl --location --request POST 'https://apac.docs.hyperverge.co/v1/readDL' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_image_file>"'

Success Response Sample

The following is a sample of a success response from the API.

{
"status": "success",
"statusCode": "200",
"result": [
{
"type": "dl_new_front",
"details": {
"name": {
"to-be-reviewed": "no",
"value": "<Name_of_the_User>",
"conf": 0.9946
},
"dob": {
"to-be-reviewed": "no",
"value": "<Date_Of_Birth_in_DD-MM-YYYY_Format>",
"conf": 0.9994
},
"dl-number": {
"to-be-reviewed": "no",
"value": "<Masked_Aadhaar_Number>",
"conf": 0.9925
}
"Other fields"
}
}
],
"requestId": "<Request_ID>"
}

Success Response Details

ParameterTypeDescription
nameobjectDetails related to the name of the individual
to-be-reviewedstringIndicates if the name is marked for review or not
valuestringThe actual name value
confnumberThe confidence level associated with the accuracy of the name
dobobjectDetails related to the date of birth of the individual
to-be-reviewedstringIndicates if the date of birth is marked for review or not
valuestringThe actual date of birth value
confnumberThe confidence level associated with the accuracy of the date of birth
dl-numberobjectDetails related to the driving license number
to-be-reviewedstringIndicates if the driving license number is marked for review or not
valuestringThe actual driving license number value
confnumberThe confidence level associated with the accuracy of the driving license number

Failure Response Sample

The following is a sample response when no matching record is found against the input parameter.

{
"status": "failure",
"statusCode": 400,
"error": "API call requires atlest one input image"
}

Error Response Samples

{
"status": "failure",
"statusCode": 422,
"error": "Vietnam Driver License Not Detected",
"requestId": "<Request_ID>"
}

Failure and Error Response Details

A failure or error response from the module contains a failure status, with a relavant status code and error message. The following table lists all error responses.

Status CodeError MessageError Description
400API call handles only upto 2 imagesThis error is returned when more than 2 images are sent in the API call
400image size cannot be greater than 6MBThe maximum size of input image is 6MB. Crossing this will result in this error
422Vietnam Driver License Not DetectedWhen the AI model could not find a driving license in the image
429Rate limit exceededYou have exceeded the configured limit on the number of transactions permitted in a minute. Please contact the HyperVerge team for resolution
500/501Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
503Server busyPlease contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: