ISO 6346 Validation: Container OCR API

Extract and perfectly validate international container numbers. Upload your raw images to test our extraction and automatic check-digit calculation for free, ensuring flawless data integrity.

Shipping container showing the standard ISO 6346 layout including owner code, category, serial number, and check digit with a free test upload button.

The Complexity of Container Parsing

The ISO 6346 standard is the backbone of global shipping, requiring a precise combination of a 3-letter BIC owner code, an equipment category identifier, a 6-digit serial number, and a mod-11 check digit. Standard OCR tools treat this simply as a string of text, failing to understand the mathematical relationship between these characters. When visual obstructions like rust or shadows cause a single misread character, unstructured OCR passes corrupt data downstream, breaking your logistics database. To see how our engine cuts through these structural challenges, you can upload a test image to explore our core Container OCR capabilities completely free.

Mathematical Verification Built-In

Delivered strictly as a lightweight REST API to ensure seamless integration without heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It doesn't just read text; it understands the standard. The engine applies strict ISO 6346 validation on the fly, instantly calculating the check digit against the owner and serial codes to guarantee perfectly accurate output.

Live Demo: Container OCR

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

Ready to use this in production? Get 20 free API calls — no credit card needed.

Get 20 Free API Calls →

ISO 6346 Application Scenarios

Global Data Standardization

Normalize inbound container data across your entire software ecosystem. Receive pre-parsed, validated components directly into your database. Ready to scale your operations globally? View flexible pricing to secure maximum API limits, utilizing modern frictionless payment rails like USDT/USDC.

Automated Error Reconstruction

Leverage the ISO 6346 algorithm for error correction. If a single character is obscured by a physical dent or rust, the API uses the check digit math to intelligently deduce and reconstruct the missing alphanumeric value.

Equipment Ownership Audits

Instantly isolate the 3-letter BIC code from the full string to automatically identify the leasing company or shipping line that owns the equipment.

Check Digit Verification

Prevent manual data entry typos at the gate or warehouse by instantly running a background validation check on both OCR-extracted and human-entered container codes.

Technical Specs

  • Edge Optimization: Infrastructure is routed through Cloudflare's global edge network, ensuring ultra-low t1/t2 latency for high-frequency algorithmic checks.
  • Built-in Logic: Natively executes the mod-11 weighting algorithm specified by the International Container Bureau (BIC) to verify data authenticity.
  • Input Versatility: Fully supports raw Base64 strings, direct multipart file uploads, and public image URLs—preventing the need to host sensitive images publicly.
  • Dependency-Free: Pure REST architecture prevents language or framework lock-in, bypassing the need for complex SDK maintenance.

Key Features

  • Free Image Testing: Instantly upload images to test the mathematical validation and structural parsing accuracy before committing to integration.
  • Granular Output: Cleanly separates the alphanumeric string into its distinct, meaningful components within a structured JSON object.
  • Algorithmic Recovery: Uses the mathematical relationship of the check digit to repair minor OCR confidence gaps automatically.

Integration & AI Prompts

Call the endpoint directly via HTTP. The API is designed for maximum input versatility, natively accepting standard image URLs, direct multipart file uploads, or Base64-encoded strings to suit any local or cloud architecture.

import requests
import base64

# Prepare Base64 Image for ISO 6346 parsing
with open("container_iso_scan.jpg", "rb") as image_file:
    base64_image = base64.b64encode(image_file.read()).decode('utf-8')

url = "https://api.structocr.com/v1/container"
headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
payload = {
    "img": base64_image
}

try:
    print("Validating ISO 6346 Code...")
    response = requests.post(url, headers=headers, json=payload)
    result = response.json()

    if result.get('success'):
        data = result['data']
        parsed = data.get('parsed', {})
        print("✅ Container Code Extracted & Parsed!")
        print(f"Full Number:  {data.get('container_number')}")
        print(f"Owner Code:   {parsed.get('owner_code')}")
        print(f"Serial:       {parsed.get('serial_number')}")
        print(f"Check Digit:  {parsed.get('check_digit')} (Valid: {data.get('is_valid')})")
    else:
        print(f"❌ Extraction Failed: {result.get('error')} - {result.get('message')}")

except Exception as e:
    print(f"An error occurred: {e}")

Standardized JSON Output

The API returns a cleanly parsed payload providing the full consolidated container number, validating the check digit, and breaking down the precise ISO 6346 components.

{
  "success": true,
  "data": {
    "container_number": "ZCSU8921655",
    "is_valid": true,
    "confidence": "High",
    "parsed": {
      "owner_code": "ZCS",
      "category": "U",
      "serial_number": "892165",
      "check_digit": "5"
    }
  }
}

Frequently Asked Questions

Can I test the ISO validation API for free?

Absolutely. You can upload container images directly on our platform to see how the engine extracts the text and performs the mod-11 check digit calculation completely free of charge.

What happens if an image only shows the owner code and serial, but the check digit is cut off?

The API will still extract the available alphanumeric characters, but the `is_valid` flag in the JSON response will be set to false, alerting your system that the standard ISO 6346 criteria could not be met.

Do you provide SDKs for validating these codes?

We focus entirely on providing a lightning-fast, universal REST API to prevent dependency conflicts across your stack. This ensures simple integration via standard HTTP requests whether you use Base64 strings, file uploads, or URLs.

Explore More Container Solutions

Precise Data Extraction and Seamless Integration with AI-powered OCR API.

Empower your solutions with automated data extraction by integrating best-in class StructOCR via API seamlessly.

No credit card required • Full API access included