Railway Portals: Container OCR API

Track intermodal freight at full speed. Upload your local trackside captures to test our extraction accuracy for free, effortlessly handling motion blur and stacked well cars.

Freight train passing through a trackside scanning portal with the container ISO code extracted in real-time, accompanied by a free test upload button.

The Speed and Motion Blur Bottleneck

Capturing container codes on moving freight trains presents severe optical challenges. As intermodal trains pass through trackside portals at speed, cameras suffer from significant motion blur and rolling shutter effects. Additionally, double-stacked well-cars create complex visual backgrounds. Standard OCR fails to keep up with the continuous frame rate, causing missing data in your railway manifest. 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.

High-Speed Extraction via Edge API

Delivered strictly as a high-throughput REST API to ensure seamless integration into any railway portal system without heavy SDK dependencies, this endpoint is powered by our Logistics Container OCR engine. It utilizes advanced deep-learning filters specifically tuned to reconstruct characters distorted by motion blur. The engine applies strict ISO 6346 validation on the fly, instantly calculating check digits to guarantee perfect data integrity before passing the railcar manifest to your intermodal operating system.

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 →

Railway & Intermodal Scenarios

High-Speed Portal Scanning

Process inbound and outbound trains without slowing them down. Accurately identify ISO 6346 container codes at track speeds up to 60 km/h. Ready to scale your rail network? View flexible pricing to secure maximum processing limits for continuous video frame extraction.

Double-Stack Well Car Tracking

Natively handle complex railcar configurations. The API perfectly isolates text from both top and bottom containers without confusing the sequences.

Rail Yard Inventory Management

Automatically reconcile physical train arrivals with digital EDI manifests, instantly flagging missing or unexpected containers on the consist.

Customs & Border Crossings

Accelerate cross-border freight rail clearance by transmitting perfectly validated container sequences to customs authorities before the train even stops.

Technical Specs

  • Motion Tolerance: Algorithms specifically tuned to mitigate severe motion blur and rolling shutter effects from high-speed trains passing trackside scanners.
  • High-Throughput Concurrency: Robust architecture supports continuous burst API calls from multiple trackside cameras capturing a fast-moving train without throttling.
  • Input Versatility: Fully supports raw Base64 strings, direct multipart file uploads, and public image URLs—ideal for offline-first edge servers on the railway network.
  • Error Correction: Built-in ISO 6346 checksum verification acts as a powerful error-correction tool to mathematically verify codes distorted by speed.

Key Features

  • Free Image Testing: Instantly upload highly blurred images from your actual train portals to test extraction accuracy before writing any integration code.
  • Standardized Output: Returns a unified `container_number` string while perfectly isolating the 3-letter Owner Code, 1-letter Category, 6-digit Serial, and Check Digit in a parsed object.
  • Stack Separation: Advanced visual parsing cleanly separates text from double-stacked well cars, ensuring containers are assigned to the correct tier.

Integration & AI Prompts

Call the endpoint directly via HTTP. The API flexibly accepts standard image URLs, direct multipart file uploads, or Base64-encoded strings, making it perfect for edge-computing gateways installed trackside.

import requests
import base64

# Prepare Base64 Image from trackside portal camera
with open("train_portal_cam_3.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 Railway 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.

{
  "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 images from our trackside cameras for free?

Absolutely. You can upload photos directly on our platform to test how the OCR engine handles your specific motion blur, lighting, and camera angles completely free of charge.

How does the API handle the motion blur of moving trains?

We utilize specialized deep-learning models trained specifically on high-speed vehicular captures, allowing the engine to reconstruct and read characters that appear stretched or blurred to the human eye.

Do we need to expose our rail portal images to public URLs?

No. The API natively accepts direct file uploads and Base64-encoded strings directly from your local edge servers or trackside gateways, ensuring sensitive freight data remains secure.

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