Barcode Scan
curl --request POST \
--url https://developer.encrata.com/api/lookup/malware/scan \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"content_base64": "<string>",
"filename": "<string>",
"stix": true
}
'import requests
url = "https://developer.encrata.com/api/lookup/malware/scan"
payload = {
"kind": "<string>",
"content_base64": "<string>",
"filename": "<string>",
"stix": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({kind: '<string>', content_base64: '<string>', filename: '<string>', stix: true})
};
fetch('https://developer.encrata.com/api/lookup/malware/scan', 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://developer.encrata.com/api/lookup/malware/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => '<string>',
'content_base64' => '<string>',
'filename' => '<string>',
'stix' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer.encrata.com/api/lookup/malware/scan"
payload := strings.NewReader("{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://developer.encrata.com/api/lookup/malware/scan")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/lookup/malware/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}"
response = http.request(request)
puts response.read_body{
"codes": [
{}
],
"signals": [
"<string>"
]
}Malware
Barcode Scan
Decode a barcode and inspect its content for security threats.
POST
/
api
/
lookup
/
malware
/
scan
Barcode Scan
curl --request POST \
--url https://developer.encrata.com/api/lookup/malware/scan \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"kind": "<string>",
"content_base64": "<string>",
"filename": "<string>",
"stix": true
}
'import requests
url = "https://developer.encrata.com/api/lookup/malware/scan"
payload = {
"kind": "<string>",
"content_base64": "<string>",
"filename": "<string>",
"stix": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({kind: '<string>', content_base64: '<string>', filename: '<string>', stix: true})
};
fetch('https://developer.encrata.com/api/lookup/malware/scan', 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://developer.encrata.com/api/lookup/malware/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'kind' => '<string>',
'content_base64' => '<string>',
'filename' => '<string>',
'stix' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer.encrata.com/api/lookup/malware/scan"
payload := strings.NewReader("{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://developer.encrata.com/api/lookup/malware/scan")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer.encrata.com/api/lookup/malware/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"kind\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}"
response = http.request(request)
puts response.read_body{
"codes": [
{}
],
"signals": [
"<string>"
]
}Barcode Scan decodes a base64-encoded image and checks the extracted value for suspicious content.
See Malware Scan for the complete response schema and shared fields.
Authentication
Send your API key asAuthorization: Bearer <key>.
Request
string
required
Set this value to
bar.string
required
The base64-encoded barcode image. Do not include a data URL prefix.
string
The original image file name.
boolean
Set to
true to include STIX 2.1 output when available. Defaults to false.Example request
BARCODE_BASE64=$(base64 < barcode.png | tr -d '\n')
curl --request POST \
--url https://api.encrata.com/api/lookup/malware/scan \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $ENCRATA_API_KEY" \
--data "{\"kind\":\"bar\",\"content_base64\":\"$BARCODE_BASE64\",\"filename\":\"barcode.png\"}"
Example response
{
"success": true,
"result": {
"scan_id": "scan_01J9W6Q9E8PW4V9N7T3K2M1R5C",
"kind": "bar",
"status": "completed",
"verdict": "clean",
"score": 0,
"codes": [
{
"format": "CODE_128",
"text": "ENCRATA-123456"
}
],
"data_residency": "us",
"scanned_at": "2026-10-07T09:30:00Z"
},
"message": "Scan completed"
}
Barcode result fields
object[]
Codes decoded from the image, including each code’s format and text.
string[]
Security signals found in the decoded content.
Errors
The API returns400 for invalid base64 content 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.Was this page helpful?