Skip to main content

StructOCR Python SDK

PyPI version License: MIT

The official Python client for StructOCR.

StructOCR is a powerful API tailored for developers to extract structured data from complex documents and physical assets with high accuracy. This SDK helps you integrate Passport OCR, National ID OCR, Driver License OCR, Invoice OCR, Receipt OCR, VIN OCR, HIN OCR, Container OCR, and License Plate OCR into your Python applications in minutes.

👉 Get your Free API Key here


🚀 What's New in 1.4.0

  • License Plate OCR: We've launched a specialized ALPR engine optimized for SEA plates. It accurately extracts native scripts (Thai, Khmer, etc.), plate numbers, colors, and vehicle types without forcing foreign formatting rules.
  • Previous updates (Hybrid VIZ + MRZ AI for National IDs, marine & expense additions) remain fully supported.

Check out the Quick Start below to see how easy it is to use them!


Features

  • Passport OCR API: Instantly extract MRZ, name, DOB, and expiry date from passports of 200+ countries.
  • National ID OCR: Extract regional specific fields (CNP, CPF, NIN) and raw ICAO 9303 MRZ lines with hybrid validation.
  • Driver License OCR: Extract vehicle class, license number, and personal details.
  • License Plate OCR: Extract SEA-optimized plate numbers, regional texts, plate colors, and vehicle types.
  • Invoice OCR: Extract invoice number, currency, merchant, customer, and financial totals.
  • Receipt OCR: Extract merchants, dates, line items, taxes, and totals for expense management.
  • VIN OCR: Extract VIN (Vehicle Identification Number) from windshield or engine bay images.
  • HIN OCR: Validate and extract Hull Identification Numbers from marine vessels.
  • Container OCR: Extract shipping container numbers accurately from images.
  • Secure & Fast: Enterprise-grade encryption, SOC2 compliance, and sub-second response times with zero data retention.

Installation

Install the package via pip:

pip install structocr

Quick Start

1. Initialize the Client

from structocr import StructOCR

# Initialize with your API Key
client = StructOCR(api_key="sk_live_xxxxxxxx")

2. Scan a Passport (Passport OCR)

# Pass the path to the passport image file
result = client.scan_passport('./docs/passport_sample.jpg')

print(f"Name: {result['data']['name']}")
print(f"Passport Number: {result['data']['document_number']}")

3. Scan Other Documents and Assets

# License Plate OCR (New in 1.4.0)
plate_data = client.scan_license_plate('./docs/license_plate.jpg')

# National ID OCR
id_data = client.scan_national_id('./docs/id_card.png')

# Driver License OCR
license_data = client.scan_driver_license('./docs/license.jpg')

# Invoice OCR
invoice_data = client.scan_invoice('./docs/invoice.jpg')

# Receipt OCR
receipt_data = client.scan_receipt('./docs/receipt.jpg')

# VIN OCR
vin_data = client.scan_vin('./docs/vin.jpg')

# HIN OCR
hin_data = client.scan_hin('./docs/boat_hin.jpg')

# Container OCR
container_data = client.scan_container('./docs/container.jpg')

Documentation

For full API documentation, response examples, and error codes, please visit the StructOCR Developer Docs.

Requirements

  • Python 3.7+
  • requests library

License

MIT License. See LICENSE for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

structocr-1.4.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structocr-1.4.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file structocr-1.4.0.tar.gz.

File metadata

  • Download URL: structocr-1.4.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for structocr-1.4.0.tar.gz
Algorithm Hash digest
SHA256 9def2fec1746f6805b072b001fa990944d7a24ee8023653d4b46c437b9226519
MD5 3dd5aece97361a18e82d8a48d3adf721
BLAKE2b-256 6801a7b31c3ea034a8d31a16047ea095810e69cb4abe04e156acd23daf7cfb92

See more details on using hashes here.

File details

Details for the file structocr-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: structocr-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.9

File hashes

Hashes for structocr-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 962eab5150b6d7f4e4953524e5dbb0fb74001e14d24d59ab2be344dcfd2c6b94
MD5 58bb29160f335149ed679c881d69d4d7
BLAKE2b-256 24a01f68504e948395c49074056a5e5cf8670a7ab28ee867d514375a61f22803

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page