File 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>",
"source_url": "<string>",
"filename": "<string>",
"stix": true
}
'import requests
url = "https://developer.encrata.com/api/lookup/malware/scan"
payload = {
"kind": "<string>",
"content_base64": "<string>",
"source_url": "<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>',
source_url: '<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>',
'source_url' => '<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 \"source_url\": \"<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 \"source_url\": \"<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 \"source_url\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}"
response = http.request(request)
puts response.read_body{
"sha256": "<string>",
"category": "<string>",
"signals": [
"<string>"
]
}Malware
File Scan
Inspect a file for malware and suspicious indicators.
POST
/
api
/
lookup
/
malware
/
scan
File 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>",
"source_url": "<string>",
"filename": "<string>",
"stix": true
}
'import requests
url = "https://developer.encrata.com/api/lookup/malware/scan"
payload = {
"kind": "<string>",
"content_base64": "<string>",
"source_url": "<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>',
source_url: '<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>',
'source_url' => '<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 \"source_url\": \"<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 \"source_url\": \"<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 \"source_url\": \"<string>\",\n \"filename\": \"<string>\",\n \"stix\": true\n}"
response = http.request(request)
puts response.read_body{
"sha256": "<string>",
"category": "<string>",
"signals": [
"<string>"
]
}File Scan analyzes a file for malware and returns a verdict, file hash, and supporting indicators.
The maximum file size is 100 MiB.
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
file.string
The base64-encoded file. Do not include a data URL prefix. Provide this field or
source_url.string
A URL from which Encrata can download the file. Provide this field or
content_base64.string
The original file name.
boolean
Set to
true to include STIX 2.1 output when available. Defaults to false.Example request
FILE_BASE64=$(base64 < document.pdf | 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\":\"file\",\"content_base64\":\"$FILE_BASE64\",\"filename\":\"document.pdf\"}"
Example response
{
"success": true,
"result": {
"scan_id": "scan_01J9W6Q9E8PW4V9N7T3K2M1R5E",
"kind": "file",
"status": "completed",
"verdict": "malicious",
"score": 96,
"sha256": "f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2",
"category": "trojan",
"signals": ["known-malware-hash"],
"data_residency": "us",
"scanned_at": "2026-10-07T09:30:00Z"
},
"message": "Scan completed"
}
File result fields
string
The SHA-256 hash of the scanned file.
string
The detected threat category when available.
string[]
Security signals that contributed to the verdict.
Errors
The API returns400 for invalid input, 401 for a missing or invalid API key, 402 when your account has insufficient credits, 413 when the file exceeds 100 MiB, 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?