Intermodal Rail OCR API for North America

Powering rail portals across the continent. Accurately extract ISO 6346 codes from fast-moving freight trains under challenging lighting. Upload your capture for a free accuracy test.

View of a shipping container loaded on an intermodal rail car, showing the extracted EMCU 850473 0 container number successfully scanned during movement.

The Complexity of Rail Portal Scanning

Capturing container codes on North America's vast intermodal rail networks presents extreme technical hurdles. Rail portal cameras must capture data from double-stacked containers on freight trains moving at high speeds, resulting in motion blur, varying vertical angles, and harsh shadows. Traditional systems fail to maintain high throughput and struggle to isolate text from the corrugated ribs of the container. For a deeper dive into overcoming these environmental hurdles, see our core Container OCR capabilities.

StructOCR: Built for High-Speed Rail Infrastructure

Engineered strictly as a high-performance REST API to ensure seamless integration into railway ERP systems without heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It natively processes multiple concurrent image streams and handles the varied angles typical of trackside portals. The engine applies strict ISO 6346 validation to verify the owner code and calculate the check digit, guaranteeing absolute data integrity.

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 →

Core Applications for North American Railways

High-Speed Rail Portals

Process inbound and outbound trains instantly. By identifying the ISO 6346 container code as the train passes the scanning portal, rail operators achieve seamless manifest verification. Ready to scale your operations? View flexible pricing, supporting frictionless international payments via cryptocurrency (USDT/USDC) or fiat through Paddle.

Intermodal Transfer Yards

Automate the handover between rail and truck. The API identifies containers as they are lifted by reach stackers, ensuring accurate tracking during the physical mode switch.

Double-Stack Container Verification

Deploy multi-camera setups to scan top and bottom containers simultaneously. The API's high concurrency capacity easily manages the dual-stream workload.

Automated Damage Inspection Sync

Link the precise container ID extracted by the API with high-resolution rail portal damage inspection images to create an indisputable digital audit trail.

Technical Specs

  • Validation: Built-in ISO 6346 checksum verification eliminates manual typing errors.
  • North American Edge Optimization: Infrastructure is routed through Cloudflare's global edge network (bypassing slow Vercel cold starts), providing ultra-low t1/t2 latency crucial for fast-moving rail applications.
  • Rotation Invariance: Native support for varied angles, ensuring accuracy whether the camera is mounted trackside or overhead.
  • Input Versatility: Fully supports raw Base64 strings and direct multipart file uploads, ideal for closed-circuit rail network security systems.

Key Features

  • ISO 6346 Parsing: Perfectly isolates the 3-letter Owner Code (BIC), 1-letter Equipment Category, 6-digit Serial Number, and 1-digit Check Digit.
  • Harsh Environment Tolerance: Advanced filtering mitigates deep shadows from corrugated metal, rust, and the physical distance required for safe trackside camera mounting.
  • High-Concurrency Scalability: Processes massive bursts of API requests simultaneously as 100+ car freight trains pass through automated scanning portals.

Integration & AI Prompts

Call the endpoint directly via HTTP. The API flexibly accepts standard image URLs, direct multipart file uploads, or Base64-encoded strings to minimize network latency on edge networks.

import requests
import base64

# Prepare Base64 Image from high-speed rail portal capture
with open("rail_portal_track4.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 Moving Train Capture...")
    response = requests.post(url, headers=headers, json=payload)
    result = response.json()

    if result.get('success'):
        data = result['data']['parsed']
        print("✅ Rail Container Code Extracted!")
        print(f"Full Number:  {data.get('owner_code')}{data.get('category')}{data.get('serial_number')}-{data.get('check_digit')}")
    else:
        print(f"❌ Extraction Failed: {result.get('message')}")
except Exception as e:
    print(f"An error occurred: {e}")

Standardized JSON Output

The API returns a cleanly parsed payload breaking down the ISO 6346 components, validating the check digit, and providing a structural confidence score.

{
  "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 I test the API with my own rail images for free before subscribing?

Yes! You can utilize our free image test directly on the platform to upload your own challenging trackside captures (via direct file upload or URL) and instantly see the accuracy of our extraction engine.

Can we upload images directly from our local rail systems instead of using URLs?

Yes. The API is designed to integrate cleanly with local systems, natively accepting both direct file uploads and Base64-encoded strings, avoiding the need to host sensitive rail images on public networks.

Can international logistics providers pay for the API seamlessly?

Absolutely. Alongside standard fiat options, our payment infrastructure natively accepts cryptocurrency settlements (USDT/USDC) to bypass cross-border friction for global intermodal operations.

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