curl --request POST \
--url https://api.chunkr.ai/tasks/parse \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>",
"chunk_processing": {
"ignore_headers_and_footers": null,
"target_length": 4096,
"tokenizer": {
"Enum": "Word"
}
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Footnote": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"FormRegion": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Formula": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"GraphicalItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Legend": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"LineNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"ListItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Page": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageFooter": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageHeader": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Picture": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Table": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Text": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Title": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Unknown": {
"description": null,
"extended_context": null,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis",
"expires_in": 123,
"file_name": "<string>"
}
'import requests
url = "https://api.chunkr.ai/tasks/parse"
payload = {
"file": "<string>",
"chunk_processing": {
"ignore_headers_and_footers": None,
"target_length": 4096,
"tokenizer": { "Enum": "Word" }
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Footnote": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"FormRegion": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Formula": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"GraphicalItem": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Legend": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"LineNumber": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"ListItem": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Page": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageFooter": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageHeader": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageNumber": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Picture": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Table": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Text": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Title": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Unknown": {
"description": None,
"extended_context": None,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis",
"expires_in": 123,
"file_name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file: '<string>',
chunk_processing: {
ignore_headers_and_footers: null,
target_length: 4096,
tokenizer: {Enum: 'Word'}
},
error_handling: 'Fail',
ocr_strategy: 'All',
pipeline: 'Chunkr',
segment_processing: {
Caption: {description: null, extended_context: null, llm: '<string>'},
Footnote: {description: null, extended_context: null, llm: '<string>'},
FormRegion: {description: null, extended_context: null, llm: '<string>'},
Formula: {description: null, extended_context: null, llm: '<string>'},
GraphicalItem: {description: null, extended_context: null, llm: '<string>'},
Legend: {description: null, extended_context: null, llm: '<string>'},
LineNumber: {description: null, extended_context: null, llm: '<string>'},
ListItem: {description: null, extended_context: null, llm: '<string>'},
Page: {description: null, extended_context: null, llm: '<string>'},
PageFooter: {description: null, extended_context: null, llm: '<string>'},
PageHeader: {description: null, extended_context: null, llm: '<string>'},
PageNumber: {description: null, extended_context: null, llm: '<string>'},
Picture: {description: null, extended_context: null, llm: '<string>'},
Table: {description: null, extended_context: null, llm: '<string>'},
Text: {description: null, extended_context: null, llm: '<string>'},
Title: {description: null, extended_context: null, llm: '<string>'},
Unknown: {description: null, extended_context: null, llm: '<string>'}
},
segmentation_strategy: 'LayoutAnalysis',
expires_in: 123,
file_name: '<string>'
})
};
fetch('https://api.chunkr.ai/tasks/parse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chunkr.ai/tasks/parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => '<string>',
'chunk_processing' => [
'ignore_headers_and_footers' => null,
'target_length' => 4096,
'tokenizer' => [
'Enum' => 'Word'
]
],
'error_handling' => 'Fail',
'ocr_strategy' => 'All',
'pipeline' => 'Chunkr',
'segment_processing' => [
'Caption' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Footnote' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'FormRegion' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Formula' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'GraphicalItem' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Legend' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'LineNumber' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'ListItem' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Page' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageFooter' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageHeader' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageNumber' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Picture' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Table' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Text' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Title' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Unknown' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
]
],
'segmentation_strategy' => 'LayoutAnalysis',
'expires_in' => 123,
'file_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chunkr.ai/tasks/parse"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chunkr.ai/tasks/parse")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chunkr.ai/tasks/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed": true,
"configuration": {
"chunk_processing": {
"ignore_headers_and_footers": null,
"target_length": 4096,
"tokenizer": {
"Enum": "Word"
}
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Footnote": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"FormRegion": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Formula": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"GraphicalItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Legend": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"LineNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"ListItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Page": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageFooter": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageHeader": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Picture": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Table": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Text": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Title": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Unknown": {
"description": null,
"extended_context": null,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis"
},
"created_at": "2023-11-07T05:31:56Z",
"file_info": {
"url": "<string>",
"mime_type": "<string>",
"name": "<string>",
"page_count": 1,
"ss_cell_count": 1
},
"message": "<string>",
"task_id": "<string>",
"version_info": {
"client_version": "Legacy",
"server_version": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"input_file_url": "<string>",
"output": {
"chunks": [
{
"chunk_length": 1,
"segments": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"page_height": 123,
"page_number": 1,
"page_width": 123,
"segment_id": "<string>",
"confidence": 123,
"content": "<string>",
"description": "<string>",
"embed": "<string>",
"image": "<string>",
"llm": "<string>",
"ocr": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"text": "<string>",
"confidence": 123,
"ocr_id": "<string>",
"ss_cell_ref": "<string>"
}
],
"segment_length": 1,
"ss_cells": [
{
"cell_id": "<string>",
"range": "<string>",
"text": "<string>",
"formula": "<string>",
"hyperlink": "<string>",
"style": {
"bg_color": "<string>",
"font_face": "<string>",
"is_bold": true,
"text_color": "<string>"
},
"value": "<string>"
}
],
"ss_header_bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"ss_header_ocr": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"text": "<string>",
"confidence": 123,
"ocr_id": "<string>",
"ss_cell_ref": "<string>"
}
],
"ss_header_range": "<string>",
"ss_header_text": "<string>",
"ss_range": "<string>",
"ss_sheet_name": "<string>",
"text": "<string>"
}
],
"chunk_id": "<string>",
"content": "<string>",
"embed": "<string>"
}
],
"file_name": "<string>",
"mime_type": "<string>",
"page_count": 1,
"pages": [
{
"image": "<string>",
"page_height": 123,
"page_number": 1,
"page_width": 123,
"dpi": 123,
"ss_sheet_name": "<string>"
}
],
"pdf_url": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"task_url": "<string>"
}"<string>""<string>""<string>""<string>"Create Parse Task
Queues a document for processing and returns a TaskResponse with the
assigned task_id, initial configuration, file metadata, and timestamps.
The initial status is Starting.
Creates a parse task and returns its metadata immediately.
curl --request POST \
--url https://api.chunkr.ai/tasks/parse \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>",
"chunk_processing": {
"ignore_headers_and_footers": null,
"target_length": 4096,
"tokenizer": {
"Enum": "Word"
}
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Footnote": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"FormRegion": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Formula": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"GraphicalItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Legend": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"LineNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"ListItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Page": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageFooter": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageHeader": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Picture": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Table": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Text": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Title": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Unknown": {
"description": null,
"extended_context": null,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis",
"expires_in": 123,
"file_name": "<string>"
}
'import requests
url = "https://api.chunkr.ai/tasks/parse"
payload = {
"file": "<string>",
"chunk_processing": {
"ignore_headers_and_footers": None,
"target_length": 4096,
"tokenizer": { "Enum": "Word" }
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Footnote": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"FormRegion": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Formula": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"GraphicalItem": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Legend": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"LineNumber": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"ListItem": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Page": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageFooter": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageHeader": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"PageNumber": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Picture": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Table": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Text": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Title": {
"description": None,
"extended_context": None,
"llm": "<string>"
},
"Unknown": {
"description": None,
"extended_context": None,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis",
"expires_in": 123,
"file_name": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
file: '<string>',
chunk_processing: {
ignore_headers_and_footers: null,
target_length: 4096,
tokenizer: {Enum: 'Word'}
},
error_handling: 'Fail',
ocr_strategy: 'All',
pipeline: 'Chunkr',
segment_processing: {
Caption: {description: null, extended_context: null, llm: '<string>'},
Footnote: {description: null, extended_context: null, llm: '<string>'},
FormRegion: {description: null, extended_context: null, llm: '<string>'},
Formula: {description: null, extended_context: null, llm: '<string>'},
GraphicalItem: {description: null, extended_context: null, llm: '<string>'},
Legend: {description: null, extended_context: null, llm: '<string>'},
LineNumber: {description: null, extended_context: null, llm: '<string>'},
ListItem: {description: null, extended_context: null, llm: '<string>'},
Page: {description: null, extended_context: null, llm: '<string>'},
PageFooter: {description: null, extended_context: null, llm: '<string>'},
PageHeader: {description: null, extended_context: null, llm: '<string>'},
PageNumber: {description: null, extended_context: null, llm: '<string>'},
Picture: {description: null, extended_context: null, llm: '<string>'},
Table: {description: null, extended_context: null, llm: '<string>'},
Text: {description: null, extended_context: null, llm: '<string>'},
Title: {description: null, extended_context: null, llm: '<string>'},
Unknown: {description: null, extended_context: null, llm: '<string>'}
},
segmentation_strategy: 'LayoutAnalysis',
expires_in: 123,
file_name: '<string>'
})
};
fetch('https://api.chunkr.ai/tasks/parse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chunkr.ai/tasks/parse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'file' => '<string>',
'chunk_processing' => [
'ignore_headers_and_footers' => null,
'target_length' => 4096,
'tokenizer' => [
'Enum' => 'Word'
]
],
'error_handling' => 'Fail',
'ocr_strategy' => 'All',
'pipeline' => 'Chunkr',
'segment_processing' => [
'Caption' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Footnote' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'FormRegion' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Formula' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'GraphicalItem' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Legend' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'LineNumber' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'ListItem' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Page' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageFooter' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageHeader' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'PageNumber' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Picture' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Table' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Text' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Title' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
],
'Unknown' => [
'description' => null,
'extended_context' => null,
'llm' => '<string>'
]
],
'segmentation_strategy' => 'LayoutAnalysis',
'expires_in' => 123,
'file_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chunkr.ai/tasks/parse"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chunkr.ai/tasks/parse")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chunkr.ai/tasks/parse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": \"<string>\",\n \"chunk_processing\": {\n \"ignore_headers_and_footers\": null,\n \"target_length\": 4096,\n \"tokenizer\": {\n \"Enum\": \"Word\"\n }\n },\n \"error_handling\": \"Fail\",\n \"ocr_strategy\": \"All\",\n \"pipeline\": \"Chunkr\",\n \"segment_processing\": {\n \"Caption\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Footnote\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"FormRegion\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Formula\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"GraphicalItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Legend\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"LineNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"ListItem\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Page\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageFooter\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageHeader\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"PageNumber\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Picture\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Table\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Text\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Title\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n },\n \"Unknown\": {\n \"description\": null,\n \"extended_context\": null,\n \"llm\": \"<string>\"\n }\n },\n \"segmentation_strategy\": \"LayoutAnalysis\",\n \"expires_in\": 123,\n \"file_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"completed": true,
"configuration": {
"chunk_processing": {
"ignore_headers_and_footers": null,
"target_length": 4096,
"tokenizer": {
"Enum": "Word"
}
},
"error_handling": "Fail",
"ocr_strategy": "All",
"pipeline": "Chunkr",
"segment_processing": {
"Caption": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Footnote": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"FormRegion": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Formula": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"GraphicalItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Legend": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"LineNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"ListItem": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Page": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageFooter": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageHeader": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"PageNumber": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Picture": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Table": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Text": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Title": {
"description": null,
"extended_context": null,
"llm": "<string>"
},
"Unknown": {
"description": null,
"extended_context": null,
"llm": "<string>"
}
},
"segmentation_strategy": "LayoutAnalysis"
},
"created_at": "2023-11-07T05:31:56Z",
"file_info": {
"url": "<string>",
"mime_type": "<string>",
"name": "<string>",
"page_count": 1,
"ss_cell_count": 1
},
"message": "<string>",
"task_id": "<string>",
"version_info": {
"client_version": "Legacy",
"server_version": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"input_file_url": "<string>",
"output": {
"chunks": [
{
"chunk_length": 1,
"segments": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"page_height": 123,
"page_number": 1,
"page_width": 123,
"segment_id": "<string>",
"confidence": 123,
"content": "<string>",
"description": "<string>",
"embed": "<string>",
"image": "<string>",
"llm": "<string>",
"ocr": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"text": "<string>",
"confidence": 123,
"ocr_id": "<string>",
"ss_cell_ref": "<string>"
}
],
"segment_length": 1,
"ss_cells": [
{
"cell_id": "<string>",
"range": "<string>",
"text": "<string>",
"formula": "<string>",
"hyperlink": "<string>",
"style": {
"bg_color": "<string>",
"font_face": "<string>",
"is_bold": true,
"text_color": "<string>"
},
"value": "<string>"
}
],
"ss_header_bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"ss_header_ocr": [
{
"bbox": {
"height": 123,
"left": 123,
"top": 123,
"width": 123
},
"text": "<string>",
"confidence": 123,
"ocr_id": "<string>",
"ss_cell_ref": "<string>"
}
],
"ss_header_range": "<string>",
"ss_header_text": "<string>",
"ss_range": "<string>",
"ss_sheet_name": "<string>",
"text": "<string>"
}
],
"chunk_id": "<string>",
"content": "<string>",
"embed": "<string>"
}
],
"file_name": "<string>",
"mime_type": "<string>",
"page_count": 1,
"pages": [
{
"image": "<string>",
"page_height": 123,
"page_number": 1,
"page_width": 123,
"dpi": 123,
"ss_sheet_name": "<string>"
}
],
"pdf_url": "<string>"
},
"started_at": "2023-11-07T05:31:56Z",
"task_url": "<string>"
}"<string>""<string>""<string>""<string>"Authorizations
Body
JSON request to create a parse task
The file to be parsed. Supported inputs:
ch://files/{file_id}: Reference to an existing file. Upload via the Files APIhttp(s)://...: Remote URL to fetchdata:*;base64,...or raw base64 string
Controls the setting for the chunking and post-processing of each chunk.
Show child attributes
Show child attributes
Controls how errors are handled during processing:
Fail: Stops processing and fails the task when any error occursContinue: Attempts to continue processing despite non-critical errors (eg. LLM refusals etc.)
Fail, Continue Controls the Optical Character Recognition (OCR) strategy.
All: Processes all pages with OCR. (Latency penalty: ~0.5 seconds per page)Auto: Selectively applies OCR only to pages with missing or low-quality text. When text layer is present the bounding boxes from the text layer are used.
All, Auto Azure, Chunkr Configuration for how each document segment is processed and formatted.
Each segment has sensible defaults, but you can override specific settings:
format: Output asHtmlorMarkdownstrategy:Auto(rule-based),LLM(AI-generated), orIgnore(skip)crop_image: Whether to crop images to segment boundsextended_context: Use full page as context for LLM processingdescription: Generate descriptions for segments
Defaults per segment type: Check the documentation for more details.
Only specify the fields you want to change - everything else uses the defaults.
Show child attributes
Show child attributes
Controls the segmentation strategy:
LayoutAnalysis: Analyzes pages for layout elements (e.g.,Table,Picture,Formula, etc.) using bounding boxes. Provides fine-grained segmentation and better chunking.Page: Treats each page as a single segment. Faster processing, but without layout element detection and only simple chunking.
LayoutAnalysis, Page The number of seconds until task is deleted. Expired tasks can not be updated, polled or accessed via web interface.
The name of the file to be parsed. If not set a name will be generated.
Response
Task created successfully.
True when the task reaches a terminal state i.e. status is Succeeded or Failed or Cancelled
Show child attributes
Show child attributes
The date and time when the task was created and queued.
Information about the input file.
Show child attributes
Show child attributes
A message describing the task's status or any errors that occurred.
The status of the task.
Starting, Processing, Succeeded, Failed, Cancelled The unique identifier for the task.
Parse, Extract Version information for the task.
Show child attributes
Show child attributes
The date and time when the task will expire.
The date and time when the task was finished.
The presigned URL of the input file.
Deprecated use file_info.url instead.
The processed results of a document parsing task
Show child attributes
Show child attributes
The date and time when the task was started.
The presigned URL of the task.