Updated on 2025-08-13 GMT+08:00

Querying the OCR Parsing Result

Function

Querying the OCR Parsing Result

URI

GET /v1/koosearch/doc-search/ocr-results

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

task_id

Yes

String

Parsing task ID

pages

No

String

Page number set, which specifies the pages whose OCR results are to be queried. Multiple pages are separated by commas (,), for example, 1,2,3,4,5.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Parameter description:

Token used for API authentication. For how to obtain the token, see section 3.2 "Authentication."

Constraints:

N/A.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

[items]

Array of PageOcrResult objects

OCR result response

Table 4 PageOcrResult

Parameter

Type

Description

page_num

Integer

Document page number

ocr_result

RawOcrResult object

Character recognition results

Table 5 RawOcrResult

Parameter

Type

Description

result

SmartDocumentRecognizerResult object

Character recognition results

Table 6 SmartDocumentRecognizerResult

Parameter

Type

Description

table_result

SmartDocumentRecognizerTableResult object

Table recognition results.

layout_result

SmartDocumentRecognizerLayoutResult object

Layout recognition result

kv_result

SmartDocumentRecognizerKvResult object

Key-value pair recognition result

ocr_result

SmartDocumentRecognizerOcrResult object

Character recognition results

Table 7 SmartDocumentRecognizerTableResult

Parameter

Type

Description

table_count

Integer

Number of tables.

table_list

Array of SmartDocumentRecognizerTableBlock objects

OCR table data.

Table 8 SmartDocumentRecognizerTableBlock

Parameter

Type

Description

location

Array<Array<Integer>>

List of location information about a text block, including the 2D coordinates (x,y) of four vertexes in the text area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical.

words_block_count

Integer

Number of cells in a table

words_block_list

Array of SmartDocumentRecognizerTableWordsBlock objects

List of cell recognition results

Table 9 SmartDocumentRecognizerTableWordsBlock

Parameter

Type

Description

words

String

Character recognition results in a cell

rows

Array of integers

Rows occupied by text. The values start from 0 and are displayed in a list. The data type is Integer.

columns

Array of integers

Columns occupied by text. The values start from 0 and are displayed in a list. The data type is Integer.

Table 10 SmartDocumentRecognizerLayoutResult

Parameter

Type

Description

layout_block_count

Integer

Number of document layout areas recognized by the model

layout_block_list

Array of SmartDocumentRecognizerLayoutBlock objects

List of document layout area recognition results

Table 11 SmartDocumentRecognizerLayoutBlock

Parameter

Type

Description

location

Array<Array<Integer>>

List of location information about a text block, including the 2D coordinates (x,y) of four vertexes in the text area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical.

type

String

Document area type, including text and table

text

String

Text in the document area.

words_ids

Array of integers

Index list of character recognition results, indicating which text blocks in words_block_list of ocr_result are located within the document area.

Table 12 SmartDocumentRecognizerKvResult

Parameter

Type

Description

kv_block_count

Integer

Number of key-value pairs recognized by the model

kv_block_list

Array of SmartDocumentRecognizerKVBlock objects

List of key-value pair recognition results

Table 13 SmartDocumentRecognizerKVBlock

Parameter

Type

Description

key

String

Key in the key-value pair

value

String

Value in the key-value pair

words_block_count

Integer

Number of text boxes contained in the key-value pair

words_block_list

Array of SmartDocumentRecognizerKVWordsBlock objects

Key-value pair text box recognition result list

Table 14 SmartDocumentRecognizerKVWordsBlock

Parameter

Type

Description

location

Array<Array<Integer>>

List of location information about a text block, including the 2D coordinates (x,y) of four vertexes in the text area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical.

type

String

Type

words

String

Recognition result of a text block

Table 15 SmartDocumentRecognizerOcrResult

Parameter

Type

Description

direction

Float

Image direction.

words_block_count

Integer

Number of text blocks that have been recognized

words_block_list

Array of SmartDocumentRecognizerWordsBlockList objects

List of text blocks that have been recognized. The output sequence is from left to right and from top to bottom.

Table 16 SmartDocumentRecognizerWordsBlockList

Parameter

Type

Description

location

Array<Array<Integer>>

List of location information about a text block, including the 2D coordinates (x,y) of four vertexes in the text area, where the coordinate origin is the upper-left corner of the image, the X axis is horizontal, and the Y axis is vertical.

confidence

Float

Confidence of a recognized text block

words

String

Recognition result of a text block

Status code: 400

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 401

Table 18 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Status code: 500

Table 19 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error description

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

OCR parsing result

400

Invalid request parameters

401

Authentication error

500

Service content error

Error Codes

See Error Codes.