GET
/
extract
const jobId = '<job-id>';
const options = {
  method: 'GET',
  headers: {
    'x-api-key': '<your-api-key>',
  },
};

fetch(`https://api.getomni.ai/extract?jobId=${jobId}`, options)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));
{
  "jobId": "087d73cc-e88a-43be-8bbb-5fcb932e7ef1",
  "result": {
    "ocr": {
      "pages": [
        {
          "page": 1,
          "content": "# Invoice ...",
          "contentLength": 698
        }
      ],
      "fileName": "7faf9e7fd6cb4b3dbb4accca979023bb",
      "inputTokens": 931,
      "outputTokens": 220,
      "completionTime": 8593
    },
    "extracted": {
      "file_type": "invoice"
    },
    "inputTokens": 292,
    "outputTokens": 7
  },
  "status": "COMPLETE",
  "timeElapsed": 1852
}

Query Parameters

jobId
string
required

The job ID of the extraction request

Response

jobId
string

Job ID of the extraction request

result
object

Response object containing OCR results and extracted data

metadata
object

Custom JSON from the request, returned in the response

status
string

Current state of the job, which can be PENDING | IN_PROGRESS | ERROR | COMPLETE

timeElapsed
number

Time taken to process in milliseconds

const jobId = '<job-id>';
const options = {
  method: 'GET',
  headers: {
    'x-api-key': '<your-api-key>',
  },
};

fetch(`https://api.getomni.ai/extract?jobId=${jobId}`, options)
  .then((response) => response.json())
  .then((response) => console.log(response))
  .catch((err) => console.error(err));
{
  "jobId": "087d73cc-e88a-43be-8bbb-5fcb932e7ef1",
  "result": {
    "ocr": {
      "pages": [
        {
          "page": 1,
          "content": "# Invoice ...",
          "contentLength": 698
        }
      ],
      "fileName": "7faf9e7fd6cb4b3dbb4accca979023bb",
      "inputTokens": 931,
      "outputTokens": 220,
      "completionTime": 8593
    },
    "extracted": {
      "file_type": "invoice"
    },
    "inputTokens": 292,
    "outputTokens": 7
  },
  "status": "COMPLETE",
  "timeElapsed": 1852
}