License Plate OCR API
Deploy automated license plate recognition (ALPR) built for global scale. Our engine transcends generic models by accurately extracting native scripts worldwide—from Arabic and Cyrillic to complex Asian characters—preserving exact layouts and regional nuances. It natively supports multi-plate detection (e.g., stacked trailer and prime mover plates) and dual-language semantic parsing. Beyond the primary plate number, the API identifies plate color, vehicle type, and infers country/region to power border crossings, tolling, and global logistics workflows.
Endpoint
POSThttps://api.structocr.com/v1/license-plateRequest 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 | Required | The Base64 encoded string of the vehicle/plate image.
|
Response Schema
The following attributes are extracted into the data object. The engine preserves native characters and utilizes strict enums for structural data.
| Field | Type | Description |
|---|---|---|
| plates | array of objects | Array containing all detected plates on the vehicle (supports multi-plate layouts like trailers). |
| ↳ plate_number | string | null | The exact visual text including local scripts and original punctuation. Null if unreadable. |
| ↳ plate_number_normalized | string | null | Standardized Latin/ASCII version (uppercase letters, digits, spaces, hyphens) for database indexing. |
| ↳ plate_color | enum | Dominant background color: white, yellow, black, green, blue, red, other, unknown. |
| ↳ plate_type | enum | Vehicle type category: private, commercial, government, trailer, etc. |
| region_text | string | null | Secondary caption (e.g., province/state), usually in the local native script. |
| country_guess | string | null | Guessed country based on visual cues or unambiguous national format logic. |
| confidence_score | number | Recognition certainty level, returned as a decimal between 0.0 and 1.0. |
Code Examples
Request Implementation
curl -X POST https://api.structocr.com/v1/license-plate \
-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": {
"plates": [
{
"plate_number": "7 SAM 123",
"plate_number_normalized": "7SAM123",
"plate_color": "white",
"plate_type": "private"
}
],
"region_text": "California",
"country_guess": "United States",
"confidence_score": 0.99
}
}Live API Test
Live Demo: License Plate OCR Scanner
No registration required. Upload a file to test the extraction.
Drop files here or click to browse
JPG · PNG · WebP · up to 500 files · max 4.5 MB each
Error Responses
400 Bad Request - Invalid Input
{
"status": 400,
"code": "INVALID_REQUEST_FORMAT",
"message":"The image data in 'img' field is malformed. Please check for illegal characters 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 structure. |
| 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 |
| 500 | PROCESSING_ERROR | Downstream processing fault |
| 503 | SYSTEM_BUSY | API Rate limit reached |