PolySwarm RESTful API
RESTful API endpoints for interacting with the PolySwarm Customer APIs.
Getting Started
Using the API
PolySwarm's API provides a RESTful interface for various PolySwarm features. If you'd like to report an issue or provide feedback for this page, please contact customersuccess@polyswarm.io
The PolySwarm API is available at https://api.polyswarm.network/v3
For the rest of this document, the base API URL will not be included in any endpoints (e.g., the branch for search will be described as /v3/search rather than https://api.polyswarm.network/v3/search). You will be responsible for adding the correct base API URL.
The overview of the API Endpoints will include required and optional parameters, with a curl example.
Community (free) users have a limit of 60 calls per hour, Paying Enterprise Customers have a limit of 1000 calls per second. Each feature (i.e. Scanning) may have its own set monthly quota, and utilize a daily or monthly api limit too. See the team's usage page to better understand these numbers.
Authentication
Every API request must include an HTTP Authorization Header with an API key.
Locate the api_key for the User/Team from here
| HTTP Header | Value |
|---|---|
| Authorization | API Key |
Example:
curl -X GET -H "Authorization: $API_KEY" 'https://api.polyswarm.network/v3/search/url?url=https%3A%2F%2Fpolyswarm.io&community=default'Retrieve account information
Account details
/v3/public/accounts/whois
Query Sample
curl https://api.polyswarm.network/v3/public/accounts/whois -H "Authorization: $POLYSWARM_API_KEY"Account features and quotas
/v3/public/accounts
Query Sample
curl https://api.polyswarm.network/v3/public/accounts -H "Authorization: $POLYSWARM_API_KEY"Pagination and Offset Handling
When interacting with paginated endpoints, each page of results consumes one quota unit.
Key Points on Pagination:
- The
has_moreflag indicates whether additional pages of results are available. - If
has_more=true, the response will include an encrypted offset value. - For the first request, specify a
limitparameter (e.g.,limit=50). The server will return anoffsetvalue for the next page in the response. - For subsequent requests, include the
offsetvalue returned by the server in the previous response. The server will always provide the nextoffset, which must be sent back unmodified in subsequent calls.
Example Initial Request
curl -H 'Authorization: <API_KEY>' 'https://api.polyswarm.network/v3/hunt/live/list?limit=50&timeout=30'The response will include an offset value for the next page.
Example Subsequent Request
curl -H 'Authorization: <API_KEY>' 'https://api.polyswarm.network/v3/hunt/live/list?limit=50&timeout=30&offset=<OFFSET>'Note: The offset is an encrypted token generated by the server. Clients must use it as-is and not attempt to modify it.
Hash Search and Collision Handling
For the Hash Search endpoint, the has_more flag will typically return false. However, consider the following:
- A sha256 collision is highly unlikely, but not impossible.
- Collisions are more probable with weaker hash algorithms like md5 or sha1.
To address potential risks:
- Use the
has_moreflag to manage collisions, particularly when working with md5 or sha1. - Decide whether to rely on this flag based on your specific use case and risk tolerance.
Artifact Lookup
To retrieve the results of a scan or sandbox, you can do an artifact lookup. In the scanning/sandboxing sections we will remind you of this.
GET /v3/consumer/submission/default/{artifact_id}
Once the scan has completed the returned window_closed value will be true, if this value is false then the scan is still processing, so you will need to poll periodically.
If the value failed is true then the scan has failed.
Scanning Artifacts
The following are the 3 sequential steps in a Scanning operation:
- POST Inform PolySwarm to start a scan, returns an
artifact_idand pre signed AWS URL that the artifact can be uploaded to - PUT Upload the artifact to the AWS URL location
- PUT Inform PolySwarm that the artifact is uploaded and to start the scan
Lastly, lookup the artifact for the verdict, follow this process here.
URL Scanning
POST /v3/instance
Inform PolySwarm to start a scan, returns an
artifact_idand pre signed AWS URL that the file/url can be uploaded to
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact_name |
string | true | URL value to be scanned. |
artifact_type |
string | true | Defines the type, should be URL. |
scan_config |
string | false | Allows additional time for the scan, default if not provided, default, more-time, most-time. |
url-file |
string | false | Path of the file containing a single line of the URL to be scanned. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
preprocessing |
object | false | Set to {"type": "qrcode"} if the URL is inside a QR Code image. |
Query Sample
curl -X POST -d '{
"artifact_name": "https://www.google.com",
"artifact_type": "URL",
"scan_config": "most-time",
"community": "default"
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/instanceHere is a sample of how to scan a URL that is inside a QR Code image:
curl -X POST -d '{
"artifact_name": "qrcode.png",
"artifact_type": "URL",
"community": "default",
"preprocessing": {"type": "qrcode"}
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/instancePUT https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}
Provide the artifact to upload to the AWS URL.
Query Sample
curl -X PUT '<PRE_SIGNED_AWS_URL>' -d 'content=www.google.com'PUT /v3/instance
Inform PolySwarm the upload is complete and to start the scan.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | true | artifact_id that has been returned by the first POST command. |
Query Sample
curl -X PUT -H "Content-Type: application/json" https://api.polyswarm.network/v3/instance?id=49722305458696948 -H "Authorization: $API_KEY"Lastly, lookup the artifact for the verdict, follow this process here.
File Scanning
POST /v3/instance
Inform PolySwarm to start a scan, returns an
artifact_idand pre signed AWS url that the file needs to be placed into.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact_name |
string | true | Path of the File to be scanned. |
artifact_type |
string | true | Defines the type, should be FILE. |
preprocessing |
object | false | Preprocessing settings to be applied to the artifact. See schema table bellow. |
expiration_window |
int | false | Applies to Private Communities only and affects new uploads. After the configured number of days, the binary file is deleted, but the metadata remains available, so the hash can still be searched. Must be 30 or 180. |
scan_config |
string | false | Allows additional time for the scan, default if not provided, default, more-time, most-time. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Body / Preprocessing Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | true | Either zip, 7zip, base64, pdf, orqrcode. The first two mean the file is a zip that the server has to decompress to then scan the content (only one file inside allowed). pdf means the file is an encrypted PDF that the server decrypts (with password when supplied) before scanning. "qrcode" means the file is a QR Code image with a URL as payload, and you want to scan the URL, not the actual file (artifact_type has to be "URL"). |
password |
string | false | Use this password to decompress the zip file, or to decrypt the PDF when type is pdf. |
|
Query Sample
Scan a file install.exe example:
curl -X POST -d '{
"artifact_name": "install.exe",
"artifact_type": "FILE",
"community": "default"
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/instanceThe file to scan is inside an encrypted zip:
curl -X POST -d '{
"artifact_name": "install.exe",
"artifact_type": "FILE",
"community": "default",
"preprocessing": {"type": "zip", "password": "password"}
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/instanceThe file to scan is an encrypted PDF:
curl -X POST -d '{
"artifact_name": "encrypted.pdf",
"artifact_type": "FILE",
"community": "default",
"preprocessing": {"type": "pdf", "password": "s3cret"}
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/instancePUT https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}
Provide the artifact to upload to the AWS URL.
Query Sample
curl --upload-file ./tests/eicar.yara "<PRE_SIGNED_AWS_URL>"PUT /v3/instance
Inform PolySwarm the upload is complete and to start the scan.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | true | artifact_id that has been returned by the first POST command. |
Query Sample
curl -X PUT https://api.polyswarm.network/v3/instance?id=49722305458696948 -H "Authorization: $API_KEY"Lastly, lookup the artifact for the verdict, follow this process here.
Rescanning Artifacts
POST /v3/consumer/submission/default/rescan/sha256/{sha256}
Other Endpoints include:
/v3/consumer/submission/default/rescan/md5/{md5}and/v3/consumer/submission/default/rescan/sha1/{sha1}
This endpoint can only be used to rescan files, for urls see rescan by id below.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hash-type |
string | false | Hash type to be searched on, default is autodetect. |
scan-config |
string | false | Configuration template to use, provides more time for the results to be returned, default, more-time, most-time. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X POST 'https://api.polyswarm.network/v3/consumer/submission/default/rescan/sha256/5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a?community=default&scan_config=more-time' -H "Authorization: $API_KEY"Lastly, lookup the artifact for the verdict, follow this process here.
Rescanning Artifacts by ID
POST /v3/consumer/submission/{community}/rescan/{id}
Rescan an existing artifact by its
artifact_id(also referred to asinstance_id) rather than by hash. The community (defaultorprivate) is specified as part of the URL path, include this.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community in the URL path. Use default for the public community, or private for your Private Community. |
id |
integer | true | artifact_id of the artifact to rescan. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scan-config |
string | false | Configuration template to use, provides more time for the results to be returned, default, more-time, most-time. |
Query Sample
curl -X POST 'https://api.polyswarm.network/v3/consumer/submission/private/rescan/3147283219576984' -H "Authorization: $API_KEY"Query Sample with scan-config in private
curl -X POST 'https://api.polyswarm.network/v3/consumer/submission/private/rescan/3147283219576984?scan_config=more-time' -H "Authorization: $API_KEY"Lastly, lookup the artifact for the verdict, follow this process here.
Downloading
Download an Artifact
GET /v3/consumer/download/sha256/{sha256}
Other Endpoints include:
/v3/consumer/download/sha256/{md5}and/v3/consumer/download/sha256/{sha1}
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hash-type |
string | false | Hash type to be searched on, default is autodetect. |
destination |
string | false | Local Path where to store the downloaded files. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/consumer/download/sha256/5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a?community=default' -H "Authorization: $API_KEY"Download via id
GET /v3/instance/download
Tip: Can be used to download reports and files from a sandbox detonation, see sandboxing sections to retrieve the
instance_id.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
instance_id |
integer | true | instance_id of the item to download, often provided in the output of a previous query. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/instance/download?instance_id=84432173138232095' -H "Authorization: $API_KEY"Download Bundle
Create the Bundle
POST /v3/bundle
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
instance-ids |
string array | true | The ID's of an instance to include in the bundle archive. |
preserve_filenames |
boolean | false | Preserve the names of the files in the bundle. |
filename |
string | false | Name of the archive that will be created. |
community |
string | true | Define the community either private or public. |
Query Sample
curl -X POST "https://api.polyswarm.network/v3/bundle" \
-H "Authorization: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"instance_ids": ["51375268900310741", "58964500531258633"], "preserve_filenames": true, "filename": "output-archive.zip"}' \Check Status of Bundle
GET /v3/bundle
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | true | The Bundle Task ID Returned in step 1. |
community |
string | true | Define the community either private or public. |
Query Sample
curl -X GET "https://api.polyswarm.network/v3/bundle?id=41476135624684596&community=private" -H "Authorization: $POLYSWARM_API_KEY"Download the Bundle
GET https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}
Note: The previous GET command returns the
PRE_SIGNED_AWS_URLonce the report generation has been completed.
Query Sample
curl -o output-archive.zip -X GET 'https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}'Reporting
Downloading Reports
PolySwarm provides the ability to generate and download HTML/PDF reports for Scanning and Sandboxing, these are separate reports.
The following are the 3 sequential steps in a report generation operation:
- POST Inform PolySwarm to start generating the report.
- GET Poll PolySwarm to understand when the report has finished generating.
- GET Download the report locally once generation is successful.
POST /v3/reports
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
format |
string | true | pdf, html or zip. |
type |
string | true | scan, sandbox, or sandbox_zip. |
community |
string | true | Define the community either private or public. |
template_metadata |
object | false | Choose what to include in the report or zip file, separated by commas. When choosing a PDF or HTML report the options are: analysis, detections, droppedFiles, extractedConfig, fileMetadata, network, summary. If not included in body, the default is all items. EXAMPLE: {"includes":["summary"]}. When choosing a Sandbox ZIP file there are two optional values in the template_metadata, zip_report_ids and sandbox_artifact_type. The zip_report_ids are the ID's of the other reports already created to include in the zip file. The sandbox_artifact_type are a list of sandbox artifacts to include from: report,raw_report,screenshot,recording,dropped_file,memory_dump,pcap and jarm. |
instance_id |
integer | true | Required if generating a scanning report, this is the artifact_id. |
sandbox_task_id |
integer | true | Required if generating a sandboxing report or sandbox zip, this is the sandbox_id. |
Query Sample Scan Report
curl -X POST -d '{"type": "scan", "format": "pdf", "template_metadata": {"includes": ["summary", "detections"]}, "instance_id": "97903321852386706"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reportsQuery Sample Sandbox ZIP File
The below example downloads the report json and the pcap files in a single zip file.
curl -X POST -d '{"type": "sandbox_zip", "format": "zip", "template_metadata": {"sandbox_artifact_types": ["report", "pcap"]}, "sandbox_task_id": "97903321852386706"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reportsGET /v3/reports
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id returned from the previous POST command. |
community |
string | true | Define the community either private or public. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/reports?id=59403308938961820' -H "Authorization: $API_KEY"GET https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}
Note: The previous GET command returns the
PRE_SIGNED_AWS_URLonce the report generation has been completed.
Query Sample
curl -o scan-97903321852386706.pdf -X GET 'https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}'Report Templates
List templates
GET /v3/reports/templates/list
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/reports/templates/list' -H "Authorization: $API_KEY"Create a template
POST /v3/reports/templates
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
template_name |
string | true | Name for the template. |
is_default |
boolean | false | If true this template will be the default template for the team. |
primary_color |
string | false | Six-character hex color code. |
footer_text |
string | false | Text to be displayed in the footer of each page. Up to 100 characters are allowed. |
last_page_text |
string | false | Text to be displayed on the last page. Up to 1000 characters are allowed. |
includes |
string | false | Array list of sections to include in the report. Can be one or more of: "analysis", "detections", "droppedFiles", "extractedConfig", "fileMetadata", "network", "summary". |
Query Sample
curl -X POST -d '{"template_name": "temptest", "primary_color": "ff0000", "includes": ["summary", "detections", "fileMetadata"]}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reports/templatesDelete a templates
DELETE /v3/reports/templates
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template. |
Query Sample
curl -X DELETE 'https://api.polyswarm.network/v3/reports/templates?id=10512439389909571' -H "Authorization: $API_KEY"Get template details
GET /v3/reports/templates
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/reports/templates?id=89035259732911602' -H "Authorization: $API_KEY"Update a template
PUT /v3/reports/templates
NOTE: despite being a PUT endpoint, only fields passed in the JSON body are updated, the remaining fields retain their values.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template. |
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
template_name |
string | true | Name for the template. |
is_default |
boolean | false | If true this template will be the default template for the team. |
primary_color |
string | false | Six-character hex color code. |
footer_text |
string | false | Text to be displayed in the footer of each page. Up to 100 characters are allowed. |
last_page_text |
string | false | Text to be displayed on the last page. Up to 1000 characters are allowed. |
includes |
string | false | Array list of sections to include in the report. Can be one or more of: "summary", "detections", "fileMetadata", "network", "droppedFiles", "extractedConfig", "analysis". |
Query Sample
curl -X PUT -d '{"primary_color": "7bfa7f", "includes": ["summary", "detections", "fileMetadata"]}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" "https://api.polyswarm.network/v3/reports/templates?id=89035259732911602"Upload template logo
PUT /v3/reports/templates/logo
A logo can be provided for an already created template. The image is only used in the first page of the PDF reports. Can be either a PNG or JPEG file, the max size allowed is 40 Kb, and the max resolution 960px x 960px.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template |
Body Parameters
The body has to be the binary data of the image. Max length allowed is 40 Kb.
Header Parameters
| Parameter | Required | Description |
|---|---|---|
Content-Type |
true | Either image/png or image/jpeg |
Query Sample
Having a file logo.jpg in the same folder were curl is executed:
curl -X PUT 'https://api.polyswarm.network/v3/reports/templates/logo?id=89035259732911602' --data-binary @logo.jpg -H "Content-Type: image/jpeg" -H "Authorization: $API_KEY"Delete template logo
DELETE v3/reports/templates/logo
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template. |
Query Sample
curl -X DELETE 'https://api.polyswarm.network/v3/reports/templates/logo?id=89035259732911602' -H "Authorization: $API_KEY"Download template logo
GET v3/reports/templates/logo
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id value of the template. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/reports/templates/logo?id=89035259732911602' -H "Authorization: $API_KEY" --output /Users/John/Documents/logo.jpgLLM Reports
LLM reports provide AI-generated analysis summaries for both scans and sandbox detonations using language models.
For this to work, the team plan must include access to downloads. This feature consumes one unit from the PolySwarm Intelligence quota per report generated, which covers both the create and download steps.
Create LLM Report
POST /v3/reports/llm
Creates an LLM report task that will generate an AI-powered analysis summary. The system automatically detects duplicate pending reports and returns the existing one instead of creating a duplicate.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
instance_id |
integer | false | The artifact_id from a scan submission. Include to add scan results to the LLM report. |
cape_sandbox_task_id |
integer | false | The task ID of a Cape sandbox detonation. Include to add Cape sandbox results to the LLM report. |
triage_sandbox_task_id |
integer | false | The task ID of a Triage sandbox detonation. Include to add Triage sandbox results to the LLM report. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
At least one of
instance_id,cape_sandbox_task_id, ortriage_sandbox_task_idis required. You may combinecape_sandbox_task_idandtriage_sandbox_task_idtogether, optionally alongsideinstance_id, to generate a single unified report from multiple sources.
Query Sample for Scan Report
curl -X POST -d '{"instance_id": "97903321852386706", "community": "default"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reports/llmQuery Sample for Cape Sandbox Report
curl -X POST -d '{"cape_sandbox_task_id": "97903321852386706"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reports/llmQuery Sample for Triage Sandbox Report
curl -X POST -d '{"triage_sandbox_task_id": "97903321852386706"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reports/llmQuery Sample for Combined Cape + Triage Report
curl -X POST -d '{"cape_sandbox_task_id": "97903321852386706", "triage_sandbox_task_id": "12345678901234567"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/reports/llmGet LLM Report
GET /v3/reports/llm
Retrieve the status and details of an LLM report task. Use the
idreturned from the POST request.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id returned from the LLM report POST. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/reports/llm?id=12345678901234567&community=default' -H "Authorization: $API_KEY"Searching
Hash Searching
GET /v3/search/hash/sha256
Other Endpoints include:
/v3/search/hash/md5and/v3/search/hash/sha1
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hash |
string | true | Hash (sha256,md5 or sha1) value to be searched. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
hash-type |
string | false | Hash type to be searched on, default is autodetect. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/search/hash/sha256?hash=5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a&community=default' -H "Authorization: $API_KEY"View Scan History
GET /v3/search/instances
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hash |
string | true | Hash (sha256,md5 or sha1) value to be searched. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/search/instances?hash=95531b268adee781f88c962f4b6d747ed82e1c1a58b636fdd925ca3ce31e9cf5&community=default' -H "Authorization: $API_KEY"Known Good Binaries
Known Good Binaries (KGB) lets PolySwarm instantly recognize trusted, legitimate files. When a submitted or looked-up file exactly matches a trusted catalog by its sha256, PolySwarm marks it Known Good and skips scanning and sandboxing entirely — no scan or API quota is spent on files already known to be safe. Coverage is currently for Windows binaries, with additional platforms planned.
A known-good artifact instance in a scan, sandbox, or search response carries these additional fields:
| Field | Type | Description |
|---|---|---|
state |
string | Friendly bounty-state name. For a known-good artifact this is KNOWN_GOOD. |
known_good |
array | The flagging-feed entries that vouch for the file — one {"tool", "tool_metadata", "created", "updated"} object per feed (for example Microsoft Windows, golden image, NSRL, or a commercial software database). null for a normal artifact. |
polyscore |
number | 0.0 for a known-good binary — the only case that returns a true zero. |
A known-good file is not scanned or sandboxed; the scan and sandbox responses are returned directly from the hash match with a
0.0score.
URL Searching
GET /v3/search/url
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url |
string | true | URL value to be searched. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/search/url?url=https%3A%2F%2Fpolyswarm.io&community=default' -H "Authorization: $API_KEY"Metadata Searching
GET /v3/search/metadata/query
To understand how to build out a Metadata query see the How-To Guide.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | true | Metadata query to search on. |
include |
string | false | Metadata field to include in results. |
exclude |
string | false | Metadata field to exclude in results. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/search/metadata/query?query=artifact.sha256:5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a' -H "Authorization: $API_KEY"Query Sample
The below query searches for artifacts related to emotet and only return the Triage TTP values, making use of the include option.
curl -X GET 'https://api.polyswarm.network/v3/search/metadata/query?include=triage_sandbox_v0.ttp&query=polyunite.malware_family%3AEmotet&community=default' -H "Authorization: $API_KEY"IOC Searching
- Searching for Associated IOCs related to a Hash: This returns IOCs that were observed by our sandbox during analysis. These IP's and Domains are classified as C2 or malicious.
- Searching for Associated Hashes related to an IP, URL, imphash or MITRE TTP: This returns file hashes that were seen communicating with the specified IPs or domains in our sandbox — regardless of whether the communication was malicious or not.
Search for Associated IOCs
GET /v3/ioc/sha256/{sha256}
Other Endpoints include:
/v3/ioc/md5/{md5}and/v3/ioc/sha1/{sha1}. Include the desired hash value in the endpoint to retrieve associated ip,domain, ttp and imphash results.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/ioc/sha256/2a85d68c1c503d9b6efcf124ac7d7afc0f3a8a0543f5d6790ebd978f4e8468bd?community=default' -H "Authorization: $API_KEY"Search for Associated Hashes
GET /v3/ioc/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
imphash |
string | false | imphash to see related hashes. |
domain |
string | false | domain to see related hashes. |
ttp |
string | false | MITRE ttp to see related hashes. |
ip |
string | false | IP to see related hashes. |
Requires at least one of the values imphash, domain, ttp or ip in the query.
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/ioc/search?ip=193.138.218.74&community=default' -H "Authorization: $API_KEY"Sandboxing
List Sandboxes
GET /v3/sandbox/provider/list
List the
provider_slugandvm_slugvalues for sandboxing a file and/or artifact.
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/sandbox/provider/list' -H "Authorization: $API_KEY"Sandboxing a File/URL
Want to know what files types are supported? See here
POST /v3/sandbox/sandboxtask/instance
Inform PolySwarm to start a sandbox, returns an
idvalue in the json and pre signed AWS url that the file needs to be placed into. This is the same process for Sandboxing a File and Sandboxing a URL, as the process for URL will be to upload a file with the URL inside it.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact_name |
string | true | Path to File of the artifact to be sandboxed or URL string. |
artifact_type |
string | true | Defines the type, FILE to Sandbox a file, URL to Sandbox a URL. |
preprocessing |
object | false | Preprocessing settings to be applied to the artifact. See schema table bellow. |
provider_slug |
string | true | Name of the sandbox to detonate on. |
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
vm_slug |
string | true | Slug name for the sandbox vm to use. |
browser |
string | false | Optional value to choose the browser for URL detonation, only edge supported. |
Body / Preprocessing Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | true | Either zip, pdf, or qrcode. zip means the file is a zip that the server has to decompress to then sandbox the content (only one file inside allowed). pdf means the file is an encrypted PDF that the server decrypts (with password when supplied) before sandboxing. "qrcode" means the file is a QR Code image with a URL as payload, and you want to sandbox the URL, not the actual file (artifact_type has to be "URL"). |
password |
string | false | Use this password to decompress the zip file, or to decrypt the PDF when type is pdf. |
Query Sample
Here is a simple sandboxing POST request:
curl -X POST -d '{
"artifact_name": "eicar.txt",
"artifact_type": "FILE",
"community": "default",
"sandbox": "cape"
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/sandbox/sandboxtask/instanceHere is an example using the "preprocessing" argument to send an encrypted zip file:
curl -X POST -d '{
"artifact_name": "target.zip",
"artifact_type": "FILE",
"community": "default",
"sandbox": "cape",
"preprocessing": {"type": "zip", "password": "password"}
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/sandbox/sandboxtask/instanceHere is an example using the "preprocessing" argument to sandbox an encrypted PDF:
curl -X POST -d '{
"artifact_name": "encrypted.pdf",
"artifact_type": "FILE",
"community": "default",
"sandbox": "cape",
"preprocessing": {"type": "pdf", "password": "s3cret"}
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/sandbox/sandboxtask/instancePUT https://s3.us-east-2.amazonaws.com/{PRE_SIGNED_AWS_URL}
Provide the file to upload to the AWS URL.
Query Sample
curl --upload-file ./tests/eicar.txt "<PRE_SIGNED_AWS_URL>"PUT /v3/sandbox/sandboxtask/instance
Inform PolySwarm the upload is complete and to start the sandbox.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
string | true | id that has been returned by the first POST command. |
community |
string | false | private or public values for the community` |
Query Sample
curl -X PUT 'https://api.polyswarm.network/v3/sandbox/sandboxtask/instance?id=49722305458696948' -H "Authorization: $API_KEY"Query Sample
curl -X PUT 'https://api.polyswarm.network/v3/sandbox/sandboxtask/instance?id=49722305458696948&community=private' -H "Authorization: $API_KEY"Sandboxes have multiple returned statuses, these are listed below.
| Status Name | API Status Name | What is it for? |
|---|---|---|
Success |
SUCCEEDED |
Finished processing correctly. |
Started |
STARTED |
Sandbox session has started. |
Collecting Data |
COLLECTING_DATA |
Sandbox session has been successful and data is being collected. |
Failed |
FAILED |
Sandbox session has failed, this can be due to many reasons. |
Pending |
PENDING |
Sandbox session is queued up and ready to start. |
Timed out |
TIMEDOUT |
Sandbox session has timed out and quota has not been reimbursed. |
Delayed |
DELAYED |
Sandbox session has been delayed and will start soon. |
Failed with Quota Reimbursement |
FAILED_REIMBURSED |
Finished processing but failed, quota will be reimbursed. |
Timed out with Quota Reimbursement |
TIMEDOUT_REIMBURSED |
Delayed in the queue for too long, got timed out and then reimbursement. |
Query every 30 seconds to understand if the Sandbox session has been successful, see the Lookup Sandbox Task section below.
Sandboxing an Existing Artifact
POST /v3/sandbox/sandboxtask
Send an existing artifact to be sandboxed by providing its artifact id, and the chosen Sandbox provider.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
artifact_id |
integer | true | artifact_id value for the artifact. |
provider_slug |
string | true | Sandbox provider name. |
community |
string | false | private or public values for the community` |
network_enabled |
boolean | false | true or false defines if you want Internet on Sandbox Detonation. Default true for public communities and false for private ones. |
vm_slug |
string | false | Slug name for the sandbox vm to use. |
Query Sample
curl -X POST -d '{"artifact_id": "66885603025097785", "provider_slug": "cape"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/sandbox/sandboxtaskLookup Sandbox Task
GET /v3/sandbox/sandboxtask
Lookup the results from the specified sandbox task.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
sandbox_task_id |
integer | true | sandbox task id value. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/sandbox/sandboxtask?community=default&sandbox_task_id=29603365297891589' -H "Authorization: $API_KEY"Lookup Latest Sandbox Task
GET /v3/sandbox/sandboxtask/latest
Lookup the results from the most recent sandbox task that was run on the provided sha256 in the provided sandbox.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
sha256 |
string | true | Hash value to lookup. |
sandbox |
string | true | Name of the Sandbox, e.g. cape, triage. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/sandbox/sandboxtask/latest?community=default&sandbox=cape&sha256=5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a' -H "Authorization: $API_KEY"Download Sandbox Artifact
To download Sandbox Artifacts like pcap, jarm or report files follow this section to download via instance_id.
Each file (pcap,report etc) will have its own
instance_id, these can be found by using the "Lookup Sandbox Task" (/v3/sandbox/sandboxtask) command, and each file name will have aninstance_idlisted beside it.
List my Sandbox Tasks
GET /v3/sandbox/sandboxtask/my-tasks
Find all sandbox tasks that you or your team members have run in the chosen date range.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | true | Name of the Community. Simplest to use default for the public community, or private for your Private Community. |
sandbox |
string | false | Name of the sandbox to search on. |
start-date |
string | false | Start date to search. |
end-date |
string | false | End date to search. |
user_account_id |
integer | false | User account that created the sandbox task. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/sandbox/sandboxtask/my-tasks?community=default' -H "Authorization: $API_KEY"Search Sandbox Tasks
GET /v3/sandbox/sandboxtask/list
Find all sandbox tasks associated with a sha256 (i.e. each time that artifact was sandboxed).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sha256 |
string | true | Hash value to find related tasks. |
sandbox |
string | false | Sandbox name to search. |
start_date |
string | false | Start date for the search, i.e. 2024-09-27 (ISO format). |
end_date |
string | false | End date for the search, i.e. 2024-09-27 (ISO format). |
status |
string | false | Status of the sandbox task i.e. PENDING. |
account_id |
integer | false | Account that created the sandbox task. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/sandbox/sandboxtask/list?sha256=5da5a1e3983982a92341953929d4c7726da65fe5125d264dd8932a870f2f154a' -H "Authorization: $API_KEY"Notification Webhooks
Notification webhooks allow you to receive real-time notifications for events in PolySwarm, such as when sandbox analysis completes.
Create a Notification Webhook
POST /v3/notification/webhook
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_uri |
string | true | The URI where notification webhook events should be sent. |
secret |
string | true | The secret key used for HMAC signature verification. |
status |
string | false | Notification webhook status: enabled or disabled (default: enabled) |
events |
array | false | Event types to subscribe to (e.g., ['sandbox_done']) |
Query Sample
curl -X POST -d '{
"webhook_uri": "https://example.com/webhook",
"secret": "your-secret-key",
"status": "enabled",
"events": ["sandbox_done"]
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/notification/webhookGet a Notification Webhook
GET /v3/notification/webhook
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | The ID of the notification webhook. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/notification/webhook?id=12345' -H "Authorization: $API_KEY"Update a Notification Webhook
PUT /v3/notification/webhook
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | The ID of the notification webhook. |
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
webhook_uri |
string | false | The new notification webhook URI. |
secret |
string | false | The new secret for HMAC signing. |
status |
string | false | The new status: enabled or disabled. |
events |
array | false | Event types to subscribe to. |
Query Sample
curl -X PUT -d '{
"webhook_uri": "https://newexample.com/webhook",
"status": "disabled"
}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/notification/webhook?id=12345Delete a Notification Webhook
DELETE /v3/notification/webhook
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | The ID of the notification webhook. |
Query Sample
curl -X DELETE 'https://api.polyswarm.network/v3/notification/webhook?id=12345' -H "Authorization: $API_KEY"List All Notification Webhooks
GET /v3/notification/webhook/list
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | false | Number of results per page (default: 50). |
offset |
string | false | Pagination offset token returned by the server for the next page of results. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/notification/webhook/list?limit=50' -H "Authorization: $API_KEY"Test a Notification Webhook
POST /v3/notification/webhook/test
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | The ID of the notification webhook. |
Query Sample
curl -X POST 'https://api.polyswarm.network/v3/notification/webhook/test?id=12345' -H "Authorization: $API_KEY"Note: When this endpoint is called, a success response is returned, this is a success for the request, it does not mean the webhook url worked.
Hunting with Yara
Managing Yara Rulesets
Create Ruleset
POST /v3/hunt/rule
Create a new ruleset.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
yara |
string | true | Yara values, escape the items. |
name |
string | true | Name of the ruleset. |
description |
string | false | Description for the ruleset. |
Query Sample
curl -X POST -d '{"yara": "\/*\r\n This Yara ruleset is under the GNU-GPLv2 license (http:\/\/www.gnu.org\/licenses\/gpl-2.0.html) and open to any user or organization, as long as you use it under this license.\r\n\r\n*\/\r\n\r\nimport \"pe\"\r\n\r\nrule MirageStrings\r\n{\r\n meta:\r\n description = \"Mirage Identifying Strings\"\r\n author = \"Seth Hardy\"\r\n last_modified = \"2014-06-25\"\r\n \r\n strings:\r\n $ = \"Neo,welcome to the desert of real.\" wide ascii\r\n $ = \"\/result?hl=en&id=%s\"\r\n \r\n condition:\r\n any of them\r\n}\r\n\r\nrule Mirage\r\n{\r\n meta:\r\n description = \"Mirage\"\r\n author = \"Seth Hardy\"\r\n last_modified = \"2014-06-25\"\r\n \r\n condition:\r\n MirageStrings\r\n}\r\n\r\nrule Mirage_APT\r\n{\r\n meta:\r\n Author = \"Silas Cutler\"\r\n Date = \"yyyy\/mm\/dd\"\r\n Description = \"Malware related to APT campaign\"\r\n Reference = \"Useful link\"\r\n \r\n strings:\r\n $a1 = \"welcome to the desert of the real\"\r\n $a2 = \"Mirage\"\r\n $b = \"Encoding: gzip\"\r\n $c = \/\\\/[A-Za-z]*\\?hl=en\/\r\n\r\n condition: \r\n (($a1 or $a2) or $b) and $c\r\n}", "name": "test_rule"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/ruleView Ruleset
GET /v3/hunt/rule
View the contents of the specified ruleset.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | ruleset id value to view the contents. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/rule?id=15862162112430616' -H "Authorization: $API_KEY"List Rulesets
GET /v3/hunt/rule/list
List all rulesets in your account
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | false | Case-insensitive substring match on the ruleset name. |
status |
string | false | active returns only rulesets whose Live Hunt is currently running. |
favorites_only |
integer | false | 1 returns only favorited rulesets. |
exclude_favorites |
integer | false | 1 returns only rulesets that are not favorited. |
has_new_results |
integer | false | 1 returns only rulesets whose new-results counter is positive. |
sort |
string | false | active_first returns rulesets carrying a Live Hunt first. |
community |
string | false | Community to list rulesets from. |
The filters are conjunctive: a ruleset must match every one you send. Note they are spelled with underscores, unlike the hyphenated parameters on the Live Hunt results endpoint. Booleans are sent as
1/0.
favorites_onlyandexclude_favoritesare inverses of each other. Sending both is a contradiction and is refused with a400, not answered with an empty list.
Sorting
sort=active_first returns the rulesets that carry a Live Hunt first, newest
first within each block. Omit it and the default order is newest first.
active_first is the only value the endpoint accepts — any other value is
refused rather than quietly ignored:
{"status": "error", "errors": null, "result": "Invalid sort: only 'active_first' is supported."}The sort is applied server-side across the whole result set, not per page. An
offset obtained under one order is not valid under the other; the endpoint
refuses a cursor minted under a different sort.
Read
livescan_id, not the position. The active-first rank uses the ruleset's stored hunt link, which is a broader test than the onelivescan_idis rendered under. An older ruleset whose Live Hunt was stopped without clearing that link sorts into the leading block while still serializinglivescan_idasnull. Use the field to decide whether a ruleset is running.
Dedupe by
idwhen paging. The active-first key changes as hunts start and stop. A ruleset whose hunt stops part-way through your walk drops into the idle block and is returned twice; one that starts part-way through moves up and is skipped for the rest of that walk. Starting again from the first page does not avoid this. Theidon each row is unique and safe to dedupe with, but it is unordered, so never use it to resume or bound a walk.
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/rule/list' -H "Authorization: $API_KEY"curl -X GET 'https://api.polyswarm.network/v3/hunt/rule/list?status=active&favorites_only=1' -H "Authorization: $API_KEY"Response Fields
Alongside the ruleset's identity, each row carries its tracking state:
| Field | Type | Description |
|---|---|---|
favorite |
boolean | Whether the ruleset is starred by your team. |
favorited_at |
string | When it was starred, or null. |
rule_count |
integer | Number of rules in the ruleset body. null means the server has no count. |
historical_hunt_count |
integer | Number of Historical Hunts started from this ruleset. |
new_results_count |
integer | Live results collected in the product window. null means not yet refreshed. |
new_results_counted_at |
string | When the counter was last refreshed, or null. |
new_results_countis a stored counter that PolySwarm refreshes on a schedule rather than a live count, and there is no per-request window parameter.new_results_counted_atmarks when it was last refreshed. Anullcount means "no answer"; it is not the same as0.
Update Ruleset
PUT /v3/hunt/rule
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | ruleset_id that needs to be updated. |
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | false | New updated name for the ruleset. |
file |
string | false | New updated yara values, escaped. |
description |
string | false | New updated description. |
Query Sample
curl -X PUT -d '{"yara": "\/*\r\n This Yara ruleset is under the GNU-GPLv2 license (http:\/\/www.gnu.org\/licenses\/gpl-2.0.html) and open to any user or organization, as long as you use it under this license.\r\n\r\n*\/\r\n\r\nimport \"pe\"\r\n\r\nrule MirageStrings\r\n{\r\n meta:\r\n description = \"Mirage Identifying Strings\"\r\n author = \"Seth Hardy\"\r\n last_modified = \"2014-06-25\"\r\n \r\n strings:\r\n $ = \"Neo,welcome to the desert of real.\" wide ascii\r\n $ = \"\/result?hl=en&id=%s\"\r\n \r\n condition:\r\n any of them\r\n}\r\n\r\nrule Mirage\r\n{\r\n meta:\r\n description = \"Mirage\"\r\n author = \"Seth Hardy\"\r\n last_modified = \"2014-06-25\"\r\n \r\n condition:\r\n MirageStrings\r\n}\r\n\r\nrule Mirage_APT\r\n{\r\n meta:\r\n Author = \"Silas Cutler\"\r\n Date = \"yyyy\/mm\/dd\"\r\n Description = \"Malware related to APT campaign\"\r\n Reference = \"Useful link\"\r\n \r\n strings:\r\n $a1 = \"welcome to the desert of the real\"\r\n $a2 = \"Mirage\"\r\n $b = \"Encoding: gzip\"\r\n $c = \/\\\/[A-Za-z]*\\?hl=en\/\r\n\r\n condition: \r\n (($a1 or $a2) or $b) and $c\r\n}", "name": "yytest_rule4444"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/rule?id=15862162112430616Favorite Ruleset
PUT /v3/hunt/rule/favorite
Star or unstar a ruleset. The call is idempotent and works while a Live Hunt is running.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
community |
string | false | Community the ruleset belongs to. |
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | ruleset_id to star or unstar. |
favorite |
integer | true | 1 to star, 0 to unstar. |
idandfavoritemust be sent in the body. Sendingidin the query string is rejected withA valid rule id must be provided.communitygoes in the query string, and must not be sent in both places at once.
Query Sample
curl -X PUT -d '{"id":"46961337172843885","favorite":1}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" 'https://api.polyswarm.network/v3/hunt/rule/favorite'Response
{"result": {"id": "46961337172843885", "favorite": true, "favorited_at": "2026-08-25T18:23:56.845109+00:00", "favorites_used": 1, "favorites_limit": 5}, "status": "OK"}Favorites are shared by your whole team and the number you can hold at once is
capped, so the response reports the team's usage against that cap. Starring a
ruleset once the budget is spent returns an HTTP 400 carrying a
machine-readable code and the same two counters:
{"status": "error", "errors": {"code": "FAVORITE_LIMIT", "favorites_used": 5, "favorites_limit": 5}}Match on the code rather than on the human-readable message.
Delete Ruleset
DELETE /v3/hunt/rule
Delete the given ruleset.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | ruleset_id value to delete. |
Query Sample
curl -X DELETE 'https://api.polyswarm.network/v3/hunt/rule?id=15862162112430616' -H "Authorization: $API_KEY"Live Hunts
Start Live Hunt
POST /v3/hunt/rule/live
Start a Live Hunt using the given ruleset.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
rule_id |
integer | true | rule_id of the ruleset to start a live hunt. |
Query Sample
curl -X POST -d '{"rule_id":"6992666340481223"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/rule/liveStop Live Hunt
DELETE /v3/hunt/rule/live
Stop the Live Hunt on a given ruleset.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
rule_id |
integer | true | rule_id of the ruleset to stop a live hunt/ |
Query Sample
curl -X DELETE -d '{"rule_id":"6992666340481223"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/rule/liveView Live Results of a Live Hunt
GET /v3/hunt/live/list
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
since |
integer | false | Time value (in seconds) for how far back to request results. |
livescan_id |
integer | false | Scope the results to a single Live Hunt. |
rule-name |
integer | false | Name of the ruleset being used in the hunt. |
family |
string | false | Filter results based on the family name. |
community |
string | false | Filter results based community. |
polyscore-lower |
string | false | Polyscore lower bound for the hunt results. |
polyscore-upper |
string | false | Polyscore upper bound for the hunt results. |
There is no default window. Omit
since, or send0, and no time filter is applied at all: the endpoint pages over the whole retained history.
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/live/list?polyscore-upper=0.99' -H "Authorization: $API_KEY"curl -X GET 'https://api.polyswarm.network/v3/hunt/live/list?livescan_id=72927285313305230' -H "Authorization: $API_KEY"View a Singular Result
GET /v3/hunt/live
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | Provide the result id value. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/live?id=75570120079919313' -H "Authorization: $API_KEY"Response Fields
Alongside the result's metadata and download link, this endpoint returns the yara strings behind the hit:
| Field | Type | Description |
|---|---|---|
matched_strings |
array | The yara strings that made the rule fire. See Matched Strings. |
matched_strings_dropped |
integer | How many matched strings the server's size budget withheld from this result. |
Delete Live Result
DELETE /v3/hunt/live/list
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
result_ids |
integer | true | List of ruleset_ids for the live hunt results to be deleted. |
Query Sample
curl -X DELETE -d '{"result_ids":["66625018770158663"]}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/live/listHistorical Hunts
Start a Historical Hunt
POST /v3/hunt/historical
start a new Historical Hunt using the provided yara rules or existing ruleset file.
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
rule_id |
integer | true | rule_id of the ruleset to start a historical hunt. |
yara |
string | true | Path of the yara file to start a historical hunt. |
Either
rule_idoryarais required in the call.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | false | Name of the ruleset to start an historical hunt. |
Query Sample
curl -X POST -d '{"rule_id":"24285974317896172"}' -H "Content-Type: application/json" -H "Authorization: $API_KEY" https://api.polyswarm.network/v3/hunt/historicalCancel an Historical Hunt
PUT /v3/hunt/historical
Stop a Historical Hunt. If it's already running, it will stop at the next batch interval.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | id of the historical hunt to stop. |
Query Sample
curl -X PUT 'https://api.polyswarm.network/v3/hunt/historical?' -H "Authorization: $API_KEY"List Historical Hunts
GET /v3/hunt/historical/list
List the Historical Hunts in your account.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
since |
integer | false | Value in seconds to look for Historical Hunts. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/historical/list' -H "Authorization: $API_KEY"View Historical Hunt Details for a Hunt
GET /v3/hunt/historical
Provides ability to download results as a csv file and see the ruleset contents.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | historical hunt id to view details. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/historical?id=75570120079919313' -H "Authorization: $API_KEY"Response Fields
Alongside the hunt's status and results, the response records which ruleset the hunt came from:
| Field | Type | Description |
|---|---|---|
rule_id |
integer | The ruleset the hunt was started from, or null for a hunt started from raw Yara. |
rule_modified |
string | When that ruleset was last modified, captured when the hunt froze its copy. |
source_rule_changed |
boolean | Whether the source ruleset has been edited since the hunt froze its copy. |
source_rule_changedhas three states, not two.trueandfalseanswer the question;nullmeans the server could not answer it, because the hunt was started from raw Yara or predates provenance tracking. Do not rendernullas "unchanged" -rule_idisnullfor those same hunts.
View Historical Hunt Results
GET /v3/hunt/historical/results/list
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | Historical hunt id. |
rule-name |
integer | false | Ruleset name to filter results. |
family |
integer | false | Family name to filter results. |
community |
string | false | Filter results based community. |
polyscore-lower |
integer | false | Polyscore lower bound for the results. |
polyscore-upper |
integer | false | Polyscore upper bound for the results. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/historical/results/list?id=75570120079919313' -H "Authorization: $API_KEY"View a Singular Historical Hunt Result
GET /v3/hunt/historical/results
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | result_id value to view single result. |
Query Sample
curl -X GET 'https://api.polyswarm.network/v3/hunt/historical/results?id=75570120079919313' -H "Authorization: $API_KEY"Response Fields
This endpoint returns matched_strings and matched_strings_dropped in the
same shape as the Live Hunt singular result above. See
Matched Strings.
Delete a Historical Hunt
DELETE /v3/hunt/historical
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | true | hunt id of the historical hunt to delete it. |
Query Sample
curl -X DELETE 'https://api.polyswarm.network/v3/hunt/historical?id=1371741361996923' -H "Authorization: $API_KEY"Delete Historical Hunt Results
DELETE /v3/hunt/historical/results/live
Body Schema (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
result_ids |
integer | true | ruleset_id of the historical hunt to delete results from it. |
Query Sample
curl -X DELETE -d '{"result_ids":["66625018770158663"]}' -H "Content-Type: application/json" https://api.polyswarm.network/v3/hunt/historical/results/list -H "Authorization: $API_KEY"Matched Strings
Hunt results carry the yara strings that made the rule fire, so a result shows why a rule matched rather than only which rule it was. Both the Live Hunt and Historical Hunt singular-result endpoints return the same two fields.
"matched_strings": [{"offset": 69, "identifier": "$u", "length": 9, "data": "test_live", "truncated": false}],
"matched_strings_dropped": 0| Key | Type | Description |
|---|---|---|
offset |
integer | Where in the file the string matched. |
identifier |
string | The yara string that matched, for example $u. |
length |
integer | The stored length, which is capped. Past the cap the true length is unrecoverable. |
data |
string | The matched bytes, exactly as yara rendered them. |
truncated |
boolean | Whether there was more than what data shows. |
data is left exactly as yara rendered it and is deliberately not decoded: a
hex string comes back as byte pairs, a text string as ASCII with \xNN
escapes, and only yara knows which applies. truncated over-reports at exactly
the cap, because nothing in the output distinguishes a match that ended there
from one that was cut short.
Matched strings are only on the singular-result endpoints.
/v3/hunt/live/listand/v3/hunt/historical/results/listalways sendnullfor both fields rather than fetch the evidence for every row. Request the single result to get the strings.
Reading the three states
matched_strings has three states, and collapsing them will give you the wrong
answer:
| Value | What it means |
|---|---|
null |
Not reported. You are on a list endpoint, you are looking at a delete response, the evidence was deleted, or the server predates the field. It means "we don't know", never "there was nothing". |
[] |
The rule matched and there is no byte evidence to show — a rule with no strings section, one whose matching strings are all private, or one that matched on absence, such as not $a or none of them. |
[...] |
The evidence. Treat it as a lower bound, not a match count: any of them prints only the strings that hit, private strings never appear, and some may be withheld past a size limit. |
matched_strings_dropped exists so that a shortened list is not mistaken for a
complete one — a consumer reading twelve entries would otherwise conclude the
rule hit twelve times when it hit thirty-one. A non-null count always means "the
list you have is short by this much", and it never accompanies an empty list,
because the first string of a match is never withheld.
A null count carries the same ambiguity as the list itself. On a
singular-result endpoint it means nothing was withheld; anywhere else it means
nothing looked. It is never a promise that the evidence is complete.