Intermodal Rail: Container OCR API

Seamlessly track containers transferring between trains and trucks. Upload your local rail terminal captures to test our extraction accuracy for free, perfectly handling double-stacked well cars and moving freight.

Reach stacker transferring a shipping container to an intermodal railcar, with the StructOCR API extracting the ISO code, featuring a free test upload button.

The Friction at the Rail-Road Handover

Intermodal terminals are fast-paced hubs where supply chain velocity is critical. Moving containers from trains to trucks involves high-speed gantry cranes and reach stackers. When terminal operators rely on manual spotters to read container numbers, it creates dangerous bottlenecks and delays train departures. Furthermore, extreme outdoor lighting, motion blur from passing railcars, and complex double-stacked configurations cause standard OCR systems to fail entirely. To see how our engine cuts through these extreme dynamic challenges, you can upload a test image to explore our core Container OCR capabilities completely free.

A High-Speed API for Rail Operations

Delivered strictly as a lightweight REST API to ensure seamless integration into any Intermodal Terminal Operating System (ITOS) without the bloat of heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It provides instant, automated verification across the rail yard. The engine applies strict ISO 6346 validation on the fly, instantly calculating check digits to guarantee that only perfectly accurate Container Codes update your digital train manifests and truck dispatch logs.

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 →

Intermodal Terminal Scenarios

Rail-to-Truck Transfer Automation

Instantly verify containers as they are lifted from railcars to chassis, completely preventing incorrect loading and misrouted freight. Ready to scale your intermodal network globally? View flexible pricing to secure maximum processing limits using modern payment rails like USDT/USDC.

Double-Stack Well Car Parsing

Natively handle complex train configurations. The API accurately separates and reads ISO codes from both top and bottom containers on double-stack trains without confusing the sequence.

Trackside Arrival Gateways

Scan inbound and outbound trains at track speed as they pass through the terminal gateway, automatically reconciling the physical consist against electronic data interchange (EDI) records.

Gantry Crane Synchronization

Deploy automated cameras directly on rail-mounted gantry (RMG) cranes to continuously track the exact track and spot position of every container lifted.

Technical Specs

  • Edge Optimization: Deployed purely on Cloudflare's global edge network, ensuring ultra-low t1/t2 latency to process fast-moving trains without throttling.
  • Input Versatility: Fully supports raw Base64 strings and direct multipart file uploads—ideal for edge gateways and IoT devices installed directly at the rail yard.
  • Validation: Built-in ISO 6346 checksum verification mathematically guarantees data accuracy before matching it to the rail EDI manifest.
  • Stack & Blur Tolerance: Advanced algorithms natively isolate characters from stacked containers and mitigate the motion blur of continuous rail movement.

Key Features

  • Free Image Testing: Instantly upload highly obscured images from your actual intermodal facility to test extraction accuracy before deploying the API across your tracks.
  • 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 legacy rail tracking systems and modern ITOS.

Integration & AI Prompts

Call the endpoint directly via HTTP from your intermodal management software or trackside edge devices. To maintain strict operational security, the API flexibly accepts direct multipart file uploads or Base64-encoded strings, avoiding the need to expose local rail cameras to public URLs.

import requests
import base64

# Prepare Base64 Image from an intermodal trackside camera
with open("intermodal_transfer_cam.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 Intermodal 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 intermodal 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 intermodal rail yard before integrating it?

Absolutely. You can upload images directly on our platform to test how the OCR engine handles your specific camera angles, double-stacked cars, and train speeds completely free of charge.

How does the API handle double-stacked containers on well cars?

Our visual parsing algorithms are trained on complex rail configurations, cleanly separating text from both the top and bottom containers to ensure they are read distinctly and accurately.

Do we need to expose sensitive trackside camera feeds to public URLs?

No. The API natively accepts direct file uploads and Base64-encoded strings directly from your secure network or edge devices, ensuring full operational privacy.

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