curl -X GET "https://prod.visionapi.unsiloed.ai/extract/{job_id}" \
-H "api-key: your-api-key"
{
"job_id": "36b2c5dc-942c-4b20-8451-39764246f9aa",
"status": "completed",
"file_name": "invoice.pdf",
"created_at": "2026-01-19T21:10:51.324693+00:00",
"updated_at": "2026-01-19T21:10:55.165642+00:00",
"metadata": {
"order": ["invoice_number", "company_name", "total_amount"],
"page_count": 1
},
"result": {
"invoice_number": {
"score": 0.7970692802977641,
"value": "25G1IZT000009999",
"bboxes": [
{
"bbox": [150, 80, 320, 110]
}
],
"page_no": 1
},
"company_name": {
"score": 0.9945,
"value": "Acme Corporation",
"bboxes": [
{
"bbox": [72, 100, 400, 140]
}
],
"page_no": 1
},
"total_amount": {
"score": 0.9876,
"value": "1250000",
"bboxes": [
{
"bbox": [150, 250, 300, 280]
}
],
"page_no": 1
}
}
}
Retrieve the results of a completed processing job
curl -X GET "https://prod.visionapi.unsiloed.ai/extract/{job_id}" \
-H "api-key: your-api-key"
{
"job_id": "36b2c5dc-942c-4b20-8451-39764246f9aa",
"status": "completed",
"file_name": "invoice.pdf",
"created_at": "2026-01-19T21:10:51.324693+00:00",
"updated_at": "2026-01-19T21:10:55.165642+00:00",
"metadata": {
"order": ["invoice_number", "company_name", "total_amount"],
"page_count": 1
},
"result": {
"invoice_number": {
"score": 0.7970692802977641,
"value": "25G1IZT000009999",
"bboxes": [
{
"bbox": [150, 80, 320, 110]
}
],
"page_no": 1
},
"company_name": {
"score": 0.9945,
"value": "Acme Corporation",
"bboxes": [
{
"bbox": [72, 100, 400, 140]
}
],
"page_no": 1
},
"total_amount": {
"score": 0.9876,
"value": "1250000",
"bboxes": [
{
"bbox": [150, 250, 300, 280]
}
],
"page_no": 1
}
}
}
order: Array of extracted field names in orderpage_count: Number of pages in the documentscore: Confidence score (0-1) for the extractionvalue: The extracted valuebboxes: Array of bounding box objects with bbox coordinatespage_no: Page number where the value was found (1-indexed)curl -X GET "https://prod.visionapi.unsiloed.ai/extract/{job_id}" \
-H "api-key: your-api-key"
{
"job_id": "36b2c5dc-942c-4b20-8451-39764246f9aa",
"status": "completed",
"file_name": "invoice.pdf",
"created_at": "2026-01-19T21:10:51.324693+00:00",
"updated_at": "2026-01-19T21:10:55.165642+00:00",
"metadata": {
"order": ["invoice_number", "company_name", "total_amount"],
"page_count": 1
},
"result": {
"invoice_number": {
"score": 0.7970692802977641,
"value": "25G1IZT000009999",
"bboxes": [
{
"bbox": [150, 80, 320, 110]
}
],
"page_no": 1
},
"company_name": {
"score": 0.9945,
"value": "Acme Corporation",
"bboxes": [
{
"bbox": [72, 100, 400, 140]
}
],
"page_no": 1
},
"total_amount": {
"score": 0.9876,
"value": "1250000",
"bboxes": [
{
"bbox": [150, 250, 300, 280]
}
],
"page_no": 1
}
}
}
import requests
import time
import json
def process_document_with_results(file_path, schema, api_key):
"""Complete workflow: submit job, wait for completion, get results"""
headers = {"api-key": api_key}
# Step 1: Submit extraction job
files = {"pdf_file": open(file_path, "rb")}
data = {"schema_data": json.dumps(schema)}
response = requests.post(
"https://prod.visionapi.unsiloed.ai/extract",
files=files,
data=data,
headers=headers
)
if response.status_code != 200:
raise Exception(f"Failed to submit job: {response.text}")
job_id = response.json()["job_id"]
print(f"Job submitted: {job_id}")
# Step 2: Poll for completion
while True:
status_response = requests.get(
f"https://prod.visionapi.unsiloed.ai/extract/{job_id}",
headers=headers
)
if status_response.status_code != 200:
raise Exception(f"Failed to check status: {status_response.text}")
job = status_response.json()
status = job["status"]
print(f"Job status: {status}")
if status == "COMPLETED" or status == "completed":
break
elif status == "FAILED" or status == "failed":
raise Exception(f"Job failed: {job.get('error', 'Unknown error')}")
time.sleep(5) # Wait 5 seconds before checking again
# Step 3: Get results
results_response = requests.get(
f"https://prod.visionapi.unsiloed.ai/extract/{job_id}",
headers=headers
)
if results_response.status_code != 200:
raise Exception(f"Failed to get results: {results_response.text}")
return results_response.json()
# Usage example
schema = {
"type": "object",
"properties": {
"company_name": {
"type": "string",
"description": "Name of the company"
},
"total_amount": {
"type": "number",
"description": "Total financial amount"
}
},
"required": ["company_name"],
"additionalProperties": False
}
try:
results = process_document_with_results("document.pdf", schema, "your-api-key")
print("Extraction completed!")
print("Results:", results)
except Exception as e:
print(f"Error: {e}")
result object contains:
score: A confidence score between 0 and 1 indicating extraction confidencevalue: The extracted value as a stringbboxes: Array of bounding box objects indicating where the value was foundpage_no: The page number where the value was located (1-indexed)[x1, y1, x2, y2] where:
x1, y1: Top-left corner coordinatesx2, y2: Bottom-right corner coordinatesJob Still Processing (400)
Job Failed (500)
Results Not Found (404)
Job Not Found (404)