Partition Document
curl --request POST \
--url https://api.aryn.cloud/v1/document/partition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form 'file_url=<string>' \
--form 'options={
"selected_pages": [
123
],
"extract_images": false,
"image_extraction_options": {
"associate_captions": false,
"extract_image_format": "ppm"
},
"property_extraction_options": {
"schema": [
{
"name": "<string>",
"type": {
"description": "<string>",
"examples": "<array>",
"choices": [
"<string>"
],
"item_type": {}
}
}
],
"voting": false,
"suggest_properties": false,
"suggest_properties_instructions": "<string>"
},
"table_extraction_options": {
"include_additional_text": true,
"model_selection": "pixels > 500 -> deformable_detr; table_transformer"
},
"summarize_images": false,
"pipeline": "standard",
"text_mode": "auto",
"table_mode": "standard",
"text_extraction_options": {
"remove_line_breaks": true
},
"ocr_language": "english",
"threshold": "auto",
"chunking_options": {
"tokenizer_options": {
"model_name": "text-embedding-3-small"
},
"max_tokens": 123,
"merge_across_pages": true
},
"output_format": "json",
"output_label_options": {
"title_candidate_elements": [
"<string>"
],
"promote_title": false,
"orientation_correction": false
},
"markdown_options": {
"include_pagenum": false,
"include_headers": false,
"include_footers": false
},
"extract_table_structure": true,
"use_ocr": true,
"extract_image_format": "ppm"
}'import requests
url = "https://api.aryn.cloud/v1/document/partition"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"file_url": "<string>",
"options": "{
\"selected_pages\": [
123
],
\"extract_images\": false,
\"image_extraction_options\": {
\"associate_captions\": false,
\"extract_image_format\": \"ppm\"
},
\"property_extraction_options\": {
\"schema\": [
{
\"name\": \"<string>\",
\"type\": {
\"description\": \"<string>\",
\"examples\": \"<array>\",
\"choices\": [
\"<string>\"
],
\"item_type\": {}
}
}
],
\"voting\": false,
\"suggest_properties\": false,
\"suggest_properties_instructions\": \"<string>\"
},
\"table_extraction_options\": {
\"include_additional_text\": true,
\"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"
},
\"summarize_images\": false,
\"pipeline\": \"standard\",
\"text_mode\": \"auto\",
\"table_mode\": \"standard\",
\"text_extraction_options\": {
\"remove_line_breaks\": true
},
\"ocr_language\": \"english\",
\"threshold\": \"auto\",
\"chunking_options\": {
\"tokenizer_options\": {
\"model_name\": \"text-embedding-3-small\"
},
\"max_tokens\": 123,
\"merge_across_pages\": true
},
\"output_format\": \"json\",
\"output_label_options\": {
\"title_candidate_elements\": [
\"<string>\"
],
\"promote_title\": false,
\"orientation_correction\": false
},
\"markdown_options\": {
\"include_pagenum\": false,
\"include_headers\": false,
\"include_footers\": false
},
\"extract_table_structure\": true,
\"use_ocr\": true,
\"extract_image_format\": \"ppm\"
}"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('file_url', '<string>');
form.append('options', '{
"selected_pages": [
123
],
"extract_images": false,
"image_extraction_options": {
"associate_captions": false,
"extract_image_format": "ppm"
},
"property_extraction_options": {
"schema": [
{
"name": "<string>",
"type": {
"description": "<string>",
"examples": "<array>",
"choices": [
"<string>"
],
"item_type": {}
}
}
],
"voting": false,
"suggest_properties": false,
"suggest_properties_instructions": "<string>"
},
"table_extraction_options": {
"include_additional_text": true,
"model_selection": "pixels > 500 -> deformable_detr; table_transformer"
},
"summarize_images": false,
"pipeline": "standard",
"text_mode": "auto",
"table_mode": "standard",
"text_extraction_options": {
"remove_line_breaks": true
},
"ocr_language": "english",
"threshold": "auto",
"chunking_options": {
"tokenizer_options": {
"model_name": "text-embedding-3-small"
},
"max_tokens": 123,
"merge_across_pages": true
},
"output_format": "json",
"output_label_options": {
"title_candidate_elements": [
"<string>"
],
"promote_title": false,
"orientation_correction": false
},
"markdown_options": {
"include_pagenum": false,
"include_headers": false,
"include_footers": false
},
"extract_table_structure": true,
"use_ocr": true,
"extract_image_format": "ppm"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aryn.cloud/v1/document/partition', 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.aryn.cloud/v1/document/partition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.aryn.cloud/v1/document/partition"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aryn.cloud/v1/document/partition")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aryn.cloud/v1/document/partition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": [
"<string>"
],
"status_code": 123,
"elements": [
{
"type": "<string>",
"bbox": [
123
],
"properties": {},
"text_representation": "<string>",
"binary_representation": "<string>"
}
],
"markdown": "<string>",
"error": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}"<string>"Partition Document
POST
/
v1
/
document
/
partition
Partition Document
curl --request POST \
--url https://api.aryn.cloud/v1/document/partition \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form 'file_url=<string>' \
--form 'options={
"selected_pages": [
123
],
"extract_images": false,
"image_extraction_options": {
"associate_captions": false,
"extract_image_format": "ppm"
},
"property_extraction_options": {
"schema": [
{
"name": "<string>",
"type": {
"description": "<string>",
"examples": "<array>",
"choices": [
"<string>"
],
"item_type": {}
}
}
],
"voting": false,
"suggest_properties": false,
"suggest_properties_instructions": "<string>"
},
"table_extraction_options": {
"include_additional_text": true,
"model_selection": "pixels > 500 -> deformable_detr; table_transformer"
},
"summarize_images": false,
"pipeline": "standard",
"text_mode": "auto",
"table_mode": "standard",
"text_extraction_options": {
"remove_line_breaks": true
},
"ocr_language": "english",
"threshold": "auto",
"chunking_options": {
"tokenizer_options": {
"model_name": "text-embedding-3-small"
},
"max_tokens": 123,
"merge_across_pages": true
},
"output_format": "json",
"output_label_options": {
"title_candidate_elements": [
"<string>"
],
"promote_title": false,
"orientation_correction": false
},
"markdown_options": {
"include_pagenum": false,
"include_headers": false,
"include_footers": false
},
"extract_table_structure": true,
"use_ocr": true,
"extract_image_format": "ppm"
}'import requests
url = "https://api.aryn.cloud/v1/document/partition"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"file_url": "<string>",
"options": "{
\"selected_pages\": [
123
],
\"extract_images\": false,
\"image_extraction_options\": {
\"associate_captions\": false,
\"extract_image_format\": \"ppm\"
},
\"property_extraction_options\": {
\"schema\": [
{
\"name\": \"<string>\",
\"type\": {
\"description\": \"<string>\",
\"examples\": \"<array>\",
\"choices\": [
\"<string>\"
],
\"item_type\": {}
}
}
],
\"voting\": false,
\"suggest_properties\": false,
\"suggest_properties_instructions\": \"<string>\"
},
\"table_extraction_options\": {
\"include_additional_text\": true,
\"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"
},
\"summarize_images\": false,
\"pipeline\": \"standard\",
\"text_mode\": \"auto\",
\"table_mode\": \"standard\",
\"text_extraction_options\": {
\"remove_line_breaks\": true
},
\"ocr_language\": \"english\",
\"threshold\": \"auto\",
\"chunking_options\": {
\"tokenizer_options\": {
\"model_name\": \"text-embedding-3-small\"
},
\"max_tokens\": 123,
\"merge_across_pages\": true
},
\"output_format\": \"json\",
\"output_label_options\": {
\"title_candidate_elements\": [
\"<string>\"
],
\"promote_title\": false,
\"orientation_correction\": false
},
\"markdown_options\": {
\"include_pagenum\": false,
\"include_headers\": false,
\"include_footers\": false
},
\"extract_table_structure\": true,
\"use_ocr\": true,
\"extract_image_format\": \"ppm\"
}"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('file_url', '<string>');
form.append('options', '{
"selected_pages": [
123
],
"extract_images": false,
"image_extraction_options": {
"associate_captions": false,
"extract_image_format": "ppm"
},
"property_extraction_options": {
"schema": [
{
"name": "<string>",
"type": {
"description": "<string>",
"examples": "<array>",
"choices": [
"<string>"
],
"item_type": {}
}
}
],
"voting": false,
"suggest_properties": false,
"suggest_properties_instructions": "<string>"
},
"table_extraction_options": {
"include_additional_text": true,
"model_selection": "pixels > 500 -> deformable_detr; table_transformer"
},
"summarize_images": false,
"pipeline": "standard",
"text_mode": "auto",
"table_mode": "standard",
"text_extraction_options": {
"remove_line_breaks": true
},
"ocr_language": "english",
"threshold": "auto",
"chunking_options": {
"tokenizer_options": {
"model_name": "text-embedding-3-small"
},
"max_tokens": 123,
"merge_across_pages": true
},
"output_format": "json",
"output_label_options": {
"title_candidate_elements": [
"<string>"
],
"promote_title": false,
"orientation_correction": false
},
"markdown_options": {
"include_pagenum": false,
"include_headers": false,
"include_footers": false
},
"extract_table_structure": true,
"use_ocr": true,
"extract_image_format": "ppm"
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.aryn.cloud/v1/document/partition', 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.aryn.cloud/v1/document/partition",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.aryn.cloud/v1/document/partition"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aryn.cloud/v1/document/partition")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aryn.cloud/v1/document/partition")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_url\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"options\"\r\n\r\n{\r\n \"selected_pages\": [\r\n 123\r\n ],\r\n \"extract_images\": false,\r\n \"image_extraction_options\": {\r\n \"associate_captions\": false,\r\n \"extract_image_format\": \"ppm\"\r\n },\r\n \"property_extraction_options\": {\r\n \"schema\": [\r\n {\r\n \"name\": \"<string>\",\r\n \"type\": {\r\n \"description\": \"<string>\",\r\n \"examples\": \"<array>\",\r\n \"choices\": [\r\n \"<string>\"\r\n ],\r\n \"item_type\": {}\r\n }\r\n }\r\n ],\r\n \"voting\": false,\r\n \"suggest_properties\": false,\r\n \"suggest_properties_instructions\": \"<string>\"\r\n },\r\n \"table_extraction_options\": {\r\n \"include_additional_text\": true,\r\n \"model_selection\": \"pixels > 500 -> deformable_detr; table_transformer\"\r\n },\r\n \"summarize_images\": false,\r\n \"pipeline\": \"standard\",\r\n \"text_mode\": \"auto\",\r\n \"table_mode\": \"standard\",\r\n \"text_extraction_options\": {\r\n \"remove_line_breaks\": true\r\n },\r\n \"ocr_language\": \"english\",\r\n \"threshold\": \"auto\",\r\n \"chunking_options\": {\r\n \"tokenizer_options\": {\r\n \"model_name\": \"text-embedding-3-small\"\r\n },\r\n \"max_tokens\": 123,\r\n \"merge_across_pages\": true\r\n },\r\n \"output_format\": \"json\",\r\n \"output_label_options\": {\r\n \"title_candidate_elements\": [\r\n \"<string>\"\r\n ],\r\n \"promote_title\": false,\r\n \"orientation_correction\": false\r\n },\r\n \"markdown_options\": {\r\n \"include_pagenum\": false,\r\n \"include_headers\": false,\r\n \"include_footers\": false\r\n },\r\n \"extract_table_structure\": true,\r\n \"use_ocr\": true,\r\n \"extract_image_format\": \"ppm\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"status": [
"<string>"
],
"status_code": 123,
"elements": [
{
"type": "<string>",
"bbox": [
123
],
"properties": {},
"text_representation": "<string>",
"binary_representation": "<string>"
}
],
"markdown": "<string>",
"error": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}"<string>"This is the Aryn DocParse API for partitioning (and optionally chunking) a document synchronously.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Was this page helpful?
⌘I
