Truck Gate Check-In API: Container Number + License Plate

Read the container number and the truck plate from the photos your gate already takes, check both against the pre-advice, and only stop the trucks that don't match.

200 free credits = 200 Container scans, no credit card. Then from $5 for 500 credits, pay as you go. See pricing

Gate photo of a container read into a container number and validity flag.

Two Numbers per Truck, Typed by Hand

At depot, ICD and terminal gates, every truck needs two identifiers recorded: the container it carries and the truck's own license plate. Clerks or drivers usually type both into the gate system, which slows the queue and lets typos into the gate-in and gate-out records.

Two API Calls, One Gate Transaction

Send the photo of the container doors or side to the Container OCR API and the photo of the truck's front or rear to the License Plate OCR API. The container response says whether the number passes the ISO 6346 check digit (is_valid); the plate response returns the plate as printed and normalized. Match both against the pre-advice or booking, and send only mismatches to the gate clerk. For camera setups that crop the number region, see the gate camera integration.

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 · PDF · TIFF  ·  up to 500 files · max 4.5 MB each

No document handy?

No files selected
Need more testing? Create a free account to get 200 free credits (equals 200 Container scans).

Where It Fits

Empty Depots

Record gate-in and gate-out of empty containers with the truck that brought or collected them.

ICDs and Dry Ports

Match arriving trucks and containers against the pre-advice before the truck enters the yard.

Warehouses Receiving Containers

Confirm the right container arrived on the expected truck before unloading starts.

Haulier Dispatch

Log which truck moved which container for billing and proof of delivery.

Technical Specs

  • Endpoints: POST https://api.structocr.com/v1/container and POST https://api.structocr.com/v1/license-plate
  • Input: JPG, PNG, WebP or PDF up to 4.5 MB per image, as Base64 JSON or multipart upload
  • Price: 1 credit per container scan and 1 credit per plate scan, so 2 credits per truck. New accounts get 200 free credits; packs run from $5 for 500 credits to $99 for 17,000 credits, with no subscription
  • Retention: Images and results are kept for at most 24 hours for quality spot-checks, then deleted

Key Features

  • Check-digit validation: is_valid tells you whether the container number passes the ISO 6346 check digit, so misreads are caught before they reach the gate record.
  • Plates as printed and normalized: plate_number keeps the characters as printed, including local scripts; plate_number_normalized strips spaces and punctuation for matching.
  • Any camera or phone: full photos or cropped regions both work, from fixed gate cameras or a clerk's phone.

Gate Check-In in Python

Both calls run in parallel, so the check-in takes about as long as one scan. The same endpoints work from Java, .NET or Node.js; see the container API reference and the license plate API reference.

import base64, os, requests
from concurrent.futures import ThreadPoolExecutor

API = "https://api.structocr.com/v1"
HEADERS = {"x-api-key": os.environ["STRUCTOCR_API_KEY"]}

def scan(endpoint, path):
    with open(path, "rb") as f:
        img = base64.b64encode(f.read()).decode()
    r = requests.post(f"{API}/{endpoint}", headers=HEADERS, json={"img": img}, timeout=30)
    r.raise_for_status()
    return r.json()["data"]

def check_in(container_photo, truck_photo, expected):
    with ThreadPoolExecutor() as pool:
        box = pool.submit(scan, "container", container_photo)
        truck = pool.submit(scan, "license-plate", truck_photo)
        box, truck = box.result(), truck.result()

    container = box["container_number"] if box["is_valid"] else None
    plates = [p["plate_number_normalized"] for p in truck.get("plates", [])]

    if container == expected["container"] and expected["plate"] in plates:
        return "gate in", container
    return "send to clerk", {"container": box["container_number"], "plates": plates}

print(check_in("container.jpg", "truck.jpg", {"container": "SOCU7345122", "plate": "701234"}))

Standardized JSON Output

An illustrative container response; the license plate endpoint returns a plates list alongside it.

{
  "success": true,
  "data": {
    "container_number": "SOCU7345122",
    "is_valid": true,
    "confidence": "High",
    "parsed": {
      "owner_code": "SOC",
      "category": "U",
      "serial_number": "734512",
      "check_digit": "2"
    }
  }
}

Frequently Asked Questions

Can one photo give both the container number and the plate?

Each endpoint reads one kind of number, so send the same photo to both, or one photo of the container and one of the truck. Separate photos usually give clearer reads, because the plate and the container number are rarely both sharp in one frame.

What happens when the container number fails the check digit?

The response sets is_valid to false and still returns the number it read. Route it to a clerk, compare it with the expected container, or take another photo. The free container check digit calculator shows likely corrections.

Can I test it for free?

Yes. Try a container photo in the live demo on this page without an account, or sign up for 200 free credits, enough for 100 trucks with both scans.

Does it read the driver's ID as well?

Yes, as a third call: the National ID and Driver License OCR APIs read the driver's card if your gate process records it.

Explore More Container Solutions

SOLUTION

Intermodal Rail OCR API North America

Automate high-speed intermodal rail scanning across North America. Extract container numbers from moving trains natively. Upload your image for a free test.

Container
SOLUTION

ISO 6346 OCR API

Parse and validate ISO 6346 container codes with our high-accuracy OCR API. Upload images to test extraction and automatic check-digit calculation for free.

Container
SOLUTION

Shipping Container Number Scanner API

Looking for a shipping container number scanner? Turn any mobile device or CCTV camera into an industrial container scanner via our REST API. Upload an image for a free test.

Container
SOLUTION

BIC Code OCR API

Extract BIC Owner Codes from shipping containers instantly. Upload your images to test our high-accuracy BIC Code OCR API for free and automate equipment tracking.

Container
SOLUTION

How to Build a Container Recognition Scanner

Step-by-step developer guide on how to build a custom container recognition scanner using a lightweight API. Test your image payloads for free today.

Container
SOLUTION

Container Check Digit Calculator API

Automate container check digit calculation with our high-accuracy OCR API. Upload images to test ISO 6346 validation for free and prevent manual data entry errors.

Container
SOLUTION

Container Code Reader Software Integration

Integrate industrial container code reader software into your TOS or WMS via a lightweight REST API. Upload your images for a free accuracy test today.

Container
SOLUTION

Container Code Recognition API for Gate & Crane Cameras

Send cropped container-number images or full frames from gate, crane and rail cameras and get the ISO 6346 container number with check-digit validation as JSON. Java and Python examples, 200 free scans.

Container
SOLUTION

Container OCR API Canada

High-accuracy ISO 6346 container number extraction built for extreme Canadian weather. Overcome snow, ice, and glare. Upload an image for a free test today.

Container
SOLUTION

Container OCR API for Crane Tally

Automate crane tally operations with our Container OCR API. Upload STS or RTG crane camera captures to test our ISO 6346 extraction for free. Handles 180-degree rotations effortlessly.

Container

Technical Comparisons & Integrations

Explore platform integrations and competitive analysis

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.

Instant Access Cancel Anytime No Credit Card