Customs Clearance: Container OCR API
Accelerate cross-border freight clearance. Upload your local border checkpoint captures to test our extraction accuracy for free, ensuring digital customs manifests match physical cargo perfectly.

The Bottleneck at the Border
Cross-border trade relies on strict compliance and rapid throughput. When trucks carrying shipping containers arrive at customs checkpoints, officers often perform manual visual inspections to cross-reference the physical container ID against digital customs declarations. This manual process causes massive border queues, delays global supply chains, and risks human error. Standard OCR often fails here due to multi-lane camera setups, extreme weather, and heavy dirt from long-haul transit. To see how our engine cuts through these baseline visual challenges, you can upload a test image to explore our core Container OCR capabilities completely free.
Secure Extraction for Government IT
Delivered strictly as a high-performance REST API to ensure seamless integration into government or private customs software without heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It provides instant verification at the border. The engine applies strict ISO 6346 validation on the fly, instantly calculating check digits to guarantee that only perfectly accurate Container Codes trigger your automated clearance workflows.
Live Demo: Container OCR
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
Customs & Border Control Scenarios
Automated Border Crossings
Instantly verify inbound and outbound containers without forcing trucks to stop. By automating ID capture, lanes process freight faster. Ready to scale your border infrastructure? View flexible pricing to secure maximum processing limits for high-traffic checkpoints.
Digital Manifest Reconciliation
Automatically match the visually extracted ISO code against pre-lodged electronic customs declarations (such as ENS/EXS) to flag discrepancies or smuggling risks instantly.
X-Ray & NII Integration
Attach the perfectly parsed container number directly to Non-Intrusive Inspection (NII) X-ray scans, ensuring the scanned cargo image is indelibly linked to the correct container ID for compliance audits.
Port of Entry Gateways
Streamline the transition from the seaport yard to the customs inspection zone, ensuring the chain of custody is flawlessly maintained before releasing goods into the domestic market.
Technical Specs
- Edge Optimization: Deployed globally on Cloudflare's edge network, ensuring ultra-low t1/t2 latency to process vehicles rapidly at high-volume international borders.
- Input Versatility: Fully supports raw Base64 strings and direct multipart file uploads—ideal for highly secure, air-gapped government intranet systems.
- Validation: Built-in ISO 6346 checksum verification mathematically guarantees data accuracy before logging the entry into national customs databases.
- Weather & Dirt Tolerance: Advanced algorithms natively handle skewed captures, heavy road grime, and poor lighting conditions common in long-haul trucking.
Key Features
- Free Image Testing: Instantly upload highly obscured images from your actual border checkpoints to test extraction accuracy before deploying across your agency.
- Standardized Output: Returns a unified `container_number` string ready for database ingestion, while isolating the Owner Code, Category, Serial, and Check Digit in a parsed object.
- Universal Compatibility: Pure REST API architecture ensures zero dependency conflicts, integrating smoothly with custom government IT infrastructure.
Integration & AI Prompts
Call the endpoint directly via HTTP from your customs IT infrastructure. To maintain strict data sovereignty and security, the API flexibly accepts direct multipart file uploads or Base64-encoded strings, avoiding the need to expose sensitive border camera feeds on public networks.
import requests
import base64
# Prepare Base64 Image from border checkpoint camera
with open("customs_lane_A_capture.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("Scanning Border Capture...")
response = requests.post(url, headers=headers, json=payload)
result = response.json()
if result.get('success'):
data = result['data']
print("✅ Container Code Extracted!")
print(f"Full Number: {data.get('container_number')}")
print(f"Valid ISO: {data.get('is_valid')}")
print(f"Confidence: {data.get('confidence')}")
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 ISO 6346 components for your customs clearance software.
{
"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 we test the API with images from our border checkpoints before integrating it?
Absolutely. You can upload images directly on our platform to test how the OCR engine handles your specific camera angles, dirt levels, and lighting completely free of charge.
Do we need to expose sensitive border camera feeds to public URLs?
No. The API is designed for strict security and local integration, natively accepting direct file uploads and Base64-encoded strings directly from your secure network.
Will this integrate with existing national customs databases?
Yes. Because we provide a standard HTTP REST API that returns structured JSON, it acts as a highly secure, universal data feed that can be consumed by any government IT stack.
Explore More Container Solutions
Damage Inspection: Container OCR API
Automate container damage inspection with our high-accuracy OCR API. Upload photos of dented or rusted containers to test ISO 6346 extraction for free.
Empty Depot Management: Container OCR API
Streamline your empty container depot operations with our high-accuracy OCR API. Upload yard captures to test our ISO 6346 extraction for free and eliminate lost units.
Container OCR API for European Terminals
High-accuracy ISO 6346 container number extraction for European automated ports and rail networks. Upload your image for a free test to verify accuracy instantly.
Intermodal Rail: Container OCR API
Automate intermodal rail operations with our high-accuracy Container OCR API. Upload rail yard captures to test our ISO 6346 extraction for free. Built for high-speed logistics.
ERP Integration: Container OCR API
Integrate container OCR data directly into your ERP system. Upload logistics photos to test our ISO 6346 extraction for free and eliminate manual data entry.
TOS Integration: Container OCR API
Integrate high-accuracy Container OCR directly into your Terminal Operating System (TOS). Upload terminal CCTV captures to test our ISO 6346 extraction for free.
Warehouse Management Systems: Container OCR API
Automate your Warehouse Management System (WMS) receiving process. Upload loading dock captures to test our high-accuracy Container OCR API for free.
Yard Management Systems: Container OCR API
Automate your Yard Management System (YMS) with our high-accuracy Container OCR API. Upload yard captures to test our ISO 6346 extraction for free.
Automated Gate Systems: Container OCR API
Automate terminal gates with our high-accuracy Container OCR API. Upload your own CCTV images to test our ISO 6346 extraction for free. Built for moving vehicles.
Container OCR API for Australian Logistics
High-accuracy ISO 6346 container number extraction for Australian ports and intermodal yards. Upload your image for a free test today to see instant results.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add Container OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a Replit application. Build logistics and yard management tools using Replit Agent and Secrets.
Tesseract OCR vs. StructOCR API for ISO 6346 Container Numbers
A technical comparison for developers evaluating open-source Tesseract vs. a dedicated cloud API for extracting shipping container numbers.
Add Container OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a v0 by Vercel app. Build logistics and yard management tools with zero backend.
Add Container OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a Bolt.new app. Build logistics and yard management tools right in your browser.
Add Container OCR using Cursor in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API using the Cursor AI code editor. Build logistics and yard management tools rapidly.
Google Cloud Vision vs. StructOCR API for Shipping Containers
Comparing generic enterprise OCR solutions like Google Cloud Vision against StructOCR's purpose-built API for ISO 6346 shipping container recognition.
From tutorial to production in 5 minutes.
You've seen the code. Now get your API key, grab your 200 free credits, and see it work with your own images. No credit card required.