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-plate

Request Parameters

Important: This endpoint requires application/json Content-Type. Images must be sent as Base64 strings.

ParameterInRequiredDescription
x-api-keyHeaderRequiredYour unique API key generated from the dashboard.
Content-TypeHeaderRequiredMust be set to application/json.
imgBodyRequiredThe Base64 encoded string of the vehicle/plate image.
  • Supports standard Data URI (e.g., data:image/jpeg;base64,...)
  • Supports raw Base64 strings
  • Max file size: 4.5MB
  • Formats: JPG, PNG, WebP, PDF
  • Other decoded formats return 415 UNSUPPORTED_FILE_FORMAT.
  • For best response time, compress to under 300 KB.

Response Schema

The following attributes are extracted into the data object. The engine preserves native characters and utilizes strict enums for structural data.

FieldTypeDescription
platesarray of objectsArray containing all detected plates on the vehicle (supports multi-plate layouts like trailers).
↳ plate_numberstring | nullThe exact visual text including local scripts and original punctuation. Null if unreadable.
↳ plate_number_normalizedstring | nullStandardized Latin/ASCII version (uppercase letters, digits, spaces, hyphens) for database indexing.
↳ plate_colorenumDominant background color: white, yellow, black, green, blue, red, other, unknown.
↳ plate_typeenumVehicle type category: private, commercial, government, trailer, etc.
region_textstring | nullSecondary caption (e.g., province/state), usually in the local native script.
country_guessstring | nullGuessed country based on visual cues or unambiguous national format logic.
confidence_scorenumberRecognition 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)

JSON EXAMPLE
{
  "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.

1
Upload
2
Results

Drop files here or click to browse

JPG · PNG · WebP  ·  up to 500 files · max 4.5 MB each

No files selected

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

CodeError CodeDescription
200SUCCESSRecognition success
400INVALID_REQUEST_FORMATInvalid payload or corrupted Base64 structure.
402INSUFFICIENT_CREDITSAccount balance too low
413FILE_TOO_LARGEDecoded image exceeds 4.5MB
415INVALID_CONTENT_TYPENot using application/json
422CONTENT_POLICY_VIOLATIONAI safety/policy block
500PROCESSING_ERRORDownstream processing fault
503SYSTEM_BUSYAPI Rate limit reached