Read files
Read any file into Markdown ready for a model (Word, PowerPoint, Excel, PDF, .doc/.ppt/.xls, TXT, Markdown)
POST
/
extract
Read any file into Markdown ready for a model (Word, PowerPoint, Excel, PDF, .doc/.ppt/.xls, TXT, Markdown)
curl --request POST \
--url https://api.eu.doconda.com/v1/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>",
"store": true
}
'import requests
url = "https://api.eu.doconda.com/v1/extract"
payload = {
"file": "<string>",
"store": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file: '<string>', store: true})
};
fetch('https://api.eu.doconda.com/v1/extract', 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.eu.doconda.com/v1/extract",
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>',
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.eu.doconda.com/v1/extract"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.eu.doconda.com/v1/extract")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\",\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/extract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": \"<string>\",\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "extraction",
"document_id": "<string>",
"format": "docx",
"markdown": "<string>",
"chars": 0,
"truncated": true,
"pages": 0
}{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}Authorizations
apiKeysession
Authorization: Bearer ak_eu_…. The prefix is the project's region and must match the server (api.eu / api.us).
Body
application/jsonmultipart/form-data
Response
The text, as Markdown.
Allowed value:
"extraction"Pattern:
^doc_[0-9A-HJKMNP-TV-Z]{26}$Available options:
docx, pptx, xlsx, pdf, doc, ppt, xls, txt, md, png, jpg, gif, webp Headings, lists and tables kept; one section per slide or sheet; page markers in a PDF. Scanned pages and pictures are read with OCR.
Length of the whole text, before any cut.
Required range:
-9007199254740991 <= x <= 9007199254740991true when longer than 2 000 000 characters.
Pages (PDF), slides (PowerPoint) or sheets (Excel).
Required range:
-9007199254740991 <= x <= 9007199254740991⌘I
Read any file into Markdown ready for a model (Word, PowerPoint, Excel, PDF, .doc/.ppt/.xls, TXT, Markdown)
curl --request POST \
--url https://api.eu.doconda.com/v1/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": "<string>",
"store": true
}
'import requests
url = "https://api.eu.doconda.com/v1/extract"
payload = {
"file": "<string>",
"store": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({file: '<string>', store: true})
};
fetch('https://api.eu.doconda.com/v1/extract', 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.eu.doconda.com/v1/extract",
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>',
'store' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.eu.doconda.com/v1/extract"
payload := strings.NewReader("{\n \"file\": \"<string>\",\n \"store\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.eu.doconda.com/v1/extract")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": \"<string>\",\n \"store\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eu.doconda.com/v1/extract")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"file\": \"<string>\",\n \"store\": true\n}"
response = http.request(request)
puts response.read_body{
"object": "extraction",
"document_id": "<string>",
"format": "docx",
"markdown": "<string>",
"chars": 0,
"truncated": true,
"pages": 0
}{
"id": "<string>",
"object": "document",
"name": "<string>",
"operation": "create",
"format": "docx",
"type": "report",
"mode": "prompt",
"sector": "<string>",
"parent_id": "<string>",
"status": "queued",
"phase": "<string>",
"pages": 0,
"style_applied": {
"font": "<string>",
"font_size": 123,
"line_spacing": 123,
"colors": {
"title": "<string>",
"headings": "<string>",
"text": "<string>",
"accent": "<string>"
},
"align": {
"title": "left",
"headings": "left",
"body": "left"
},
"margins_cm": 123,
"orientation": "portrait",
"cover_page": true,
"table_of_contents": true,
"page_numbers": true,
"header": "<string>",
"footer": "<string>"
},
"style_unsupported": [
"<string>"
],
"validation_summary": {
"errors": 0,
"warnings": 0,
"info": 0
},
"repair_summary": {
"iterations": 0,
"applied": 0,
"rejected": 0
},
"error": {
"code": "<string>",
"message": "<string>"
},
"versions": {
"engine": "<string>",
"renderer": "<string>",
"model": "<string>"
},
"metadata": {},
"store": true,
"route": {
"path": "fast",
"reason": "<string>"
},
"quality": {
"requested": "auto",
"level": "fast",
"reason": "<string>"
},
"artifact": {
"storage": "local"
},
"content_deleted_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"outputs": [
{
"id": "<string>",
"kind": "docx",
"content_type": "<string>",
"bytes": 0,
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"page": 0,
"width": 0,
"height": 0
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}{
"type": "<string>",
"title": "<string>",
"status": 0,
"code": "<string>",
"request_id": "<string>",
"errors": [
{
"path": "<string>",
"message": "<string>"
}
]
}