import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
job_id = "job_8f3c1a2b9e4d"
result = client.documents.get_structured_result(job_id=job_id)
print(f"Pages: {result.num_pages}, GPU ms: {result.gpu_ms}")
first_page = result.pages[0]
for element in first_page.elements[:3]:
print(f"[{element.label}] {element.text[:80]}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const jobId = "job_9f3c2a7b1d";
const result = await client.documents.getStructuredResult(jobId);
console.log(`Pages: ${result.num_pages}, format: ${result.format}`);
const firstPage = result.pages[0];
for (const element of firstPage.elements) {
console.log(`[${element.label}] ${element.text.slice(0, 80)}`);
}package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
doc, err := client.Documents.GetStructuredResult(context.Background(), "job_8f3c1a2b9d")
if err != nil {
panic(err)
}
fmt.Printf("Pages: %d, mean layout confidence: %.2f\n", doc.NumPages, doc.Confidence.MeanLayoutConfidence)
for _, page := range doc.Pages {
for _, el := range page.Elements {
fmt.Printf("[%s] %s\n", el.Label, el.Text)
}
}
}curl --request GET \
--url https://api.meibel.ai/v2/documents/{job_id}/structured \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/documents/{job_id}/structured', 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/{job_id}/structured",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://api.meibel.ai/v2/documents/{job_id}/structured")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/{job_id}/structured")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"confidence": {
"mean_layout_confidence": 123,
"min_layout_confidence": 123,
"num_elements": 1,
"num_tables": 1
},
"num_pages": 1,
"pages": [
{
"elements": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"confidence": 123,
"label": "Caption",
"reading_order": 1,
"text": "<string>",
"chart_data": {
"categories": [
"<string>"
],
"overall_confidence": 123,
"plot_area": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"series": [
{
"points": [
{
"bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"confidence": 123,
"x": 123,
"x_is_category": true,
"y": 123
}
],
"color": [
1
],
"dash_pattern": [
123
],
"name": "<string>"
}
],
"warnings": [
"<string>"
],
"x_axis": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
},
"title": "<string>",
"y_axis_left": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
},
"y_axis_right": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
}
},
"heading_level": 1,
"ocr_text": [
{
"bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"confidence": 123,
"source": "PdfText",
"text": "<string>"
}
],
"table": {
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"cells": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"col": 1,
"col_span": 1,
"is_header": true,
"row": 1,
"row_span": 1,
"text": "<string>"
}
],
"num_cols": 1,
"num_rows": 1,
"page_number": 1
}
}
],
"page_bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"page_number": 1,
"extracted_page_no": 1,
"image_size": [
"<unknown>"
],
"ocr_applied": false,
"ocr_dpi": 1,
"ocr_reason": "<string>",
"ocr_score": 123,
"orientation_degrees": 0,
"physical_page": 1,
"quadrant": 1,
"sheet_rect": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"transcript_lines": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"number": 1
}
]
}
],
"format": "<string>",
"gpu_ms": 0,
"ocr_pages": 0,
"orientation_pages": 0,
"remote_regions": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get structured parse result
Download the fully structured parse result (the json format): pages, typed elements, tables, chart data, chart OCR text, and bounding boxes. The response schema (StructuredDocument) is defined by the parsing engine and hoisted into this spec by the OpenAPI generator.
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
job_id = "job_8f3c1a2b9e4d"
result = client.documents.get_structured_result(job_id=job_id)
print(f"Pages: {result.num_pages}, GPU ms: {result.gpu_ms}")
first_page = result.pages[0]
for element in first_page.elements[:3]:
print(f"[{element.label}] {element.text[:80]}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const jobId = "job_9f3c2a7b1d";
const result = await client.documents.getStructuredResult(jobId);
console.log(`Pages: ${result.num_pages}, format: ${result.format}`);
const firstPage = result.pages[0];
for (const element of firstPage.elements) {
console.log(`[${element.label}] ${element.text.slice(0, 80)}`);
}package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
doc, err := client.Documents.GetStructuredResult(context.Background(), "job_8f3c1a2b9d")
if err != nil {
panic(err)
}
fmt.Printf("Pages: %d, mean layout confidence: %.2f\n", doc.NumPages, doc.Confidence.MeanLayoutConfidence)
for _, page := range doc.Pages {
for _, el := range page.Elements {
fmt.Printf("[%s] %s\n", el.Label, el.Text)
}
}
}curl --request GET \
--url https://api.meibel.ai/v2/documents/{job_id}/structured \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'GET', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/documents/{job_id}/structured', 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/{job_id}/structured",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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.get("https://api.meibel.ai/v2/documents/{job_id}/structured")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/documents/{job_id}/structured")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"confidence": {
"mean_layout_confidence": 123,
"min_layout_confidence": 123,
"num_elements": 1,
"num_tables": 1
},
"num_pages": 1,
"pages": [
{
"elements": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"confidence": 123,
"label": "Caption",
"reading_order": 1,
"text": "<string>",
"chart_data": {
"categories": [
"<string>"
],
"overall_confidence": 123,
"plot_area": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"series": [
{
"points": [
{
"bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"confidence": 123,
"x": 123,
"x_is_category": true,
"y": 123
}
],
"color": [
1
],
"dash_pattern": [
123
],
"name": "<string>"
}
],
"warnings": [
"<string>"
],
"x_axis": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
},
"title": "<string>",
"y_axis_left": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
},
"y_axis_right": {
"data_range": [
"<unknown>"
],
"pixel_to_data": {
"intercept": 123,
"r_squared": 123,
"slope": 123
},
"ticks": [
{
"label_bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"pixel_pos": 123,
"value": 123
}
],
"title": "<string>",
"unit": "<string>"
}
},
"heading_level": 1,
"ocr_text": [
{
"bbox": {
"pdf": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"pixel": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
}
},
"confidence": 123,
"source": "PdfText",
"text": "<string>"
}
],
"table": {
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"cells": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"col": 1,
"col_span": 1,
"is_header": true,
"row": 1,
"row_span": 1,
"text": "<string>"
}
],
"num_cols": 1,
"num_rows": 1,
"page_number": 1
}
}
],
"page_bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"page_number": 1,
"extracted_page_no": 1,
"image_size": [
"<unknown>"
],
"ocr_applied": false,
"ocr_dpi": 1,
"ocr_reason": "<string>",
"ocr_score": 123,
"orientation_degrees": 0,
"physical_page": 1,
"quadrant": 1,
"sheet_rect": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"transcript_lines": [
{
"bbox": {
"x0": 123,
"x1": 123,
"y0": 123,
"y1": 123
},
"number": 1
}
]
}
],
"format": "<string>",
"gpu_ms": 0,
"ocr_pages": 0,
"orientation_pages": 0,
"remote_regions": 0
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Response
Successful Response
The final output of the pipeline: a fully structured document.
Aggregate confidence scores across all pages.
Show child attributes
Show child attributes
Number of pages in the source document.
x >= 0Per-page structured content.
Show child attributes
Show child attributes
Detected input format (e.g. "pdf", "docx", "markdown"). None for documents processed before this field was added.
Total GPU inference time in milliseconds across all stages (layout detection + table encoder + table decoder + OCR). Zero for non-PDF formats that don't use the ML pipeline.
x >= 0Number of pages that required OCR (had no extractable text).
x >= 0Number of pages where orientation detection applied a non-zero rotation.
x >= 0Number of regions dispatched to remote endpoints (charts, formulas, seals).
x >= 0Was this page helpful?