The Best Node.js Library for Shipping Container OCR
Stop using regex. Extract structured data from Shipping Containers with 99% accuracy using Node.js.

The Problem with Shipping Container Parsing
Shipping container parsing is notoriously difficult. Challenges include container numbers printed vertically, extreme rust and wear, skewed angles from terminal cameras, low-light conditions, and physical damage. Traditional methods relying on regex or standard text recognition libraries fail to handle these severe environmental variations, resulting in low accuracy and automated gate bottlenecks.
The StructOCR Solution
StructOCR leverages advanced AI and deep learning models specifically trained on shipping container data, offering a robust ISO 6346 compliant extraction. Our solution automatically deskews images, isolates the container ID, and intelligently extracts data, even from challenging vertical text, to optimize logistics workflows. We handle rust, glare, and non-standard layouts with ease, returning validated JSON in seconds.
Common Use Cases
- Terminal Automation: Speed up gate operations and yard management by instantly capturing container numbers.
- Customs & Compliance: Automate cross-border document verification and manifesting.
- Asset Tracking: Monitor shipping container movements across the global supply chain with real-time data.
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
Implementation: Using the SDK
Complete, runnable Node.js code to extract data from a Shipping Container.
Prerequisite: npm install structocr
// 💰 Save 30%+ vs competitors. Get 200 free credits instantly:
// 👉 https://structocr.com/register
const StructOCR = require('structocr');
async function scanShippingContainer(imagePath) {
// Initialize the SDK with your API Key
const client = new StructOCR('YOUR_API_KEY');
try {
console.log(`Scanning container image: ${imagePath}...`);
// The SDK handles file reading and API communication
const result = await client.scanContainer(imagePath);
if (result.success) {
console.log('✅ Extraction Successful!\n');
const { data } = result;
console.log('Container Number:', data.container_number);
console.log('Is Valid (ISO 6346):', data.is_valid);
console.log('Confidence:', data.confidence, '\n');
const parsed = data.parsed;
console.log('--- Parsed Details ---');
console.log('Owner Code:', parsed.owner_code);
console.log('Category:', parsed.category);
console.log('Serial Number:', parsed.serial_number);
console.log('Check Digit:', parsed.check_digit);
} else {
console.error('❌ Extraction Failed:', result.error);
}
} catch (error) {
console.error('SDK Error:', error.message);
if (error.cause) {
console.error('Underlying Error:', error.cause);
}
}
}
// Example usage:
scanShippingContainer('path/to/your/container_image.jpg');Technical Specs
- •Latency: < 4s (Average)
- •Uptime: 99.9% SLA
- •Security: AES-256 Encryption & SOC2 Compliant
- •Input: JPG, PNG, WebP (Max 4.5MB)
- •Output: JSON (Structured Data)
Key Features
- •Smart Crop: Auto-detects container boundaries.
- •ISO 6346 Validation: Cross-validates owner codes and checksums automatically.
- •Specialized Models: Trained specifically on vertical and degraded Shipping Container text.
Sample JSON Response
The API returns a clean JSON object with normalized, parsed container fields.
{
"success": true,
"data": {
"container_number": "TTNU5194822",
"is_valid": true,
"confidence": "High",
"parsed": {
"owner_code": "TTN",
"category": "U",
"serial_number": "519482",
"check_digit": "2"
}
}
}Frequently Asked Questions
What file formats are supported?
JPG, PNG, and WebP images up to 4.5MB.
Is data stored?
No. Images are processed in-memory and deleted immediately.
How to handle errors?
Check the 'success' flag and 'error' message in the response.
You May Also Like
Related tutorials, platform guides, and comparisons
Python Shipping Container OCR API
Tutorial: Learn how to use the StructOCR Python SDK for shipping container OCR. Upload an image for a free test! Extract ISO 6346 container numbers with 99% accuracy. Includes code samples and JSON schemas.
C# Shipping Container OCR API
Upload an image for a free test! Tutorial: Learn how to use the StructOCR C# Client to extract data from Shipping Containers. Extract ISO 6346 container numbers with 99% accuracy. Includes code samples and JSON schemas.
PHP Shipping Container OCR API
Tutorial: Learn how to use the StructOCR PHP Client via cURL for shipping container OCR. Upload an image for a free test! Extract ISO 6346 container numbers with 99% accuracy. Includes code samples and JSON schemas.
Java Shipping Container OCR API
Upload an image for a free test! Tutorial: Learn how to use the StructOCR Java Client to extract data from Shipping Containers. Extract ISO 6346 container numbers with 99% accuracy.
Go Shipping Container OCR API
Upload an image for a free test! Tutorial: Learn how to use the StructOCR Go Client to extract data from Shipping Containers. Extract ISO 6346 container numbers with 99% accuracy. Includes code samples and JSON schema.
Kenya Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Kenya passports.
Kazakhstan Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Kazakhstan passports.
Canada Passport OCR with Node.js SDK
Use the official StructOCR Node.js SDK with TypeScript and Express to extract structured MRZ and VIZ data from Canada passports.
Kazakhstan Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Kazakhstan passports with a server-side integration.
Kenya Passport OCR with Python SDK
Use the official StructOCR Python SDK and FastAPI to extract structured MRZ and VIZ data from Kenya passports with a server-side integration.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
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.
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.
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.