Skip to main content
GET
/
jobs
/
{id}
curl -X GET 'https://api.anyformat.ai/jobs/362963/' \
  -H 'x-api-key: YOUR_API_KEY'
{
  "id": "362963",
  "status": "processed",
  "workflow_id": "550e8400-e29b-41d4-a716-446655440000",
  "processed_at": "2024-01-15T10:30:00Z",
  "created_at": "2024-01-15T09:45:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "results": {
    "invoice_number": {
      "value": "INV-12345",
      "confidence": 95,
      "evidence": [{"text": "Invoice #INV-12345", "page_number": 1}],
      "verification_status": "not_verified",
      "value_unit": null
    },
    "total_amount": {
      "value": "1250.00",
      "confidence": 92,
      "evidence": [{"text": "Total: $1,250.00", "page_number": 1}],
      "verification_status": "not_verified",
      "value_unit": "USD"
    }
  }
}
Retrieve the details and extraction results of a specific job. Use the extraction_id returned from the Run Extraction endpoint.
curl -X GET 'https://api.anyformat.ai/jobs/362963/' \
  -H 'x-api-key: YOUR_API_KEY'
{
  "id": "362963",
  "status": "processed",
  "workflow_id": "550e8400-e29b-41d4-a716-446655440000",
  "processed_at": "2024-01-15T10:30:00Z",
  "created_at": "2024-01-15T09:45:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "results": {
    "invoice_number": {
      "value": "INV-12345",
      "confidence": 95,
      "evidence": [{"text": "Invoice #INV-12345", "page_number": 1}],
      "verification_status": "not_verified",
      "value_unit": null
    },
    "total_amount": {
      "value": "1250.00",
      "confidence": 92,
      "evidence": [{"text": "Total: $1,250.00", "page_number": 1}],
      "verification_status": "not_verified",
      "value_unit": "USD"
    }
  }
}

Job Status Values

StatusDescription
pendingJob is queued for processing
in_progressJob is currently being processed
processedProcessing completed successfully
errorProcessing encountered an error
The results object will only contain extracted data when the job status is processed. For other statuses, results will be empty.

Query Parameters

ParameterTypeDescription
includestringInclude additional data, e.g., verification_url
as_listsbooleanTransform extracted fields to consistent list format

Polling for Results

Since extraction is asynchronous, you may need to poll for results:
import requests
import time

def wait_for_extraction(job_id, api_key, timeout=300, poll_interval=5):
    """Poll for extraction results with timeout."""
    url = f"https://api.anyformat.ai/jobs/{job_id}/"
    headers = {"x-api-key": api_key}

    start_time = time.time()
    while time.time() - start_time < timeout:
        response = requests.get(url, headers=headers)
        data = response.json()

        if data["status"] == "processed":
            return data["results"]
        elif data["status"] == "error":
            raise Exception("Extraction failed")

        time.sleep(poll_interval)

    raise TimeoutError("Extraction timed out")

# Usage
results = wait_for_extraction("362963", "YOUR_API_KEY")
print(results)

Authorizations

X-API-Key
string
header
required

API key authentication. Add your API key with the X-API-Key header.

Path Parameters

id
string
required

Response

200 - application/json
id
string
required
status
string
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
processed_at
string<date-time> | null
results
object
verification_url
string | null