Skip to content

Get Extract Job

client.extract.get(stringjobID, ExtractGetParams { organization_id, project_id } query?, RequestOptionsoptions?): ExtractV2Job { id, created_at, parameters, 9 more }
GET/api/v2/extract/{job_id}

Get a single extraction job by ID.

ParametersExpand Collapse
jobID: string
query: ExtractGetParams { organization_id, project_id }
organization_id?: string | null
project_id?: string | null
ReturnsExpand Collapse
ExtractV2Job { id, created_at, parameters, 9 more }

An extraction job.

id: string

Unique job identifier (job_id)

created_at: string

Creation timestamp

formatdate-time
parameters: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>

Job configuration parameters (includes parse_config_id, extract_options)

Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
project_id: string

Project this job belongs to

status: "PENDING" | "THROTTLED" | "RUNNING" | 3 more

Current status of the job

Accepts one of the following:
"PENDING"
"THROTTLED"
"RUNNING"
"COMPLETED"
"FAILED"
"CANCELLED"
type: "url" | "file_id" | "parse_job_id"

Type of document input.

Accepts one of the following:
"url"
"file_id"
"parse_job_id"
updated_at: string

Last update timestamp

formatdate-time
value: string

Document identifier (URL, file ID, or parse job ID).

configuration_id?: string | null

Extract configuration ID (ProductConfiguration) used for this job (if any)

error_message?: string | null

Error message if failed

extract_metadata?: ExtractJobMetadata { field_metadata, parse_job_id, parse_tier, usage } | null

Extraction metadata.

field_metadata?: ExtractedFieldMetadata { document_metadata, page_metadata, row_metadata } | null

Metadata for extracted fields including document, page, and row level info.

document_metadata?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
page_metadata?: Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
row_metadata?: Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null
Accepts one of the following:
Record<string, unknown>
Array<unknown>
string
number
boolean
parse_job_id?: string | null

Reference to the ParseJob ID used for parsing

parse_tier?: string | null

Parse tier used for parsing the document

usage?: ExtractJobUsage { num_document_tokens, num_output_tokens, num_pages_extracted } | null

Extraction usage metrics.

num_document_tokens?: number | null

Number of document tokens

num_output_tokens?: number | null

Number of output tokens

num_pages_extracted?: number | null

Number of pages extracted

extract_result?: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null> | Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>> | null

Extracted data (object or array depending on extraction_target)

Accepts one of the following:
Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>
Record<string, unknown>
Array<unknown>
string
number
boolean
Array<Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>>
Record<string, unknown>
Array<unknown>
string
number
boolean

Get Extract Job

import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

const extractV2Job = await client.extract.get('job_id');

console.log(extractV2Job.id);
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "parameters": {
    "foo": {
      "foo": "bar"
    }
  },
  "project_id": "project_id",
  "status": "PENDING",
  "type": "url",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "value": "value",
  "configuration_id": "configuration_id",
  "error_message": "error_message",
  "extract_metadata": {
    "field_metadata": {
      "document_metadata": {
        "foo": {
          "foo": "bar"
        }
      },
      "page_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ],
      "row_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ]
    },
    "parse_job_id": "parse_job_id",
    "parse_tier": "parse_tier",
    "usage": {
      "num_document_tokens": 0,
      "num_output_tokens": 0,
      "num_pages_extracted": 0
    }
  },
  "extract_result": {
    "foo": {
      "foo": "bar"
    }
  }
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "parameters": {
    "foo": {
      "foo": "bar"
    }
  },
  "project_id": "project_id",
  "status": "PENDING",
  "type": "url",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "value": "value",
  "configuration_id": "configuration_id",
  "error_message": "error_message",
  "extract_metadata": {
    "field_metadata": {
      "document_metadata": {
        "foo": {
          "foo": "bar"
        }
      },
      "page_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ],
      "row_metadata": [
        {
          "foo": {
            "foo": "bar"
          }
        }
      ]
    },
    "parse_job_id": "parse_job_id",
    "parse_tier": "parse_tier",
    "usage": {
      "num_document_tokens": 0,
      "num_output_tokens": 0,
      "num_pages_extracted": 0
    }
  },
  "extract_result": {
    "foo": {
      "foo": "bar"
    }
  }
}