ballerinax/cloudmersive.virusscan Ballerina library

2.0.0

Overview

The Cloudmersive Virus Scan connector lets Ballerina applications scan files, websites and cloud storage objects for viruses, malware and other content threats using the Cloudmersive Virus Scan API. It supports version v1 of the API, which combines signature-based virus detection with configurable content policies such as blocking executables, scripts, macros and invalid files.

Key features

  • Scan uploaded files for viruses and malware
  • Apply advanced threat rules that block executables, scripts, macros, HTML and unsafe archives, or restrict accepted file types
  • Scan websites for malware, phishing and forced downloads
  • Scan files in Azure Blob Storage, AWS S3, Google Cloud Storage and SharePoint Online without downloading them
  • Run cloud storage scans as batch jobs and retrieve their status and results

Setup guide

To use the connector, you need a Cloudmersive API key.

  1. Sign up for a Cloudmersive account and sign in to the Cloudmersive management portal.

  2. Open the API Keys page and create a new API key, or copy an existing one.

Note: Batch job operations require a Cloudmersive Managed Instance or Private Cloud deployment.

Quickstart

To use the Cloudmersive Virus Scan connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Copy
import ballerina/io;
import ballerinax/cloudmersive.virusscan;

Step 2: Create a Config.toml file

Copy
apiKey = "<Cloudmersive API key>"

Step 3: Create a client

Copy
configurable string apiKey = ?;

final virusscan:Client scanner = check new ({apikey: apiKey});

Step 4: Invoke an operation

Copy
public function main() returns error? {
    byte[] content = check io:fileReadBytes("sample.pdf");
    virusscan:VirusScanResult _ = check scanner->scanFile({inputFile: {fileContent: content, fileName: "sample.pdf"}});
}

Examples

The Cloudmersive Virus Scan connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Upload threat screening - Scans an uploaded file with the basic and advanced scans, reports threats, and checks the linked website.
  2. Cloud blob batch scan - Starts an advanced Azure Blob scan as a batch job and polls its status until it completes.

Import

import ballerinax/cloudmersive.virusscan;Copy

Other versions

See more...

Metadata

Released date: 1 day ago

Version: 2.0.0

License: Apache-2.0


Security

Direct vulnerabilities: No known direct vulnerabilities

Indirect vulnerabilities: 

Checked on 2026-11-21 via OSV.dev


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 42

Current verison: 1


Weekly downloads


Source repository


Keywords

Vendor/Cloudmersive

Area/Security & Identity

Type/Connector


Contributors