# Bulk File Downloader: URLs to Files, ZIP and Manifest (`greenrun/bulk-file-downloader`) Actor

Download files from a list of URLs into Apify storage with a manifest (final URL, type checked from bytes, size, SHA-256, link) and an optional ZIP. robots.txt respected, no proxies. Not found, blocked, filtered and unreachable links are free.

- **URL**: https://apify.com/greenrun/bulk-file-downloader.md
- **Developed by:** [Greenrun](https://apify.com/greenrun) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 files

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

## Bulk File Downloader: URLs to Files, ZIP and Manifest

Download files from a list of URLs into Apify storage with a manifest (final URL, type checked from bytes, size, SHA-256, link) and an optional ZIP. robots.txt respected, no proxies. Not found, blocked, filtered and unreachable links are free.

Give it a list of file links, or point it at a field of a dataset from another Actor, and get **every file stored in your run's key-value store, one manifest row per link** and, if you want, **one ZIP with all files**. Each row tells you the final URL after redirects, the real file type read from the bytes, the size, the SHA-256 checksum and a direct link to the stored copy. **You pay for downloads that started (their first bytes arrived and passed the type check); not found, blocked, filtered and unreachable links are free**, with the reason in the row. Made for data pipelines, archiving, dataset building and AI agents that need the files behind a list of links.

### What it does

- **Downloads** any file type from http and https links: PDF, Office documents, images, audio, video, archives, CSV, JSON and more, streamed to disk, so large files do not need large memory.
- **Reads links from a dataset**: pick a dataset and the field with the links (`url`, `images`, `images.url`, `product.imageUrl` ...), for example the output of a scraper.
- **Checks the real type** from the first bytes, not from the server's Content-Type or the file name, and fixes names such as `download.php` to `download.pdf`.
- **Filters by type**: keep only `pdf`, `image`, `video`, `docx`, `image/*` ...; other files stop after their first 4 KB and are free.
- **Stores identical files once**: a file with the same SHA-256 as an earlier one is not stored again (it is still downloaded, so it is charged like any download).
- **Packs a ZIP** (`files.zip`) with every stored file and a `manifest.csv`, when you switch it on.

### Why use it

- **Pay only for downloads that started.** 404s, sites that refuse access, files filtered out by type and unreachable hosts cost nothing, and each of them says why in `error`.
- **Type checked from the bytes.** When a link to a `.pdf` returns a login or cookie page, you get `status: error` with that reason instead of a broken "PDF" in your data.
- **Checksums and links in one manifest.** SHA-256, size and a direct link to the stored copy for every file, ready for deduplication and audits.
- **Respectful.** robots.txt is checked for every request and every redirect, Crawl-delay is kept, private network addresses are refused. No proxies, no CAPTCHA solving, no login.
- **Built for AI agents.** One clear status message, a predictable price per file, and limited permissions, so it works as a tool in the Apify MCP server.

### How to use

#### In Apify Console

1. Paste the links into **File URLs**, one per line, or pick a dataset in **URLs from a dataset** and type the field with the links.
2. Optional: switch on **Also create one ZIP**, list types in **Only these file types**, or raise **Max file size (MB)**.
3. Press **Start**. The **Output** tab shows the manifest; the files are in the run's **Storage → Key-value store**, and the ZIP is the `files.zip` record.

#### From an AI agent (MCP)

Connect any MCP client to the Apify MCP server with only this Actor as a tool:

```
https://mcp.apify.com?tools=greenrun/bulk-file-downloader
```

The agent gets a link to each stored file in `fileUrl`.

#### Through the API

```bash
curl -X POST "https://api.apify.com/v2/acts/greenrun~bulk-file-downloader/run-sync-get-dataset-items" \
  -H "Authorization: Bearer <APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://www.python.org/static/img/python-logo.png", "https://www.rfc-editor.org/rfc/rfc9309.pdf"], "zip": true}'
```

### Input

| Field | Default | Description |
|---|---|---|
| `urls` | | Direct links to files, one per line. Each URL becomes one row of the manifest; `index` keeps the input order. |
| `datasetId` | | Optional dataset whose items contain the links (for example the output of a scraper). |
| `datasetField` | `url` | Field with the links in each dataset item. Dot paths and lists work: `images`, `images.url`, `product.imageUrl`. |
| `zip` | `false` | Also pack every stored file into `files.zip` with `manifest.csv`. The ZIP holds a second copy of each file, so a file's first 10 MB count twice in its work (see Pricing). |
| `fileTypes` | all | Keep only these types: extensions (`pdf`, `jpg`), categories (`image`, `video`, `audio`, `document`, `archive`, `text`) or MIME types (`application/pdf`, `image/*`). |
| `skipDuplicates` | `true` | Store files with the same content (SHA-256) once; later copies point to the first (they are still downloaded and charged). |
| `maxFileSizeMb` | `100` | Larger files are skipped for free when the server tells their size; otherwise the download stops at the limit and pays for what was downloaded (1-5000). |
| `maxConcurrency` | `5` | Files downloaded at the same time (1-20). |
| `timeoutSecs` | `300` | Time limit per file (10-3600). |

### Output

Two rows from a run on the Apify platform on 19 November 2026 (8 links, ZIP on; signature in `fileUrl` shortened):

```json
{
  "index": 4,
  "input": "https://www.rfc-editor.org/rfc/rfc9309.pdf",
  "status": "downloaded",
  "url": "https://www.rfc-editor.org/rfc/rfc9309.pdf",
  "finalUrl": "https://www.rfc-editor.org/rfc/rfc9309.pdf",
  "httpStatus": 200,
  "fileName": "rfc9309.pdf",
  "key": "00004-rfc9309.pdf",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/y4pGYxTEZHHifGR8X/records/00004-rfc9309.pdf?signature=...",
  "contentType": "application/pdf",
  "detectedType": "pdf",
  "mimeType": "application/pdf",
  "extension": ".pdf",
  "category": "document",
  "sizeBytes": 177688,
  "sha256": "149bf3e7f8fa21eaab3cfacf425e624cc44aece2547f65b2f43b97d70511ef0d",
  "lastModified": null,
  "duplicateOf": null,
  "zipName": "rfc9309.pdf",
  "downloadedAt": "2026-11-19T19:16:20Z",
  "error": null,
  "billableEvents": {"file": 1, "extra-mb": 0}
}
```

```json
{
  "index": 2,
  "input": "https://www.python.org/static/img/python-logo.png?copy=2",
  "status": "duplicate",
  "fileName": "python-logo.png",
  "detectedType": "png",
  "sizeBytes": 15770,
  "duplicateOf": "https://www.python.org/static/img/python-logo.png",
  "error": "Same content (SHA-256) as input 1, stored once",
  "billableEvents": {"file": 0, "extra-mb": 0}
}
```

The same run stored `Python-3.13.0.tar.xz` (22.5 MB, detected type `xz`) as one `file` and 13 `extra-mb` events, answered `not_found` for a missing image and `blocked` for a GitHub archive link that robots.txt disallows, both free. Final status message: `Done: 5 of 8 files downloaded (23.0 MB); 1 duplicate, 1 blocked, 1 not found (not charged, see RUN-REPORT). ZIP with 5 files (23.0 MB): key files.zip`.

`status` is `downloaded` or `duplicate` (charged), or `not_found`, `blocked`, `filtered`, `too_large`, `error`: free when they stop before the first bytes of the file, otherwise with the events of what was downloaded (`billableEvents`, `workGbSecs`). The `RUN-REPORT` record in the key-value store has the counts, the stored bytes, the ZIP link and the reason for every free row.

### Pricing

Pay per event, no subscription:

| Event | Price | When |
|---|---|---|
| Actor start | $0.0045 per GB of memory | Once per run: $0.0045 at the default 512 MB. |
| File | $0.002 | A download that started: its first bytes arrived and passed the type check. A slow download counts more Files (below). |
| Extra megabyte | $0.0002 | Each started megabyte above 10 MB of one file, charged while it downloads. |

**How Files are counted.** One File covers 16 GB-seconds of work on a file: its download time (32 seconds at the default 512 MB, 4 s at 4 GB; the run time is shared equally between the files downloaded at the same time) plus 1 GB-s for each MB stored, up to 10 MB (with the ZIP on each MB counts twice, as the ZIP holds a second copy). A file that takes longer counts one more File for each started 16 GB-s. Most files are 1 File; slow hosts, robots.txt Crawl-delay waits and more memory make files count more. Each row shows its count in `billableEvents` and its work in `workGbSecs`.

Examples: 1,000 files of a few MB cost about $2.00, plus $0.0045 per run; one 25 MB file costs $0.002 + 15 × $0.0002 = $0.005.

Free: links that are not found, blocked by robots.txt or refused by the site, files whose first bytes show a filtered type or an HTML page instead of the file, files whose declared size is above your limit, and links that fail before their first bytes. A download is charged from its first bytes: a duplicate (the same SHA-256 as an earlier file) is downloaded and charged but stored once, and a file that turns out larger than `maxFileSizeMb` while downloading, or fails after its first bytes, keeps the events of what was downloaded. ZIP-based files (Office, EPUB) are told apart only from the whole file, so a type filter decides after they are charged.

**Runs of mostly free links stop early.** Free links take run time that only the Actor start and the files of the same run pay for. When that time is used up, the run stops and lists the links it did not process in `RUN-REPORT` under `notProcessedInputs`; start them in a new run.

You can cap the cost of a run with the maximum charge in the run options (at least $0.025); the run stops cleanly at that limit and the status message says so. A file whose declared size needs more events than the limit leaves is not downloaded.

### Limits

- Direct file links only: the Actor does not open web pages to look for links inside them, and it does not run JavaScript.
- No login, cookies, proxies or CAPTCHA solving: links that need them come back as `blocked` or `error`, for free.
- A run gets twice its memory as disk (512 MB memory → 1 GB disk). For many large files, or a large ZIP, run with more memory.
- Up to 100,000 links per run.

### FAQ

**Do you keep the files?** No. Files and the manifest stay in your run's key-value store and dataset in your own Apify account, under your data retention settings.

**Why was a link charged or not?** Each row has its events in `billableEvents` and free rows their reason in `error`, and the `RUN-REPORT` record in the key-value store counts them.

**Can I trust the file type?** It is read from the first bytes of the file (PDF, PNG, JPEG, Office, ZIP, MP4 and about 60 other signatures), not from the name or the Content-Type header.

**Something is wrong with a result?** Open an issue on the Actor's **Issues** tab with the link.

# Actor input Schema

## `urls` (type: `array`):

Direct http or https links to files (PDF, images, documents, archives, audio, video or any other type), one per line. Each URL becomes one row of the manifest; the index field keeps the input order.

## `datasetId` (type: `string`):

Also download the links found in this dataset, for example the output of a scraper. Pick the field below.

## `datasetField` (type: `string`):

Field of each dataset item that holds the link. Dot paths and lists work: url, images, images.url, product.imageUrl.

## `zip` (type: `boolean`):

Pack every stored file into files.zip in the key-value store, with manifest.csv. The ZIP holds a second copy of every file, so a file's first 10 MB count twice in its work (see Pricing).

## `fileTypes` (type: `array`):

Keep only these types: extensions (pdf, jpg, docx), categories (image, video, audio, document, archive, text) or MIME types (application/pdf, image/\*). The type is checked from the first bytes, not from the name, and other types stop there for free; ZIP-based files (Office, EPUB) are told apart only from the whole file, so they are charged before the filter decides. Leave empty for all files.

## `skipDuplicates` (type: `boolean`):

Files with the same content (SHA-256) are stored once; later copies point to the first one. A copy is still downloaded, so it is charged like any download, but not stored again.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped for free when the server tells their size; a file that turns out larger while downloading stops there and pays for what was downloaded. Each file is one 'file' event (more for slow downloads); every started MB above 10 MB adds one 'extra-mb' event. A run gets twice its memory as disk, so very large files need more memory.

## `maxConcurrency` (type: `integer`):

How many files are downloaded at the same time. Requests to one site are still spaced by its robots.txt Crawl-delay.

## `timeoutSecs` (type: `integer`):

A download that takes longer fails: free before its first bytes arrive, after that it pays for its download time like any file.

## Actor input object example

```json
{
  "urls": [
    "https://www.python.org/static/img/python-logo.png",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "datasetField": "url",
  "zip": false,
  "skipDuplicates": true,
  "maxFileSizeMb": 100,
  "maxConcurrency": 5,
  "timeoutSecs": 300
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

## `zip` (type: `string`):

No description

## `report` (type: `string`):

No description

# 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 = {
    "urls": [
        "https://www.python.org/static/img/python-logo.png",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("greenrun/bulk-file-downloader").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 = { "urls": [
        "https://www.python.org/static/img/python-logo.png",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("greenrun/bulk-file-downloader").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 '{
  "urls": [
    "https://www.python.org/static/img/python-logo.png",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call greenrun/bulk-file-downloader --silent --output-dataset

```

## MCP server setup

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

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/DElZjLoFN5AH9urAa/builds/FQilHHMHsKvk9rus8/openapi.json
