Scanning Content via REST API
Currently, the only way to use Soteri’s Scanning Service is via the rest API.
Try it out by visiting our API browser!
Soteri’s Scanning Service does not store any user data. All content sent to the Scanning API is immediately discarded after scanning.
Scan a Single File
Using curl:
curl -F file=@"file.txt" https://api.soteri.io/rest/scan
Using python’s Requests library:
import requests
files = {
'file': ('file.txt', open('file.txt', 'rb')),
}
response = requests.post('https://api.soteri.io/rest/scan', files=files)
Scan Multiple Files
The same endpoint can be used to scan multiple files. Please note the Quotas and Limits imposed.
Using curl:
curl -F file=@"file-1.txt" -F file=@"file-2.txt" https://api.soteri.io/rest/scan
Using python’s Requests library:
import requests
files = [
('file', ('file-1.txt', open('file-1.txt', 'rb'))),
('file', ('file-2.txt', open('file-2.txt', 'rb'))),
]
response = requests.post('https://api.soteri.io/rest/scan', files=files)
Request Query Parameters
By default:
Files which have no findings are not included in results. To see the, include them
includeEmpty
query parameter.Files which were skipped (could not be scanned because they were not in a supported file format) are not included in results. To see them, include the
includeSkipped
query parameter.Allow-listed findings are not included in results. To see them, include the
includeAllowlisted
query parameter. For more information on allow-listing, see Allow-listing False Positives.
curl -F file=@"file.txt" https://api.soteri.io/rest/scan?includeEmpty=true&includeSkipped=true&includeAllowlisted=true
Using python’s Requests library:
import requests
params = {
'includeEmpty': 'true',
'includeSkipped': 'true',
'includeAllowlisted': 'true',
}
files = {
'file': ('file.txt', open('file.txt', 'rb')),
}
response = requests.post('https://api.soteri.io/rest/scan', params=params, files=files)
More Complete Examples
More complete examples can be found in our example application repository on Github.