VIN OCR
Seamlessly automate vehicle verification with our enterprise-grade VIN OCR API. We provide high-precision extraction for 17-character Vehicle Identification Numbers from windshields, door jamb stickers, and metal plates. The engine features built-in ISO 3779 logic to automatically correct common OCR errors (e.g., converting 'I' to '1', 'Q' to '0') and ensure data validity for your insurance or fleet management workflows.
Endpoint
POSThttps://api.structocr.com/v1/vinRequest Parameters
Important: This endpoint requires application/json Content-Type. Images must be sent as Base64 strings.
| Parameter | In | Required | Description |
|---|---|---|---|
| x-api-key | Header | Required | Your unique API key generated from the dashboard. |
| Content-Type | Header | Required | Must be set to application/json. |
| img | Body (JSON) | Required | The Base64 encoded string of the vehicle image (windshield, sticker, etc).
|
Response Schema
The following fields are extracted into the data object. The engine automatically normalizes characters (e.g. upper-case).
| Field | Description |
|---|---|
| vin | The 17-character Vehicle Identification Number (ISO 3779 corrected). |
| confidence | The confidence level of the recognition (High, Medium, Low). |
| carrier_type | The detected location of the VIN (e.g., 'windshield', 'sticker_label', 'metal_plate'). |
Code Examples
Request Implementation
curl -X POST https://api.structocr.com/v1/vin \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}'Success Response (200 OK)
{
"success": true,
"data": {
"vin": "1M8GDM9A6KP042788",
"confidence": "High",
"carrier_type": "windshield"
}
}Error Responses
400 Bad Request - Invalid Input
Returned when JSON is invalid or image data is missing/corrupt.
{
"status": 400,
"code": "INVALID_REQUEST_FORMAT",
// or "INVALID_JSON", "INVALID_BASE64_FORMAT"
"message":"The image data in 'img' field is malformed. Please check for illegal characters (spaces, newlines) or incorrect Base64 encoding."
}402 Payment Required - Insufficient Credits
{
"status": 402,
"code": "INSUFFICIENT_CREDITS",
"message": "Your account balance is insufficient to complete this operation."
}413 Payload Too Large
The Base64 decoded image size exceeds 4.5MB.
{
"error": "FILE_TOO_LARGE"
}415 Unsupported Media Type
{
"error": "INVALID_CONTENT_TYPE_USE_JSON"
}422 Unprocessable Entity - Policy Violation
{
"status": 422,
"code": "CONTENT_POLICY_VIOLATION",
"message": "The document content could not be processed due to safety policies."
}500 Internal Server Error
{
"status": 500,
"code": "PROCESSING_ERROR",
"message": "An internal error occurred while processing the document..."
}503 Service Unavailable - System Busy
{
"status": 503,
"code": "SYSTEM_BUSY",
"message": "StructOCR is currently processing a high volume of requests..."
}Status Code Definitions
| Code | Error Code | Description |
|---|---|---|
| 200 | SUCCESS | Recognition success |
| 400 | INVALID_REQUEST_FORMAT | Invalid payload or corrupted Base64. Ensure the image string has no whitespace, newlines, or illegal characters. |
| 402 | INSUFFICIENT_CREDITS | Account balance too low |
| 413 | FILE_TOO_LARGE | Decoded image exceeds 4.5MB |
| 415 | INVALID_CONTENT_TYPE | Not using application/json |
| 422 | CONTENT_POLICY_VIOLATION | AI safety/policy block |
| 503 | SYSTEM_BUSY | API Rate limit reached |