Overview
When extracting content with layout information, Pulse API returns bounding box coordinates for text, tables, and images. This spatial data enables precise document understanding and region-based extraction.Bounding Box Format
Bounding boxes are returned as normalized coordinates (0-1 range) in an 8-point format:- (x1, y1) = Top-left corner
- (x2, y2) = Top-right corner
- (x3, y3) = Bottom-right corner
- (x4, y4) = Bottom-left corner
Coordinates are normalized to 0-1 range, making them resolution-independent. To convert to pixels, multiply by the page width/height.
Response Structure
Thebounding_boxes object in the extraction response contains:
Not all fields will be present in every response. The API only includes arrays for elements that were detected in the document.
Markdown Fields
| Field | Location | Description |
|---|---|---|
markdown | Top-level response | Clean markdown content without any ID attributes |
markdown_with_ids | Inside bounding_boxes | Markdown with data-bb-* ID attributes that link text to bounding box elements |
bounding_boxes.markdown_with_ids when you need to correlate text positions with bounding boxes. Use the top-level markdown for clean content display or export.
Example Response
Here’s a real example of thebounding_boxes object:
Field Descriptions
Text Array
Each text element contains:id: Unique identifier (e.g.,txt-1) that links tomarkdown_with_idsviadata-bb-text-idcontent: The extracted text with prefix (e.g.,0a-NCRI)original_content: The clean extracted text without prefixbounding_box: 8-point coordinate array (may benullfor some document types)page_number: Page where the text appearsaverage_word_confidence: OCR confidence score (0-1)
Title Array
Each title element contains:id: Unique identifier linking to markdowncontent: The title text with prefixoriginal_content: The clean title textbounding_box: 8-point coordinate arraypage_number: Page where the title appearsaverage_word_confidence: OCR confidence score (0-1)
Header Array
Each header element contains:id: Unique identifier linking to markdowncontent: The header text with prefixoriginal_content: The clean header textbounding_box: 8-point coordinate arraypage_number: Page where the header appearsaverage_word_confidence: OCR confidence score (0-1)
Footer Array
Each footer element contains:id: Unique identifier linking to markdowncontent: The footer text with prefixoriginal_content: The clean footer textbounding_box: 8-point coordinate arraypage_number: Page where the footer appearsaverage_word_confidence: OCR confidence score (0-1)
Images Array
Each image element contains:id: Unique identifier (e.g.,img-1)bounding_box: 8-point coordinate arraypage_number: Page where the image appearsconfidence: Detection confidence (if available)
Tables Array
Each table element contains:id: Unique identifier (e.g.,tbl-1)bounding_box: 8-point coordinate arraypage_number: Page where the table appearscontent: Table content (in HTML format)
Page Number Array
Each page number element contains:id: Unique identifiercontent: The page number textoriginal_content: The clean page number textbounding_box: 8-point coordinate arraypage_number: Page where it appearsaverage_word_confidence: OCR confidence score (0-1)
Tables are extracted and returned in HTML format, preserving the structure and making it easy to parse or display.
The
id field allows you to link bounding box elements to specific locations in the markdown_with_ids field via data-bb-text-id attributes.