Skip to main content
POST
Barcode Scan decodes an uploaded image and checks the extracted value for suspicious content. It reads Code 128/39/93, Codabar, ITF, EAN-8/13, and UPC-A/E barcodes.

Authentication

Send your API key as Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Request

string
required
Set this value to bar.
file
The barcode image to scan, uploaded as multipart/form-data. Send this field or content_base64. When you omit filename, the uploaded file’s name is used.
string
For a JSON body, send this field or file. The base64-encoded barcode image. Send raw base64 only. A data URL prefix such as data:image/png;base64, returns 400.
string
The original image file name.
boolean
Set to true to include STIX 2.1 output when available. Defaults to false.

Example request

Upload the barcode image from disk as multipart/form-data. Replace barcode.png with the path to your barcode image.
To send JSON instead, base64-encode the barcode image into content_base64:

Example response

Barcode result fields

A bar result can contain these fields: scan_id, kind, status, verdict, score, sha256, category, confidence, data_residency, codes, image, signals, iocs, and scanned_at.
object[]
Every barcode decoded from the image. Missing when no barcode could be read. Each item has the same shape as a QR Code Scan codes item: format, payload_type, raw, final_url, verdict, score, signals, and position. format is the lowercase barcode name, such as code_128, ean_13, or upc_a.
object[]
Evidence for the verdict. Each item is an object with source, malicious, detail, and optional severity.

When no barcode is found

If the image has no readable barcode, the scan still returns 200 with verdict: "unknown", no codes field, and a bar signal with the detail “No barcode could be read in this image.” See Malware Scan for the complete response schema and shared fields.

Errors

The API returns 400 for invalid base64 content (including a data: URL prefix) or an unreadable image, 401 for a missing or invalid API key, 402 when your account has insufficient credits, and 429 when you exceed a rate limit.

Credits

A successful scan costs 1 credit. Repeating the same scan kind and content is deduplicated for billing.