Add Container OCR to Your Bolt.new App in 5 Minutes
Bolt.new scaffolds your full-stack UI. StructOCR reads the corrugated steel. Here's the exact prompt and API call to wire them together — right in your browser.

Why Bolt.new + StructOCR is a natural fit for Logistics Apps
Bolt.new generates and runs full-stack web applications directly in your browser. It handles the UI, components, and package management automatically — but extracting an 11-character ISO container number from rusted, corrugated steel doors is something you have to wire up yourself. StructOCR fills exactly that gap: one API call, structured JSON back. Tell Bolt what you want, paste in the fetch code below, and your yard management app is ready.
The problem: Standard AI can't read vertical text on rusted steel
Tools like Bolt.new are remarkable at generating apps instantly — but they stop at the file boundary. You can build a beautiful freight tracking interface in minutes, yet the actual extraction of an 11-character container number from vertically stacked text on corrugated steel doors requires a dedicated Container OCR API. Standard vision models routinely fail to read text split across metal ridges or stacked top-to-bottom.
The solution: ISO 6346 precision, instantly
StructOCR's /v1/container endpoint accepts a photo and returns a clean JSON object with the validated ISO 6346 container number, instantly decoding the owner prefix, category, and check digit. Because it speaks plain HTTP, Bolt.new can wire it up from a single fetch call without heavy backend dependencies.
Integrate StructOCR in Bolt.new (3 Steps)
Create a Bolt.new project and describe your app
Open bolt.new and start a new prompt. Describe the logistics tool you want to build — be specific about the scanning interface.
Try this prompt: "Build a mobile-friendly yard management app. Users can upload a photo of shipping container doors, and the app will display the extracted container number, owner code, and check digit."Tell Bolt to call the StructOCR API
Once Bolt scaffolds the UI, paste the follow-up prompt below. Bolt will write the fetch call, handle the file upload, and wire the response to your UI components in its in-browser editor.
Follow-up prompt: "When a user uploads an image, send it as a multipart/form-data POST to https://api.structocr.com/v1/container with an Authorization header containing my API key. Display the returned JSON fields in the results panel."// Bolt generates something like this — you just supply the key in .env const response = await fetch('https://api.structocr.com/v1/container', { method: 'POST', headers: { Authorization: `Bearer ${import.meta.env.VITE_STRUCTOCR_KEY}` }, body: formData, });Add your StructOCR API key to your environment
In the Bolt.new file explorer, create or open the .env file to securely add your StructOCR key. The app will automatically reload with your live scanner.
Variable name: VITE_STRUCTOCR_KEY — get your free key at structocr.com/dashboardVITE_STRUCTOCR_KEY=sk_live_xxxxxxxxxxxxxxxx
What you can build in Bolt.new with this integration
- Gate automation app: Let truck drivers or gate inspectors snap a photo of the container to automatically log the entry/exit time and verify the container number against the manifest.
- Yard management system (YMS): Build a mobile app for yard jockeys to scan container numbers and update parking slot locations in real-time. A core feature of modern logistics automation.
- Freight forwarding tracker: Create a tool where warehouse staff scan containers during loading/unloading to generate instant status updates for end-customers.
- Damage inspection portal: Add an upload step to a container inspection flow: extract the container number automatically from the damage photos to link the evidence to the correct asset.
The prompt and the code
Copy the follow-up prompt into your Bolt.new chat to generate the integration. The code block shows what Bolt typically produces — useful if you want to verify or tweak it.
Prerequisite: A free StructOCR account — get your API key at structocr.com/dashboard (no credit card required)
I need to add shipping container OCR to this app.
When a user uploads an image:
1. Send it as multipart/form-data to: POST https://api.structocr.com/v1/container
2. Include the header: Authorization: Bearer ${VITE_STRUCTOCR_KEY}
3. The response is JSON with fields: data.container_number, data.is_valid, data.parsed.owner_code, data.parsed.check_digit
4. Display the extracted container number and the decoded parts in the results panel
5. Show a loading spinner while the request is in flight
6. Show an error message if the upload fails
Use the environment variable VITE_STRUCTOCR_KEY for the API key.What the API returns
Not just the raw string—the API automatically validates the check digit and breaks down the components. Your Bolt.new app can bind this directly to the UI components.
{
"success": true,
"data": {
"container_number": "ZCSU8921655",
"is_valid": true,
"confidence": "High",
"parsed": {
"owner_code": "ZCS",
"category": "U",
"serial_number": "892165",
"check_digit": "5"
}
}
}Technical Specs
- Formats accepted: PNG, JPG, WEBP — optimized for yard and port mobile photos
- Response time: typically under 1 second
- Condition handling: robust against rust, dirt, corrugated shadows, and nighttime yard lighting
- Algorithm checks: built-in ISO 6346 Check Digit validation to ensure absolute accuracy
- Layout support: reads text printed horizontally, vertically, or stacked
Key Features
- ISO 6346 Decoding: automatically parses the 11-character string into Owner Code, Category, Serial, and Check Digit
- Checksum validation: mathematically verifies the container number to eliminate OCR misreads (like confusing '0' and 'O')
- Multi-angle support: reads numbers skewed or taken from extreme angles while the truck is moving
- Edge computing ready: lightweight API payload designed for fast connectivity in rural yards or ports with poor cellular service
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
Frequently Asked Questions
Does StructOCR work inside a Bolt.new app?
Where should I store the StructOCR API key in Bolt.new?
Can it read container numbers written vertically?
How does the API prevent misreads on rusty containers?
How can I test the accuracy before building?
Is there a free tier to test with?
More Tutorials
Add Driver's License OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Driver's License scanner API into a Bolt.new app. Build car rental and mobility onboarding flows right in your browser.
Add HIN OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR HIN (Hull Identification Number) scanner API into a Bolt.new app. Build marine and boat management tools right in your browser.
Add National ID OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR National ID scanner API into a Bolt.new app. Build KYC and identity verification flows right in your browser.
Add Passport OCR to Your Bolt.new App in 5 Minutes
Step-by-step guide to integrating the StructOCR Passport scanner API into a Bolt.new app. Build travel, hospitality, and global KYC flows right in your browser.
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