Container Code Recognition API for Gate & Crane Cameras
Plug container-number recognition into the camera system you already run. Send a cropped number region or a full frame and get a validated ISO 6346 container number back as JSON.
200 free credits = 200 Container scans, no credit card. Then from $5 for 500 credits, pay as you go. See pricing

Your Cameras Already Capture the Number
Terminal gates, crane spreaders, rail sidings and depot entrances usually have cameras in place, and many systems already crop the area around the container number. What they need is a recognition step that returns the 11-character number reliably and says whether it is plausible, so the gate transaction or crane move can continue without someone retyping it.
One API Call per Image, Validated Output
The StructOCR Container OCR API reads the ISO 6346 container number from the image you send, whether a tight crop of the number or a whole frame, and checks the check digit. The response tells you if the number is valid (is_valid) and splits it into owner code, category, serial number and check digit, so your system can accept valid reads and route the rest to a clerk. It is a plain REST API, called from Java, Python, .NET or Node.js; see the container API reference.
Live Demo: Container OCR
No registration required. Upload a file to test the extraction.
Drop files here or click to browse
JPG · PNG · PDF · TIFF · up to 500 files · max 4.5 MB each
No document handy?
Where It Fits
Terminal and Depot Gates
Read the container number at the gate camera and match it against the booking or pre-advice before the truck reaches the window.
Crane and Spreader Cameras
Confirm which container was lifted during discharge or loading and attach the number to the crane move.
Rail Sidings and ICDs
Record container numbers as wagons pass a camera, then reconcile them with the rail manifest.
Exception Queues
Accept reads where is_valid is true; send the rest, with the image, to an operator for confirmation.
Technical Specs
- Endpoint: POST https://api.structocr.com/v1/container
- Input: JPG, PNG, WebP or PDF up to 4.5 MB, as Base64 JSON or multipart upload; full photos or cropped number regions
- Price: 1 credit per successful scan. New accounts get 200 free credits; packs run from $5 for 500 credits to $99 for 17,000 credits, with no subscription
- Retention: Images and results are kept for at most 24 hours for quality spot-checks, then deleted
Key Features
- Check-digit validation: is_valid tells you whether the number passes the ISO 6346 check digit.
- Parsed number: owner code, category (U, J or Z), six-digit serial number and check digit as separate fields.
- Crops or full frames: send just the number region your camera system already cuts out, or the whole image.
Integration & AI Prompts
Any language that can send an HTTP request works. The example uses Python; Java and .NET systems call the same endpoint with Base64 JSON or a multipart upload. Details are in the container API reference.
import base64, os, requests
with open("gate_crop.jpg", "rb") as f:
img = base64.b64encode(f.read()).decode()
r = requests.post(
"https://api.structocr.com/v1/container",
headers={"x-api-key": os.environ["STRUCTOCR_API_KEY"]},
json={"img": img},
timeout=30,
)
data = r.json()["data"]
if data["is_valid"]:
print("accept", data["container_number"])
else:
print("send to operator", data.get("container_number"))Standardized JSON Output
An illustrative response.
{
"success": true,
"data": {
"container_number": "SOCU7345122",
"is_valid": true,
"confidence": "High",
"parsed": {
"owner_code": "SOC",
"category": "U",
"serial_number": "734512",
"check_digit": "2"
}
}
}Frequently Asked Questions
What does the API return?
The 11-character container number, whether its ISO 6346 check digit is valid (is_valid), a confidence level, and the number split into owner code, category, serial number and check digit.
Does it return the size and type code (for example 22G1 or 45G1)?
No. The response covers the container number and its validation. Read size and type codes separately if your process needs them.
Can I test it for free?
Yes. Use the live demo on this page without an account, or sign up for 200 free credits, enough for 200 container scans through the API.
Should I send a cropped image or the full frame?
Either works. If your camera software already crops the number region, sending the crop keeps uploads small and fast; otherwise send the full frame.
How much does high volume cost?
1 credit per successful scan. At the largest pack ($99 for 17,000 credits) that is under $0.006 per container, with no monthly fee.
Explore More Container Solutions
Container OCR API Canada
High-accuracy ISO 6346 container number extraction built for extreme Canadian weather. Overcome snow, ice, and glare. Upload an image for a free test today.
Container OCR API for Crane Tally
Automate crane tally operations with our Container OCR API. Upload STS or RTG crane camera captures to test our ISO 6346 extraction for free. Handles 180-degree rotations effortlessly.
Container OCR API for Customs Clearance
Accelerate cross-border freight clearance with our Container OCR API. Upload border checkpoint images to test our ISO 6346 extraction for free. Eliminate manual customs delays.
Container OCR API for Damage Inspection
Automate container damage inspection with our high-accuracy OCR API. Upload photos of dented or rusted containers to test ISO 6346 extraction for free.
Container OCR API for Empty Depots
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 Europe
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.
Container OCR API for Intermodal Rail
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.
Container OCR API for ERP
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.
Container OCR API for TOS Integration
Integrate high-accuracy Container OCR directly into your Terminal Operating System (TOS). Upload terminal CCTV captures to test our ISO 6346 extraction for free.
Container OCR API for WMS
Automate your Warehouse Management System (WMS) receiving process. Upload loading dock captures to test our high-accuracy Container OCR API for free.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
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.
Add Container OCR to Your Lovable.dev App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a Lovable.dev app. Build logistics and yard management tools with zero backend.
Manual TOS Entry vs. Container OCR Automation API
Analyzing the ROI and operational efficiency of replacing manual gate checkers with an automated Container OCR API in logistics yards.
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.
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.