Overview
Cardinal automatically detects and extracts barcodes during processing. For each detected barcode, you’ll receive:image_url
– a cropped image of the detected barcode.bounding_box
– exact coordinates (x_min
,y_min
,x_max
,y_max
, pluswidth
andheight
).original_polygon
– polygon coordinates for the barcode region.barcode_type
– e.g.,Code128
,QR_CODE
,EAN_13
.barcode_value
– decoded string from the barcode.page_number
– the page where the barcode was found.confidence
– detection confidence score.barcode_index
– index of the barcode on the page.

How to Enable
To enable barcode extraction, setbarcodeDetect: true
in your API request.
- Default:
barcodeDetect = false
- To enable barcode extraction, set
barcodeDetect = true
. - ⚠️ Enabling barcode extraction will add latency to your requests, since additional detection passes are run.
Example Response
Bounding box coordinates are provided in the same unit system as other page geometry. Use
page.width
and page.height
from the response to normalize values if you need to scale to your viewer.