from meibel import MeibelClient
client = MeibelClient(api_key="your-api-key")
# Upload a file
with open("document.pdf", "rb") as f:
result = client.documents.submit_deep_transform(file=f, filename="document.pdf")
print(result)import { MeibelClient } from 'meibel';
const client = new MeibelClient({ apiKey: 'your-api-key' });
import fs from 'fs';
// Upload a file
const file = fs.createReadStream('document.pdf');
const result = await client.documents.submitDeepTransform(file, 'document.pdf');
console.log(result);import v2 "github.com/meibel-ai/meibel-go/v2"
client := v2.NewClient(v2.WithAPIKey("your-api-key"))
ctx := context.Background()
// Upload a file
f, err := os.Open("document.pdf")
if err != nil {
log.Fatal(err)
}
defer f.Close()
result, err := client.Documents.SubmitDeepTransform(ctx, f, "document.pdf", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)curl --request POST \
--url https://api.meibel.ai/v2/documents/deep-transform \
--header 'Content-Type: multipart/form-data' \
--header 'Meibel-API-Key: <api-key>' \
--form file='@example-file' \
--form 'schema=<string>' \
--form 'root_name=<string>' \
--form 'guidance=<string>' \
--form max_pages=123const form = new FormData();
form.append('file', '<string>');
form.append('schema', '<string>');
form.append('root_name', '<string>');
form.append('guidance', '<string>');
form.append('max_pages', '123');
const options = {method: 'POST', headers: {'Meibel-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.meibel.ai/v2/documents/deep-transform', 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.meibel.ai/v2/documents/deep-transform",
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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/documents/deep-transform")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/deep-transform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Submit a deep-transform extraction (async)
Submit an extraction against a JSON schema and return immediately with a job id. Provide the document either as a multipart/form-data upload (file) or, to reuse an existing parse, as an application/json body with a document_job_id from POST /documents (the document is not re-parsed). Poll status via GET /documents/deep-transform/ and download artifacts once it succeeds. Submission is idempotent on the (document, schema) pair.
from meibel import MeibelClient
client = MeibelClient(api_key="your-api-key")
# Upload a file
with open("document.pdf", "rb") as f:
result = client.documents.submit_deep_transform(file=f, filename="document.pdf")
print(result)import { MeibelClient } from 'meibel';
const client = new MeibelClient({ apiKey: 'your-api-key' });
import fs from 'fs';
// Upload a file
const file = fs.createReadStream('document.pdf');
const result = await client.documents.submitDeepTransform(file, 'document.pdf');
console.log(result);import v2 "github.com/meibel-ai/meibel-go/v2"
client := v2.NewClient(v2.WithAPIKey("your-api-key"))
ctx := context.Background()
// Upload a file
f, err := os.Open("document.pdf")
if err != nil {
log.Fatal(err)
}
defer f.Close()
result, err := client.Documents.SubmitDeepTransform(ctx, f, "document.pdf", nil)
if err != nil {
log.Fatal(err)
}
fmt.Println(result)curl --request POST \
--url https://api.meibel.ai/v2/documents/deep-transform \
--header 'Content-Type: multipart/form-data' \
--header 'Meibel-API-Key: <api-key>' \
--form file='@example-file' \
--form 'schema=<string>' \
--form 'root_name=<string>' \
--form 'guidance=<string>' \
--form max_pages=123const form = new FormData();
form.append('file', '<string>');
form.append('schema', '<string>');
form.append('root_name', '<string>');
form.append('guidance', '<string>');
form.append('max_pages', '123');
const options = {method: 'POST', headers: {'Meibel-API-Key': '<api-key>'}};
options.body = form;
fetch('https://api.meibel.ai/v2/documents/deep-transform', 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.meibel.ai/v2/documents/deep-transform",
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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data; boundary=---011000010111000001101001",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/documents/deep-transform")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
.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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/deep-transform")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'multipart/form-data; boundary=---011000010111000001101001'
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=\"schema\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"root_name\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"guidance\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"max_pages\"\r\n\r\n123\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"job_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
Document file to extract from
JSON Schema (as a JSON string) of the entities to extract
Name of the root entity in the schema. Optional: resolved from the schema's title or inferred when omitted.
Optional domain guidance for the extraction
Optional cap on the number of pages to process
Response
Successful Response
Poll status via GET /documents/deep-transform/{job_id}
Was this page helpful?