Convert a Weighbridge Slip to JSON
Replace flat OCR text with a stable, integration-ready JSON contract for scale-house, transport, ERP, and reporting systems.

Raw OCR Text Is Not an Integration Contract
A plain text response still requires layout detection, label matching, number parsing, unit conversion, and decisions about missing fields. Those decisions spread into application code and become difficult to test across facilities. A useful weighbridge workflow needs predictable nested fields, explicit nulls, preserved source values, and a separate validation object that explains whether the record can continue automatically.
From One Base64 Request to Typed Data
Send a Base64-encoded image or PDF to POST /v1/weighbridge-ticket. The response groups facility, parties, job, vehicle, material, weights, timestamps, fees, and validation into a consistent JSON object. Pair this contract with the broader weight ticket data extraction workflow, or follow the API documentation for every returned field and error status.
Live Demo: Weighbridge Ticket OCR Scanner
No registration required. Upload a file to test the extraction.
Drop files here or click to browse
JPG · PNG · WebP · up to 500 files · max 4.5 MB each
Practical Workflows
Webhook Pipelines
Forward normalized ticket records to queues, workflow tools, or internal services.
Database Imports
Map stable nested fields into transactional and reporting tables.
ERP Adapters
Create draft load or material-movement records after validation.
Human Review
Display raw values and review reasons beside the source ticket.
Technical Specs
- Endpoint: POST /v1/weighbridge-ticket
- Authentication: x-api-key request header
- Input: Base64 or data URI in JSON; JPG, PNG, WebP, or PDF
- Maximum decoded size: 4.5MB
- Cost: 2 credits per successful request
- Output: Structured JSON with deterministic weight validation
Key Features
- Stable nesting: Groups related operational fields instead of flattening them into ambiguous keys.
- Explicit validity: is_weighbridge_ticket and is_valid distinguish classification from usable extraction.
- Deterministic validation: Returns calculated net, printed difference, pass state, and review reasons.
- SDK-ready: Python and Node.js SDKs handle file reading and Base64 encoding locally.
Send a Ticket to the OCR API
The REST endpoint accepts one Base64-encoded JPG, PNG, WebP, or PDF in the JSON img property. Allow a 60-second client timeout and inspect the validation object before accepting a record.
import base64
import requests
with open("weighbridge-ticket.jpg", "rb") as file:
image = base64.b64encode(file.read()).decode("ascii")
response = requests.post(
"https://api.structocr.com/v1/weighbridge-ticket",
headers={"x-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"img": image},
timeout=60,
)
response.raise_for_status()
result = response.json()
data = result["data"]
print("is_valid:", data["is_valid"])
print("ticket_number:", data["ticket_number"])
print("vehicle.registration:", data["vehicle"]["registration"])
print("weights.net.normalized_kg:", data["weights"]["net"]["normalized_kg"])
print("validation.needs_review:", data["validation"]["needs_review"])Validated JSON Response
A successful response contains extracted evidence and a separate validation decision for downstream automation.
{
"success": true,
"data": {
"is_weighbridge_ticket": true,
"document_type": "generic_weighbridge_ticket",
"ticket_number": "1042",
"facility": {
"name": "North Yard Scale",
"address": null,
"scale_id": "SCALE-2"
},
"parties": {
"supplier": null,
"customer": "Example Customer"
},
"job": {
"job_number": "JOB-88",
"order_number": null
},
"vehicle": {
"registration": "AB12 CDE",
"trailer_registration": null,
"fleet_number": null,
"driver_name": null
},
"material": {
"description": "Recycled aggregate",
"code": "RA20"
},
"weights": {
"gross": {
"value": 25330,
"unit": "kg",
"raw": "25,330 kg",
"normalized_kg": 25330
},
"tare": {
"value": 6770,
"unit": "kg",
"raw": "6,770 kg",
"normalized_kg": 6770
},
"net": {
"value": 18560,
"unit": "kg",
"raw": "18,560 kg",
"normalized_kg": 18560
}
},
"confidence": "high",
"is_valid": true,
"validation": {
"calculated_net_kg": 18560,
"difference_kg": 0,
"weight_check_passed": true,
"needs_review": false,
"review_reasons": []
}
}
}Frequently Asked Questions
Does the API return CSV or JSON?
The API returns JSON. Your application can flatten selected fields into CSV or an ERP import format after checking the validation object.
Can I send a public image URL?
No. The REST endpoint currently expects Base64 content or a data URI in the JSON img property. Official SDKs can read a local path or in-memory bytes.
Which files can I submit?
The endpoint accepts Base64-encoded JPG, PNG, WebP, and PDF content up to 4.5MB. Public URLs and multipart uploads are not currently accepted by the REST endpoint.
How much does one successful request cost?
A successful weighbridge ticket extraction costs 2 credits. New accounts receive 200 free credits, enough for up to 100 initial scans.
When is it safe to accept a ticket automatically?
Define the rule in your own workflow. A conservative starting point is to require is_weighbridge_ticket and is_valid to be true, confidence to meet your threshold, and validation.needs_review to be false. Keep a human review route for all other results.
Should I use the REST API or an SDK?
Use the REST API from any backend that can send Base64 JSON. The official Python and Node.js SDKs are convenient when you want local file validation, Base64 encoding, and consistent request handling without writing that plumbing yourself.
Explore More Weighbridge Ticket OCR Solutions
Weight Ticket Data Extraction
Automate weight ticket data extraction for ERP and transport workflows. Capture vehicle, material, job, gross, tare, net, timestamps, and validation data.
Dump Ticket OCR API
Extract dump and disposal ticket fields including facility, vehicle, material, gross, tare, net weight, fee, and timestamps into validated JSON.
Gross, Tare & Net Weight Extraction
Extract gross, tare, and net weight from tickets, normalize kg, tonnes, and pounds, and validate printed net against gross minus tare.
Quarry Load Ticket OCR
Extract quarry load ticket data including material, customer, vehicle, job, gross, tare, and net weight. Return validated JSON for aggregate operations.
Scale Ticket OCR API
Extract ticket, vehicle, material, gross, tare, and net weight from scale tickets. Validate weight calculations and return structured JSON through one API.
Technical Comparisons & Integrations
Explore platform integrations and competitive analysis
Add VIN OCR to Your Replit App in 5 Minutes
Step-by-step guide to integrating the StructOCR VIN scanner API into a Replit application. Build automotive and fleet tools using Replit Agent and Secrets.
Single-Page MRZ SDKs vs. Dual-Page Indian KYC API
Why traditional MRZ scanners fail at full Indian Passport verification, and how to process both the front identity page and the back address page in a single API call.
Template-Based OCR vs. StructOCR API for Invoice Processing
Why traditional zonal/template-based OCR fails at processing vendor invoices, and how layout-agnostic AI APIs instantly extract line items and totals.
Tesseract & PassportEye vs. StructOCR Passport API
A technical evaluation for developers deciding between open-source MRZ scanners and a dedicated cloud-based Passport OCR API.
Tesseract OCR vs. StructOCR API for ISO 6346 Container Numbers
A technical comparison for developers evaluating open-source Tesseract vs. a dedicated cloud API for extracting shipping container numbers.
Add Container OCR to Your v0 App in 5 Minutes
Step-by-step guide to integrating the StructOCR shipping container API into a v0 by Vercel app. Build logistics and yard management tools with zero backend.
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.