# VirusTotal Analysis (`ruturaj04/virustotal`) Actor

This Actor Analysis Single or Multiple URLs whether they are criminal ip or malicious website also its output show in json getting scanned link along with screenshot to help see its data. Its Usage via virustotal APi along if not provided it can do result showing via default without API as well

- **URL**: https://apify.com/ruturaj04/virustotal.md
- **Developed by:** [Ruturaj Sharbidre](https://apify.com/ruturaj04) (community)
- **Categories:** Automation
- **Security:** Limited permissions
- **Stats:** 12 total users, 0 monthly users, 96.8% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## VirusTotal Project

A powerful tool to scan and analyze URLs using VirusTotal. This project supports a **Hybrid Mode**, allowing it to function both with an official API Key and via browser-based scraping.

### Features

- **Hybrid Scanning Mode**:
  - **API Mode**: Uses the official `vt-py` library for fast, detailed, and reliable JSON results (Requires API Key).
  - **Scraper Mode**: Fallback mode using Playwright (Headless Browser) to scrape results from the VirusTotal website (No API Key required, but slower).
- **Bulk Scanning**: Accepts a list of URLs to process in one go.
- **Local Storage**: Results are saved locally in the `storage` directory.

### Installation & Setup

#### 1. Prerequisites

- [Python 3.8+](https://www.python.org/downloads/)
- (Optional) A [VirusTotal API Key](https://www.virustotal.com/gui/user/apikey)

#### 2. Installation

1. Clone the repository:
   ```bash
   git clone <your-repo-url>
   cd VirusTotal
   ```

2. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

3. Install Playwright browsers (required for Scraper Mode):
   ```bash
   playwright install
   ```

### Usage

#### 1. Configuration

To configure the run, edit the input file located at:
`storage/key_value_stores/default/INPUT.json`

Example configuration:

```json
{
    "startUrls": [
        "http://example.com",
        "https://www.google.com"
    ],
    "apiKey": "YOUR_VT_API_KEY_HERE", 
    "verbose": true
}
```

*Note: If you leave `apiKey` empty or remove it, the tool will automatically switch to **Scraper Mode**.*

#### 2. Running the Scanner

Run the main script:

```bash
python main.py
```

#### 3. Viewing Results

Output data will be saved in the `storage/datasets/default` directory as JSON files.
If running in Scraper Mode, screenshots may be saved in `storage/key_value_stores/default`.

#### 4. Accessing Output on Apify

When running on Apify platform, all export files are automatically uploaded to the **Key-Value Store**:

1. Go to your Actor run page on Apify
2. Click on the **"Storage"** tab
3. Navigate to **"Key-value store"**
4. Download the following files:
   - `RESULTS_CSV` - Spreadsheet-friendly format
   - `RESULTS_JSON` - Full structured data
   - `RESULTS_CEF` - SIEM integration format

These files are also available via the Apify API for automated workflows.

***

**Created by Ruturaj Sharbidre**

# Actor input Schema

## `apiKey` (type: `string`):

Your VirusTotal API Key. If not provided, the actor will try to scrape results using a browser (slower, less reliable).

## `startUrls` (type: `array`):

List of URLs or domains you want to scan.

## `verbose` (type: `boolean`):

Enable detailed logging.

## Actor input object example

```json
{
  "startUrls": [
    "http://example.com"
  ],
  "verbose": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "http://example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ruturaj04/virustotal").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": ["http://example.com"] }

# Run the Actor and wait for it to finish
run = client.actor("ruturaj04/virustotal").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "http://example.com"
  ]
}' |
apify call ruturaj04/virustotal --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ruturaj04/virustotal"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ceAaxUMAmUsUdQkrN/builds/GdsVgkHdSHNEJ8WJZ/openapi.json
