curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "kind=bar" \
-F "file=@barcode.png"
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"kind": "bar",
"content_base64": "BASE64_ENCODED_IMAGE",
"filename": "barcode.png"
}'
{
"success": true,
"result": {
"scan_id": "scn_892e7a408e30",
"kind": "bar",
"status": "done",
"verdict": "clean",
"score": 0,
"sha256": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"credits": 1,
"category": "benign",
"confidence": "low",
"data_residency": "global",
"codes": [
{
"format": "code_128",
"payload_type": "text",
"raw": "ENC-2812-TEST",
"verdict": "clean",
"score": 0,
"position": {
"x": 95,
"y": 12,
"width": 585,
"height": 176
}
}
],
"image": {
"format": "png",
"width": 784,
"height": 280,
"size_bytes": 5460,
"detected_type": "png",
"extension": ".png",
"extension_matches": true
},
"checks": [
{
"name": "code_decode",
"status": "ok"
},
{
"name": "link_scans",
"status": "not_applicable",
"reason": "The codes carry no links."
}
],
"coverage": "complete",
"confidence_reason": "Only the built-in checks ran, and they found nothing. Confidence is low because no reputation source had a record of it.",
"assessment": "No threats detected by the checks completed. This is not a guarantee of safety.",
"recommended_action": "allow_with_policy",
"duration_ms": 75,
"signals": [],
"iocs": [
{
"type": "sha256",
"value": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"source": "upload",
"role": "observed"
}
],
"scanned_at": "2026-11-20T05:31:23.329370683Z"
},
"message": "No threats detected by the checks completed. This is not a guarantee of safety."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "That image could not be read. Upload a PNG, JPEG, GIF, WebP, BMP or TIFF image."
}
{
"success": false,
"result": {
"code": "unauthorized",
"reason": "invalid api key"
},
"message": "Please sign in to continue.",
"request_id": "6f1c2a9e-4b7d-4e0a-9c3f-2d8b5e1a7c40"
}
{
"success": false,
"result": {
"code": "insufficient_credits"
},
"message": "You don't have enough credits for this lookup. Top up to continue."
}
{
"success": false,
"result": {
"code": "request_timeout"
},
"message": "The request took too long to arrive. Check your connection and try again; for a large file, send it as multipart/form-data rather than base64."
}
{
"success": false,
"result": {
"code": "payload_too_large"
},
"message": "This image is larger than the 10 MB limit for a scan. Upload a smaller image."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "No barcode detected in this image. At 196 x 70 pixels it is too small for a barcode's thin bars to be read. Upload a larger or closer photo, where the thinnest bars are at least 2 pixels wide."
}
Malware
Barcode Scan
Decode a barcode and inspect its content for security threats.
POST
/
api
/
lookup
/
malware
/
scan
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "kind=bar" \
-F "file=@barcode.png"
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"kind": "bar",
"content_base64": "BASE64_ENCODED_IMAGE",
"filename": "barcode.png"
}'
{
"success": true,
"result": {
"scan_id": "scn_892e7a408e30",
"kind": "bar",
"status": "done",
"verdict": "clean",
"score": 0,
"sha256": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"credits": 1,
"category": "benign",
"confidence": "low",
"data_residency": "global",
"codes": [
{
"format": "code_128",
"payload_type": "text",
"raw": "ENC-2812-TEST",
"verdict": "clean",
"score": 0,
"position": {
"x": 95,
"y": 12,
"width": 585,
"height": 176
}
}
],
"image": {
"format": "png",
"width": 784,
"height": 280,
"size_bytes": 5460,
"detected_type": "png",
"extension": ".png",
"extension_matches": true
},
"checks": [
{
"name": "code_decode",
"status": "ok"
},
{
"name": "link_scans",
"status": "not_applicable",
"reason": "The codes carry no links."
}
],
"coverage": "complete",
"confidence_reason": "Only the built-in checks ran, and they found nothing. Confidence is low because no reputation source had a record of it.",
"assessment": "No threats detected by the checks completed. This is not a guarantee of safety.",
"recommended_action": "allow_with_policy",
"duration_ms": 75,
"signals": [],
"iocs": [
{
"type": "sha256",
"value": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"source": "upload",
"role": "observed"
}
],
"scanned_at": "2026-11-20T05:31:23.329370683Z"
},
"message": "No threats detected by the checks completed. This is not a guarantee of safety."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "That image could not be read. Upload a PNG, JPEG, GIF, WebP, BMP or TIFF image."
}
{
"success": false,
"result": {
"code": "unauthorized",
"reason": "invalid api key"
},
"message": "Please sign in to continue.",
"request_id": "6f1c2a9e-4b7d-4e0a-9c3f-2d8b5e1a7c40"
}
{
"success": false,
"result": {
"code": "insufficient_credits"
},
"message": "You don't have enough credits for this lookup. Top up to continue."
}
{
"success": false,
"result": {
"code": "request_timeout"
},
"message": "The request took too long to arrive. Check your connection and try again; for a large file, send it as multipart/form-data rather than base64."
}
{
"success": false,
"result": {
"code": "payload_too_large"
},
"message": "This image is larger than the 10 MB limit for a scan. Upload a smaller image."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "No barcode detected in this image. At 196 x 70 pixels it is too small for a barcode's thin bars to be read. Upload a larger or closer photo, where the thinnest bars are at least 2 pixels wide."
}
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.
The image can be PNG, JPEG, GIF, WebP, BMP, or TIFF, up to 10 MB and 50
megapixels. Barcodes are read upright, upside down, tilted, or turned 90°, and
every barcode in the image is returned.
To send JSON instead, base64-encode the barcode image into
Text that looks like SQL or script injection isn’t flagged.
See Malware Scan for the shared fields:
A QR code sent as
Authentication
Send your API key asAuthorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Request
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.
Prefer this for large images: it’s about a third smaller than base64.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.The original image file name. Encrata checks it against the real file type:
a PNG named
invoice.pdf, or a name that hides an executable behind an image
extension (scan.png.exe), raises a signal.Example request
Upload the barcode image from disk asmultipart/form-data. Replace barcode.png with the path to your barcode image.
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "kind=bar" \
-F "file=@barcode.png"
content_base64:
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"kind": "bar",
"content_base64": "BASE64_ENCODED_IMAGE",
"filename": "barcode.png"
}'
Example response
A scan of a Code 128 barcode:{
"success": true,
"result": {
"scan_id": "scn_892e7a408e30",
"kind": "bar",
"status": "done",
"verdict": "clean",
"score": 0,
"sha256": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"credits": 1,
"category": "benign",
"confidence": "low",
"data_residency": "global",
"codes": [
{
"format": "code_128",
"payload_type": "text",
"raw": "ENC-2812-TEST",
"verdict": "clean",
"score": 0,
"position": {
"x": 95,
"y": 12,
"width": 585,
"height": 176
}
}
],
"image": {
"format": "png",
"width": 784,
"height": 280,
"size_bytes": 5460,
"detected_type": "png",
"extension": ".png",
"extension_matches": true
},
"checks": [
{
"name": "code_decode",
"status": "ok"
},
{
"name": "link_scans",
"status": "not_applicable",
"reason": "The codes carry no links."
}
],
"coverage": "complete",
"confidence_reason": "Only the built-in checks ran, and they found nothing. Confidence is low because no reputation source had a record of it.",
"assessment": "No threats detected by the checks completed. This is not a guarantee of safety.",
"recommended_action": "allow_with_policy",
"duration_ms": 75,
"signals": [],
"iocs": [
{
"type": "sha256",
"value": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"source": "upload",
"role": "observed"
}
],
"scanned_at": "2026-11-20T05:31:23.329370683Z"
},
"message": "No threats detected by the checks completed. This is not a guarantee of safety."
}
How the verdict is decided
Each barcode gets its ownverdict from the value it holds. The scan’s verdict
is the worst of its barcodes and the image’s own signals, such as a misleading
file name.
| Barcode value | Verdict |
|---|---|
| A product or shipping number, such as an EAN-13 or a Code 128 tracking ID | clean |
| A link | The link is scanned like a URL Scan, and its result is in the barcode’s url_scans. A brand name in a host that isn’t the brand’s own is suspicious. A link to a private address is suspicious and never fetched. A link that can’t be reached is unknown. |
A javascript: or data: link | suspicious: it can run code in the scanning app’s browser. It’s never opened. |
A tel: number | clean, with the number in iocs. |
Barcode result fields
Abar result has the common fields
plus sha256, image, and codes.
The uploaded image:
format, width, height, size_bytes,
detected_type (the real type, read from the file’s bytes), extension (from
filename, such as .png), extension_matches, and second_extension (a
risky extension hidden before the last one). See
QR Code Scan for each field.Every barcode decoded from the image. A successful barcode scan always has at least one.Each item has the same shape as a QR Code Scan
codes item: format, payload_type, raw, payload, final_url,
url_scans, verdict, score, signals, and position (the barcode’s box
in image pixels). Barcodes carry no error_correction or sequence.format | Notes on raw |
|---|---|
code_128, code_39, code_93 | The encoded text. An optional Code 39 check character is kept: ENC2812 with a check character reads ENC2812J. A GS1-128 barcode comes back as code_128. |
codabar | The value without its start and stop characters: A40156B reads 40156. |
itf | The digits, for example a 14-digit shipping code. |
ean_13, ean_8 | The digits, including the check digit. An ISBN-13 comes back as ean_13. |
upc_a, upc_e | The digits. A UPC-A barcode is upc_a with 12 digits, such as 036000291452, not an EAN-13 with a leading 0. |
code_decode (reading the image) and link_scans (scanning the barcodes’
links, not_applicable when there are none). See
Checks and coverage.Signals about the image itself. Each item contains
source, malicious,
detail, and optional severity. source is file for the file name, or
bar when the image holds more than one barcode (a malicious code can be
pasted over a real one).assessment, recommended_action, confidence_reason, coverage,
data_flow, duration_ms, and iocs.
When no barcode is found
If the image has no readable barcode, the scan returns422 with result.code
set to validation_failed, and no scan result. message says why when it can
tell: the image is too small (the thinnest bars need to be at least 2 pixels
wide), or too blurry. Otherwise the barcode may be cropped or partly covered.
{
"success": false,
"result": { "code": "validation_failed" },
"message": "No barcode detected in this image. The image is blurry, which merges a barcode's thin bars together. Retake the photo in focus and hold the camera steady, with the barcode filling most of the frame."
}
bar also returns 422. Send it as kind: qr.
Errors
Errors use the same envelope as successful responses, withsuccess set to
false. Branch on result.code. message is a sentence you can show to
users. The response panel shows an example of each status. Errors aren’t charged.
| Status | result.code | When |
|---|---|---|
400 | validation_failed | No file was attached, the base64 is invalid, or the upload isn’t a PNG, JPEG, GIF, WebP, BMP, or TIFF image. |
401 | unauthorized | The API key is missing or invalid. result.reason is api key required or invalid api key. |
402 | insufficient_credits | Your account has no credits left. |
408 | request_timeout | The upload didn’t arrive within 90 seconds, usually a large base64 body on a slow connection. Send the file as multipart/form-data. |
413 | payload_too_large | The image is larger than 10 MB. It isn’t decoded. |
422 | validation_failed | The image has no readable 1D barcode, is corrupted, or is larger than 50 megapixels. |
429 | rate_limited | You exceeded a rate limit. Retry after the number of seconds in X-Ratelimit-Reset. |
Credits
A scan costs 1 credit for each barcode it decodes: an image with two barcodes costs 2 credits. Scanning the same image again is free and returnscredits: 0.
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-F "kind=bar" \
-F "file=@barcode.png"
curl -X POST "https://developer.encrata.com/api/lookup/malware/scan" \
-H "Authorization: Bearer enc_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"kind": "bar",
"content_base64": "BASE64_ENCODED_IMAGE",
"filename": "barcode.png"
}'
{
"success": true,
"result": {
"scan_id": "scn_892e7a408e30",
"kind": "bar",
"status": "done",
"verdict": "clean",
"score": 0,
"sha256": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"credits": 1,
"category": "benign",
"confidence": "low",
"data_residency": "global",
"codes": [
{
"format": "code_128",
"payload_type": "text",
"raw": "ENC-2812-TEST",
"verdict": "clean",
"score": 0,
"position": {
"x": 95,
"y": 12,
"width": 585,
"height": 176
}
}
],
"image": {
"format": "png",
"width": 784,
"height": 280,
"size_bytes": 5460,
"detected_type": "png",
"extension": ".png",
"extension_matches": true
},
"checks": [
{
"name": "code_decode",
"status": "ok"
},
{
"name": "link_scans",
"status": "not_applicable",
"reason": "The codes carry no links."
}
],
"coverage": "complete",
"confidence_reason": "Only the built-in checks ran, and they found nothing. Confidence is low because no reputation source had a record of it.",
"assessment": "No threats detected by the checks completed. This is not a guarantee of safety.",
"recommended_action": "allow_with_policy",
"duration_ms": 75,
"signals": [],
"iocs": [
{
"type": "sha256",
"value": "fef4c885e9e1c6eff3c04bf5e4b9440c49292e447fd3fae6cda92be16614d9ae",
"source": "upload",
"role": "observed"
}
],
"scanned_at": "2026-11-20T05:31:23.329370683Z"
},
"message": "No threats detected by the checks completed. This is not a guarantee of safety."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "That image could not be read. Upload a PNG, JPEG, GIF, WebP, BMP or TIFF image."
}
{
"success": false,
"result": {
"code": "unauthorized",
"reason": "invalid api key"
},
"message": "Please sign in to continue.",
"request_id": "6f1c2a9e-4b7d-4e0a-9c3f-2d8b5e1a7c40"
}
{
"success": false,
"result": {
"code": "insufficient_credits"
},
"message": "You don't have enough credits for this lookup. Top up to continue."
}
{
"success": false,
"result": {
"code": "request_timeout"
},
"message": "The request took too long to arrive. Check your connection and try again; for a large file, send it as multipart/form-data rather than base64."
}
{
"success": false,
"result": {
"code": "payload_too_large"
},
"message": "This image is larger than the 10 MB limit for a scan. Upload a smaller image."
}
{
"success": false,
"result": {
"code": "validation_failed"
},
"message": "No barcode detected in this image. At 196 x 70 pixels it is too small for a barcode's thin bars to be read. Upload a larger or closer photo, where the thinnest bars are at least 2 pixels wide."
}
Was this page helpful?