Poll Run Extract

GET /extract?jobId=${jobId}

Poll to retrieve extraction results

Request

Headers

An API Key is required to access this endpoint.

Name
Value

x-api-key

your_api_key

Response

The API returns the response in JSON format.

The request will return a 200 with the jobId, result, status, and timeElapsed.

  • jobId - Unique identifier of the job

  • result

    • ocr - OCR response data

    • extracted - Extracted values

  • status - Current state of the job, which can be PENDING, IN_PROGRESS, ERROR, or COMPLETE

  • timeElapsed - Time taken to process

Example

{
  "jobId": "c1115a54-26fd-4a2f-9572-a93bbc9a8cd8",
  "result": {
    "ocr": {
      "pages": [
        {
	  "page": 1,
          "content": "## SuperStore\\n\\n**INVOICE**  \\n# 47905\\n\\n**Date:**  \\nSep 13 2012\\n\\n**Ship Mode:**  \\nFirst Class\\n\\n**Balance Due:**  \\n$23,581.71\\n\\n---\\n\\n**Bill To:**  \\nAaron Hawkins\\n\\n**Ship To:**  \\nKamina, Katanga,  \\nDemocratic Republic of the Congo\\n\\n| Item                             | Quantity | Rate     | Amount     |\\n|----------------------------------|----------|----------|------------|\\n| Apple Smart Phone, Full Size     | 6        | $3,817.26 | $22,903.56 |\\n| Phones, Technology, TEC-PH-3148  |          |          |            |\\n\\n**Subtotal:** $22,903.56  \\n**Shipping:** $678.15  \\n**Total:** $23,581.71\\n\\n---\\n\\n**Notes:**  \\nThanks for your business!\\n\\n**Terms:**  \\nOrder ID : CG-2012-AH1003033-41165",
          "contentLength": 683
        }
      ],
      "fileName": "invoice_aaron20hawkins_47905",
      "inputTokens": 828,
      "outputTokens": 198,
      "completionTime": 6460
    },
    "extracted": {
      "bill_to": "Aaron Hawkins",
      "ship_to": "Kamina, Katanga, Democratic Republic of the Congo",
      "balance_due": 23581.71
    },
    "inputTokens": 284,
    "outputTokens": 30
  },
  "status": "COMPLETE",
  "timeElapsed": 10519
}

Last updated