# StructOCR — Complete API & Platform Reference (llms-full.txt) > Official machine-readable documentation for StructOCR (`https://structocr.com`). > All endpoints, credit prices, request formats, and data retention policies below are verified directly against production code. ## 1. Platform Overview StructOCR provides specialized REST OCR APIs and browser-based Web Tools that turn raw images and PDFs into schema-validated JSON and spreadsheet tables. - **Website**: `https://structocr.com` - **API Base URL**: `https://api.structocr.com` - **OpenAPI 3.1 Spec**: `https://structocr.com/openapi.json` - **Concise Index**: `https://structocr.com/llms.txt` - **Authentication**: Pass your API key in the `x-api-key` HTTP request header. - **Credit Model**: Unified pay-as-you-go credit wallet shared across REST API and Web Tools. Credits never expire. No monthly subscription is required. New accounts receive 200 free credits on signup (no credit card required). - **Billing Guarantee**: Credits are charged only for successful `200 OK` extractions. Failed requests (4xx/5xx, unreadable barcodes, timeouts) are not billed or are automatically refunded. ## 2. Pricing, Credit Packs & Cost per 1,000 Scans (USD) | Pack | Price (USD) | Credits Included | Effective Cost / Credit | Notes | |---|---:|---:|---:|---| | Developer (Free) | $0 | 200 | $0.0000 | Included on signup with no credit card required; full access to all APIs and Web Tools. | | Mini | $5 | 500 | $0.0100 | Non-expiring pay-as-you-go pack for evaluation and light workloads. | | Starter | $15 | 1,800 | $0.0083 | 1,500 base + 300 bonus credits. Never expires. | | Business | $29 | 4,000 | $0.0073 | 2,900 base + 1,100 bonus credits. Never expires. | | Pro | $99 | 17,000 | $0.0058 | 9,900 base + 7,100 bonus credits. Best self-serve volume rate; never expires. | | Enterprise | Custom | Custom | Custom | High-volume custom pricing, dedicated support, and optional custom SLA. | ### Transparent Cost per 1,000 Scans / Pages (No Monthly Subscription) | Endpoint Tier | Credits | Cost / Scan (Pro – Mini) | Cost / 1,000 Scans (USD) | Covered Endpoints | |---|---:|---:|---:|---| | Standard (1 credit) | 1 | $0.0058 – $0.0100 | **$5.82 – $10.00** | Standard Receipt, VIN, Container (ISO 6346), License Plate, Marine HIN, ATM Cassette | | Advanced (2 credits) | 2 | $0.0116 – $0.0200 | **$11.65 – $20.00** | PDF Extract (per succeeded page, Zero Retention), Image to Excel (Zero Retention), Passport, National ID, Driver License, PDF417 (Zero Retention), Health Card (Zero Retention), Visa (Zero Retention), Proof of Address (Zero Retention), Vehicle Registration, Auto Insurance, Weighbridge Ticket, VIN Pro, Enhanced Receipt | | Complex (3 credits) | 3 | $0.0175 – $0.0300 | **$17.47 – $30.00** | Multi-Page PDF Invoice (up to 5 pages), Bill of Lading / Air Waybill | | Verification (4 credits) | 4 | $0.0233 – $0.0400 | **$23.29 – $40.00** | US/Canada Driver License Front + Back PDF417 Verify (Zero Retention, 422 auto-refund) | Payment methods: Credit/Debit Card (Paddle; localized billing in USD, EUR, GBP, CAD, AUD) and Cryptocurrency (USDT/USDC on BSC and Polygon, which automatically receive a 10% credit bonus, lowering 1-credit Pro scans to ~$5.29/1,000). ## 3. Data Privacy & Strict Zero Data Retention All API traffic is encrypted in transit with TLS 1.3. - **Strict Zero Data Retention endpoints** (request images/PDFs are never written to audit storage, extracted JSON payloads are never saved in `usage_logs` or `tool_scan_logs`, and error diagnostics omit document text snippets): - `POST /v1/driver-license-pdf417` (Driver License PDF417 Barcode API) - `POST /v1/driver-license-verify` (Driver License Front + Back Verification API) - `POST /v1/visa` (Travel Visa OCR) - `POST /v1/proof-of-address` (Proof of Address OCR) - `POST /v1/health-card` (Health Insurance Card OCR) - `POST /v1/pdf-extract` (PDF Extract API (Tables, Key-Values & Custom JSON)) - `POST /v1/image-to-excel` (Image to Excel OCR API) - **Standard OCR endpoints**: Payloads may be retained for at most 24 hours for quality diagnostics before automatic deletion. ## 4. Authentication, Request Formats & Error Codes ### Authentication Every `/v1/*` request requires an active API key in the `x-api-key` header: ```http x-api-key: YOUR_API_KEY ``` ### Request Formats 1. **Standard single-document OCR endpoints** (e.g., `/v1/passport`, `/v1/national-id`, `/v1/vin`, `/v1/invoice`, `/v1/vehicle-registration`, `/v1/driver-license-pdf417`): - `multipart/form-data`: send binary image/PDF in field `file` (or `img`), up to **4.5MB**. - `application/json`: send `{ "img": "" }` (alias `image` also accepted), decoded binary up to **4.5MB**. 2. **PDF & Table Extraction endpoints** (`/v1/pdf-extract`, `/v1/image-to-excel`): - `multipart/form-data` only: send binary PDF/JPG/PNG/WebP in field `file`, up to **10MB**. - Optional form fields: `mode` (`auto` | `tables` | `json`), `pages` (e.g. `1-5` or `1,3,5`), `schema` (JSON string defining custom target fields), `stitch_tables` (`true` | `false`, default `true`). 3. **Dual-Image Driver License Verification** (`/v1/driver-license-verify`): - `multipart/form-data` with fields `front` and `back` (JPG, PNG, WebP, HEIC, HEIF; up to 4.5MB each) and optional `min_age` (integer 1-120). - Or `application/json` with `{ "front": "", "back": "", "min_age": 21 }` (aliases `front_image`, `back_image` accepted). ### Standard HTTP Status & Error Semantics - `200 OK`: Extraction succeeded (`{ "success": true, "data": { ... } }` for standard OCR/verify endpoints; `{ "success": true, "mode": ..., "document": ..., "pages": ..., "usage": ... }` for PDF/Image-to-Excel endpoints). - `400 Bad Request`: Malformed JSON/multipart payload, missing file, or invalid parameter (0 credits billed). - `401 Unauthorized`: Missing, invalid, or inactive `x-api-key` header (0 credits billed). - `402 Payment Required`: Insufficient credit balance (0 credits billed). - `413 Payload Too Large`: Uploaded file exceeds endpoint limit (4.5MB for standard endpoints, 10MB for PDF/Image-to-Excel). - `415 Unsupported Media Type`: Unsupported `Content-Type` or unsupported file format. - `422 Unprocessable Entity`: Valid image received but required barcode/document could not be read (e.g., unreadable PDF417 barcode; credits automatically refunded). - `500 / 502 / 503`: Transient upstream or processing error (credits automatically refunded). ## 5. Complete Public Endpoint Reference (23 Endpoints) ### Passport OCR — `POST https://api.structocr.com/v1/passport` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract structured passport bio-page fields and ICAO 9303 TD3 MRZ data with deterministic check-digit validation. - **Key Response Fields**: `document_type`, `issuing_country`, `passport_number`, `surname`, `given_names`, `nationality`, `date_of_birth`, `sex`, `date_of_expiry`, `personal_number`, `mrz_lines`, `mrz_valid` - **Note**: Supports 190+ countries and bilingual/non-Latin scripts (including Arabic, Cyrillic, CJK). - **Note**: Validates ICAO 9303 TD3 MRZ check digits deterministically. - **Documentation**: https://structocr.com/developers/passport-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/passport-scanner ### National ID OCR — `POST https://api.structocr.com/v1/national-id` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract structured fields from national ID cards worldwide including UAE Emirates ID, Saudi National ID / Iqama, Egypt National ID, EU eID / CIE, and TD1 MRZ cards. - **Key Response Fields**: `country_code`, `document_number`, `personal_number`, `surname`, `given_names`, `full_name_native`, `nationality`, `date_of_birth`, `sex`, `date_of_issue`, `date_of_expiry`, `address` - **Note**: Handles Arabic/English bilingual GCC cards (Emirates ID, Saudi Iqama/National ID) and Latin/non-Latin global IDs. - **Note**: Normalizes ISO dates (YYYY-MM-DD) and country codes. - **Documentation**: https://structocr.com/developers/national-id-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/id-card-scanner ### Driver License OCR — `POST https://api.structocr.com/v1/driver-license` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract visual front-side fields from global driver licenses across North America, Europe, UK, Australia, and GCC. - **Key Response Fields**: `country_code`, `region`, `document_number`, `surname`, `given_names`, `date_of_birth`, `date_of_issue`, `date_of_expiry`, `sex`, `address`, `vehicle_class`, `card_security_number` - **Note**: Extracts US/Canadian state codes, UK DVLA fields, EU numbered fields, and GCC Arabic/English licenses. - **Note**: Captures US Document Discriminator (DD) where printed on the card front. - **Documentation**: https://structocr.com/developers/driver-license-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/driver-license-scanner ### Driver License PDF417 Barcode API — `POST https://api.structocr.com/v1/driver-license-pdf417` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, HEIC, HEIF (up to 4.5MB) - **Summary**: Deterministic AAMVA PDF417 2D barcode decoder for US and Canadian driver licenses and state IDs with native iPhone HEIC/HEIF support and strict zero data retention. - **Key Response Fields**: `document_number`, `surname`, `first_name`, `middle_name`, `date_of_birth`, `date_of_issue`, `date_of_expiry`, `address`, `city`, `region`, `postal_code`, `document_discriminator`, `issuer_identification_number`, `aamva_version` - **Note**: Strict zero data retention: images and decoded barcode payloads are never stored on disk or in database logs. - **Note**: Native iPhone HEIC/HEIF support with EXIF orientation handling. - **Note**: Non-readable barcodes return HTTP 422 with automatic credit refund. - **Documentation**: https://structocr.com/developers/driver-license-pdf417 - **Interactive Browser Tool / Demo**: https://structocr.com/tools/driver-license-pdf417-scanner ### Driver License Front + Back Verification API — `POST https://api.structocr.com/v1/driver-license-verify` - **Category**: Identity & KYC - **Cost**: 4 credits — per verified request (full refund on 422 back-side failure) - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, HEIC, HEIF (up to 4.5MB per side) - **Summary**: Cross-check North American driver license front visual OCR against back AAMVA PDF417 barcode in a single zero-retention API call. - **Key Response Fields**: `verification.overall_status`, `verification.front_back_match`, `verification.dd_dcf_match`, `verification.is_expired`, `verification.is_over_18`, `verification.is_over_21`, `verification.age_years`, `verification.meets_min_age`, `verification.field_checks`, `front`, `back` - **Note**: Strict zero data retention on both images and response payloads. - **Note**: Serial short-circuit: decodes back PDF417 first; unreadable barcodes return HTTP 422 with full 4-credit refund. - **Note**: Deterministic front-vs-back checks across license number, name, DOB, expiry, state/province (63 US/CA jurisdictions), DD vs DCF, and optional min_age (1-120). - **Documentation**: https://structocr.com/developers/driver-license-verify - **Interactive Browser Tool / Demo**: https://structocr.com/solutions/driver-license-verification-api ### Travel Visa OCR — `POST https://api.structocr.com/v1/visa` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract visa sticker and e-visa fields with ICAO 9303 MRV-A and MRV-B check-digit verification and strict zero data retention. - **Key Response Fields**: `issuing_country`, `visa_type`, `visa_number`, `passport_number`, `surname`, `given_names`, `nationality`, `valid_from`, `valid_until`, `entries`, `duration_of_stay`, `mrz_valid` - **Note**: Strict zero data retention. - **Note**: Supports Schengen, US, UK, GCC, and global visa stickers with MRV-A/B validation. - **Documentation**: https://structocr.com/developers/visa-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/visa-scanner ### Proof of Address OCR — `POST https://api.structocr.com/v1/proof-of-address` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract resident name, issuer, document issue date, and normalized street address from utility bills, bank statements, and government letters for KYC onboarding. - **Key Response Fields**: `document_type`, `issuer_name`, `recipient_name`, `issue_date`, `full_address`, `street`, `city`, `state_or_region`, `postal_code`, `country_code` - **Note**: Strict zero data retention for KYC compliance. - **Note**: Designed for fintech, crypto exchange, and banking address freshness checks (e.g., within 90 days). - **Documentation**: https://structocr.com/developers/proof-of-address-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/proof-of-address-scanner ### Health Insurance Card OCR — `POST https://api.structocr.com/v1/health-card` - **Category**: Identity & KYC - **Cost**: 2 credits — per successful request - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract member ID, group number, payer name, RxBIN/PCN/RxGrp, and copay fields from medical and health insurance cards with strict zero data retention. - **Key Response Fields**: `payer_name`, `member_name`, `member_id`, `group_number`, `plan_name`, `rx_bin`, `rx_pcn`, `rx_group`, `effective_date`, `copays` - **Note**: Strict zero data retention: card images and PHI payloads are never stored on StructOCR infrastructure. - **Documentation**: https://structocr.com/developers/health-card-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/health-card-scanner ### PDF Extract API (Tables, Key-Values & Custom JSON) — `POST https://api.structocr.com/v1/pdf-extract` - **Category**: PDF & Tables - **Cost**: 2 credits — per succeeded page (failed pages automatically refunded) - **Data Retention**: Strict Zero Data Retention - **Input**: PDF, JPG, PNG, WebP via multipart/form-data (up to 10MB) - **Summary**: Zero-retention general-purpose PDF and scanned document extraction returning stitched multi-page tables, key-value fields, and optional custom JSON schema output. - **Key Response Fields**: `mode`, `document.summary`, `document.fields`, `document.tables`, `custom_data`, `pages`, `usage` - **Note**: Strict zero data retention. - **Note**: Supports mode=auto|tables|json, page selection (pages="1-5"), custom JSON schema, and cross-page table stitching (stitch_tables=true). - **Note**: Handles scanned PDFs, RTL Arabic and bilingual documents. - **Documentation**: https://structocr.com/developers/pdf-extract - **Interactive Browser Tool / Demo**: https://structocr.com/tools/pdf-table-extractor ### Image to Excel OCR API — `POST https://api.structocr.com/v1/image-to-excel` - **Category**: PDF & Tables - **Cost**: 2 credits — per succeeded image or PDF page (failed pages refunded) - **Data Retention**: Strict Zero Data Retention - **Input**: JPG, PNG, WebP, PDF via multipart/form-data (up to 10MB) - **Summary**: Zero-retention table extraction API optimized for converting photos, screenshots, and scanned documents into spreadsheet-ready structured tables (headers + rows). - **Key Response Fields**: `mode`, `document.summary`, `document.tables[].title`, `document.tables[].headers`, `document.tables[].rows`, `pages`, `usage` - **Note**: Defaults to mode=tables for clean row/column matrices ready for Excel (.xlsx), Google Sheets, or CSV export. - **Note**: Strict zero data retention; supports English, Arabic RTL, and bilingual tables. - **Note**: Includes an official importable n8n workflow template (/n8n/image-to-excel-ocr.json). - **Documentation**: https://structocr.com/developers/image-to-excel - **Interactive Browser Tool / Demo**: https://structocr.com/tools/image-to-excel ### Invoice OCR — `POST https://api.structocr.com/v1/invoice` - **Category**: Finance & Tax - **Cost**: 3 credits — per successful request (single image or multi-page PDF up to 5 pages) - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, multi-page PDF up to 5 pages (up to 4.5MB) - **Summary**: Extract vendor/buyer tax IDs, invoice metadata, VAT/tax totals, line items, and GCC ZATCA / UAE FTA VAT fields from single images or multi-page PDF invoices. - **Key Response Fields**: `invoice_number`, `invoice_date`, `due_date`, `currency`, `vendor_name`, `vendor_tax_id`, `customer_name`, `subtotal`, `tax_amount`, `total_amount`, `line_items` - **Note**: Native multi-page PDF extraction (up to 5 pages in a single 3-credit request). - **Note**: Includes GCC tax normalization for Saudi 15-digit ZATCA VAT numbers and UAE 15-digit TRN numbers. - **Documentation**: https://structocr.com/developers/invoice-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/invoice-scanner ### Receipt OCR — `POST https://api.structocr.com/v1/receipt` - **Category**: Finance & Tax - **Cost**: 1 credit — 1 credit (accuracy=standard) or 2 credits (accuracy=enhanced) - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract merchant, timestamp, subtotal, tax, tip, payment method, and line items from thermal and crumpled retail/restaurant receipts. - **Key Response Fields**: `merchant_name`, `date`, `time`, `currency`, `subtotal`, `tax`, `tip`, `total`, `payment_method`, `line_items` - **Note**: Supports optional ?accuracy=enhanced query parameter (2 credits) for ultra-high-resolution parsing of long or faded receipts. - **Documentation**: https://structocr.com/developers/receipt-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/receipt-scanner ### ATM Cassette & Counter Slip OCR — `POST https://api.structocr.com/v1/atm-cassette` - **Category**: Finance & Tax - **Cost**: 1 credit — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Extract cassette counts, denominations, reject/purge totals, and terminal identifiers from ATM cash reconciliation slips and screens. - **Key Response Fields**: `terminal_id`, `timestamp`, `cassettes`, `total_dispensed`, `total_rejected`, `currency` - **Note**: Built for cash-in-transit (CIT) and ATM fleet replenishment workflows. - **Documentation**: https://structocr.com/developers/atm-cassette-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/atm-cassette-scanner ### VIN OCR — `POST https://api.structocr.com/v1/vin` - **Category**: Automotive & Fleet - **Cost**: 1 credit — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Read 17-character ISO 3779 Vehicle Identification Numbers from windshields, door-jamb stickers, and documents with check-digit validation. - **Key Response Fields**: `vin`, `is_valid`, `wmi`, `vds`, `vis`, `model_year` - **Note**: Handles glare, curved glass, dirt, and angled mobile photos; validates ISO 3779 check digit. - **Documentation**: https://structocr.com/developers/vin-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/vin-scanner ### VIN Pro OCR (VIN + Vehicle Specs Decoding) — `POST https://api.structocr.com/v1/vin-pro` - **Category**: Automotive & Fleet - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Extract the 17-character VIN from a photo and enrich it with decoded make, model, year, body class, engine, and trim specifications. - **Key Response Fields**: `vin`, `is_valid`, `vehicle.make`, `vehicle.model`, `vehicle.year`, `vehicle.body_class`, `vehicle.fuel_type` - **Note**: Combines VIN visual OCR with automated vehicle specification enrichment in one call. - **Documentation**: https://structocr.com/developers/vin-pro-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/vin-scanner ### Vehicle Registration OCR (Saudi Istimara, UAE Mulkiya, US DMV, Global) — `POST https://api.structocr.com/v1/vehicle-registration` - **Category**: Automotive & Fleet - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract VIN, plate number, owner, make/model/year, and country-specific localized fields from global vehicle registration cards including Saudi Istimara (TGA details), UAE Mulkiya, US DMV, and India RC. - **Key Response Fields**: `country_code`, `vin`, `plate_number`, `owner_name`, `make`, `model`, `year`, `color`, `expiry_date`, `localized` - **Note**: Returns Saudi TGA plate structure (sequence number + right/middle/left plate letters) under localized.saudi.tga_plate_details. - **Note**: Includes an official n8n workflow template for Saudi Istimara automation (/n8n/saudi-istimara-ocr.json). - **Documentation**: https://structocr.com/developers/vehicle-registration-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/vehicle-registration-scanner ### Auto Insurance Card OCR — `POST https://api.structocr.com/v1/auto-insurance` - **Category**: Automotive & Fleet - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract policy number, insurer, NAIC code, effective/expiration dates, insured drivers, and covered vehicle VINs from auto insurance ID cards. - **Key Response Fields**: `insurer_name`, `naic_code`, `policy_number`, `effective_date`, `expiration_date`, `insured_names`, `vehicles` - **Note**: Built for car rental counters, dealership F&I, and auto lending verification. - **Documentation**: https://structocr.com/developers/auto-insurance-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/auto-insurance-scanner ### License Plate OCR — `POST https://api.structocr.com/v1/license-plate` - **Category**: Automotive & Fleet - **Cost**: 1 credit — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Read vehicle license plates including US/EU plates and bilingual Arabic/English GCC plates (Saudi Arabia, UAE, Qatar, Kuwait). - **Key Response Fields**: `plate_number`, `plate_arabic`, `region`, `country_code`, `plate_type` - **Note**: Handles multi-line and bilingual Arabic-Latin plates used across GCC parking, fleet, and gate access. - **Documentation**: https://structocr.com/developers/license-plate-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/license-plate-scanner ### Shipping Container Code OCR (ISO 6346) — `POST https://api.structocr.com/v1/container` - **Category**: Logistics & Maritime - **Cost**: 1 credit — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Extract ISO 6346 shipping container numbers (owner code, category, serial, check digit) and ISO size/type codes from horizontal or vertical container markings. - **Key Response Fields**: `container_number`, `owner_code`, `equipment_category`, `serial_number`, `check_digit`, `is_valid_iso6346`, `iso_type_code` - **Note**: Deterministic ISO 6346 check-digit verification for port gate-in, depot, and drayage automation. - **Documentation**: https://structocr.com/developers/container-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/container-scanner ### Bill of Lading & Air Waybill OCR — `POST https://api.structocr.com/v1/bill-of-lading` - **Category**: Logistics & Maritime - **Cost**: 3 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract shipper, consignee, B/L or AWB number, vessel/voyage, ports, container numbers, cargo descriptions, and weights with ISO 6346 and IATA AWB validation. - **Key Response Fields**: `document_type`, `bl_number`, `awb_number`, `shipper`, `consignee`, `port_of_loading`, `port_of_discharge`, `containers`, `cargo_items`, `gross_weight` - **Note**: Validates container numbers (ISO 6346) and Air Waybill Mod-7 check digits. - **Documentation**: https://structocr.com/developers/bill-of-lading-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/bill-of-lading-scanner ### Weighbridge & Scale Ticket OCR — `POST https://api.structocr.com/v1/weighbridge-ticket` - **Category**: Logistics & Maritime - **Cost**: 2 credits — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP, single-page PDF (up to 4.5MB) - **Summary**: Extract ticket number, vehicle plate, gross/tare/net weights, unit, material, and timestamps from dot-matrix and thermal weighbridge scale tickets. - **Key Response Fields**: `ticket_number`, `date`, `vehicle_plate`, `material`, `gross_weight`, `tare_weight`, `net_weight`, `weight_unit`, `customer_name` - **Note**: Verifies gross - tare = net arithmetic consistency for aggregates, scrap, grain, and waste haulage. - **Documentation**: https://structocr.com/developers/weighbridge-ticket-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/weighbridge-ticket-scanner ### Marine HIN OCR (Hull Identification Number) — `POST https://api.structocr.com/v1/hin` - **Category**: Logistics & Maritime - **Cost**: 1 credit — per successful request - **Data Retention**: Standard (deleted within 24 hours max) - **Input**: JPG, PNG, WebP (up to 4.5MB) - **Summary**: Extract and parse 12-character USCG/ISO Hull Identification Numbers (MIC, serial number, manufacture month/year, model year) from boat transoms and titles. - **Key Response Fields**: `hin`, `is_valid`, `mic`, `serial_number`, `certification_month`, `certification_year`, `model_year` - **Note**: Handles embossed fiberglass/metal hull plates in bright marina lighting. - **Documentation**: https://structocr.com/developers/hin-ocr - **Interactive Browser Tool / Demo**: https://structocr.com/tools/hin-scanner ### Account & API Key Credit Balance — `GET https://api.structocr.com/v1/account/balance` - **Category**: Account & Billing - **Cost**: 0 credits (free) - **Data Retention**: Strict Zero Data Retention - **Input**: GET request with x-api-key header - **Summary**: Check remaining account credit balance, lifetime usage, and current-month account and API-key request metrics. - **Key Response Fields**: `period.start`, `period.end`, `account.credits_total`, `account.credits_used`, `account.credits_remaining`, `account.credits_this_period`, `account.requests_this_period`, `this_key.credits_used`, `this_key.requests` - **Note**: 0 credits per request; suitable for automated low-balance monitoring and alerts. - **Documentation**: https://structocr.com/developers/account-balance ## 6. Quickstart Code Examples ### cURL (Multipart Upload — Vehicle Registration / Saudi Istimara) ```bash curl -X POST https://api.structocr.com/v1/vehicle-registration \ -H "x-api-key: YOUR_API_KEY" \ -F "file=@istimara.jpg" ``` ### cURL (Zero-Retention Driver License Front + Back Cross-Check) ```bash curl -X POST https://api.structocr.com/v1/driver-license-verify \ -H "x-api-key: YOUR_API_KEY" \ -F "front=@license-front.heic" \ -F "back=@license-back.heic" \ -F "min_age=21" ``` ### cURL (Zero-Retention Image to Excel / PDF Table Extraction) ```bash curl -X POST https://api.structocr.com/v1/image-to-excel \ -H "x-api-key: YOUR_API_KEY" \ -F "file=@table-photo.jpg" ``` ### Python SDK (`pip install structocr` v1.9.0) ```python from structocr import StructOCR client = StructOCR(api_key="YOUR_API_KEY") result = client.scan_passport("passport.jpg") verify = client.verify_driver_license("license-front.jpg", "license-back.heic", min_age=21) tables = client.extract_pdf("statement.pdf", mode="tables", pages="1-5") print(result, verify, tables) ``` ### Node.js SDK (`npm install structocr` v1.11.0) ```javascript const StructOCR = require("structocr"); const client = new StructOCR("YOUR_API_KEY"); const result = await client.scanPassport("passport.jpg"); const verify = await client.verifyDriverLicense("license-front.jpg", "license-back.heic", { minAge: 21 }); const tables = await client.extractPdf("statement.pdf", { mode: "tables", pages: "1-5" }); console.log(result, verify, tables); ``` ### Official MCP Server (`npx -y structocr-mcp`, Registry: `io.github.dracula911/structocr-mcp`) - Exposes `verify_driver_license`, `extract_pdf`, `image_to_excel`, `scan_document` (all 19 single-document endpoints), `get_account_balance`, and `list_supported_documents` over MCP stdio transport for Claude Desktop, Cursor, Claude Code, and VS Code. - Documentation: https://structocr.com/developers/mcp - npm: https://www.npmjs.com/package/structocr-mcp | GitHub: https://github.com/dracula911/structocr-mcp ```json { "mcpServers": { "structocr": { "command": "npx", "args": ["-y", "structocr-mcp"], "env": { "STRUCTOCR_API_KEY": "YOUR_API_KEY" } } } } ``` ## 7. Ready-to-Import n8n Workflow Templates - **n8n Driver License Front + Back PDF417 Verification Workflow** (`/v1/driver-license-verify`): Guide at https://structocr.com/blog/platforms/n8n-driver-license-verification | Direct import JSON at https://structocr.com/n8n/driver-license-verification.json - **n8n Image to Excel OCR Workflow** (`/v1/image-to-excel`): Guide at https://structocr.com/blog/platforms/n8n-image-to-excel-ocr | Direct import JSON at https://structocr.com/n8n/image-to-excel-ocr.json - **n8n Saudi Istimara Vehicle Registration OCR Workflow** (`/v1/vehicle-registration`): Guide at https://structocr.com/blog/platforms/n8n-saudi-istimara-ocr | Direct import JSON at https://structocr.com/n8n/saudi-istimara-ocr.json - **n8n Saudi National ID & Iqama OCR Workflow** (`/v1/national-id`): Guide at https://structocr.com/blog/platforms/n8n-saudi-national-id-iqama-ocr | Direct import JSON at https://structocr.com/n8n/saudi-national-id-iqama-ocr.json - **n8n Saudi Driver License OCR Workflow** (`/v1/driver-license`): Guide at https://structocr.com/blog/platforms/n8n-saudi-drivers-license-ocr | Direct import JSON at https://structocr.com/n8n/saudi-drivers-license-ocr.json ## 8. Free Client-Side Utilities (0 Credits) - **ZATCA QR Code Scanner (Saudi Phase 1/2 TLV Decoder)** (https://structocr.com/tools/zatca-qr-code-scanner): 100% browser-side, 0-credit Saudi ZATCA Base64 TLV QR code decoder for seller name, 15-digit VAT number, timestamp, invoice total, and VAT total. - **ISO 6346 Container Check Digit Calculator** (https://structocr.com/tools/container-check-digit-calculator): 0-credit browser-side ISO 6346 shipping container check-digit validator and generator. - **VIN Barcode Generator** (https://structocr.com/tools/vin-barcode-generator): 0-credit browser-side Code 39 / 2D VIN barcode generator for testing and labeling.