Developer Documentation
Integrate StructOCR's proprietary AI models into your application. Our REST API provides specialized endpoints for identity document extraction with enterprise-grade reliability and a Zero-Retention privacy policy.
High Performance
Average response time < 5s with global edge acceleration.
Privacy First
Images are processed in memory and purged within 24 hours.
Structured Data
Clean JSON output mapped to standard identity schemas.
Client Libraries
Accelerate your integration with our official, type-safe SDKs. Both libraries are open-source and available on standard package managers.
Authentication
All API requests require an API key. This key should be included in the x-api-key custom header. You can manage multiple keys in your API Management console.
Security Warning: API keys carry full account privileges. Never expose them in client-side code (browsers, mobile apps). Always proxy requests through your own backend server.
Quickstart
Each successful OCR request costs 2 Credits for ID documents and 3 Credits for Invoices. Failed requests (non-200 status) are never billed. Use the JSON request (with Base64 encoded image) below to extract data from a document.
curl -X POST https://api.structocr.com/v1/passport \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"img": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
}'Successful extraction returns a structured JSON object:
{
"success": "true",
"data": {
"type": "P",
"country_code": "USA",
"passport_number": "E12345678",
"expiry_date": "2030-12-25",
"surname": "DOE",
"nationality": "UNITED STATES"
// ... more fields
}
}Error Handling
Our API uses standard HTTP response codes. For security and stability, we mask internal upstream errors into branded status codes.
| Code | Message | Reason |
|---|---|---|
| 400 | INVALID_REQUEST_FORMAT | Invalid payload or corrupted Base64. Ensure the image string has no whitespace, newlines, or illegal characters. |
| 402 | INSUFFICIENT_CREDITS | Your balance is too low for this request. |
| 429 | QUOTA_EXCEEDED | Rate limit hit. Standard limit is 25 req/sec. |
| 503 | SYSTEM_BUSY | Masked internal provider error. Retry recommended. |
API Reference
Ready to build? Explore specific endpoint documentation for detailed request parameters and response schemas.
Passport OCR
Extract MRZ, names, and dates from worldwide passports.
ID Card OCR
Process national identity cards with front & back detection.
Invoice Analysis
Extract line items, tax details, and vendor info instantly.
Driver License
Parse driving permits and verify document validity.
VIN OCR
Extract and validate 17-character VINs from vehicle images.