Skip to main content

This is the official Python client library for ANY.RUN. Automate management of ANY.RUN REST endpoints

Project description

ANY.RUN logo


ANY.RUN SDK

This is the official Python client library for ANY.RUN.
With this library you can interact with the ANY.RUN REST API and automate your workflow quickly and efficiently.

Available features

TI Feeds API

Supports the following feed formats for search:

  • MISP
  • STIX
  • Network iocs

TI Lookup API

  • Look up URLs and file hashes
  • Get threat intelligence data
  • Check indicators of compromise

TI YARA API

  • Search for new IOC using YARA rules
  • Monitor Search progress in real-time
  • Get detailed analysis results

Sandbox API

  • Submit files and URLs for analysis
  • Monitor analysis progress in real-time
  • Get detailed analysis results
  • Manage analysis tasks

Other features

  • Built-in objects iterator
  • Built-in exception handling
  • The same synchronous and asynchronous interface
  • Supports Python 3.9-3.13

The library public interface overview

import os

from anyrun.connectors import SandBoxConnector


def main():
    with SandBoxConnector(api_key) as connector:
        # Initialize the url analysis
        task_id = connector.run_url_analysis('https://any.run')
        print(f'Analysis successfully initialized. Task uuid: {task_id}')
        
        # View analysis status in real time
        for status in connector.get_task_status(task_id):
            print(status)
        
        # Get report results
        report = connector.get_analysis_report(task_id, simplify=True)
        print(report if report else 'No threats were found during the analysis')
        
        # Remove the task from history
        connector.delete_task(task_id)


if __name__ == '__main__':
    # Setup ANY.RUN api key
    api_key = os.getenv('ANY_RUN_Sandbox_API_KEY')
    main()

You can find additional usage examples here

Installation Guide

You can install the SDK using pip or any other package manager

$ pip install anyrun-sdk

Also, you can install the SDK manually using pyproject.toml

$ git clone git@github.com:anyrun/anyrun-sdk.git
$ cd anyrun-sdk
$ python -m pip install .

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Useful links

TI Lookup query Guide
ANY.RUN API documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anyrun_sdk-1.2.2.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anyrun_sdk-1.2.2-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file anyrun_sdk-1.2.2.tar.gz.

File metadata

  • Download URL: anyrun_sdk-1.2.2.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for anyrun_sdk-1.2.2.tar.gz
Algorithm Hash digest
SHA256 6a03e720254287ba78ea514acace6cfbd8a53c9c2d083f50f9f7d7c375ce5073
MD5 26dd0d7d9927da4b3a89f55c2593c2eb
BLAKE2b-256 7cdb30bb205c5bbe0ccfc56edfc5782092a4c2670e3458b7e7b5bb17b7b83997

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyrun_sdk-1.2.2.tar.gz:

Publisher: release-action.yml on anyrun/anyrun-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anyrun_sdk-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: anyrun_sdk-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for anyrun_sdk-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9d543d7b06e1f46b1f4c916d739590a873afabb1063b73cae96b158367f44c41
MD5 197502ec5e7e3dc3c84f39a80d5d46ac
BLAKE2b-256 5c39c2fc42e47730450eee8bffc4393c928a4fca9ba1c60ba45c9af8b2d25416

See more details on using hashes here.

Provenance

The following attestation bundles were made for anyrun_sdk-1.2.2-py3-none-any.whl:

Publisher: release-action.yml on anyrun/anyrun-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page