# Bulk File Downloader — URLs or Dataset to Files & ZIP (`tidydata/bulk-file-downloader`) Actor

Download files in bulk from a list of URLs or a dataset column (PDFs, images, documents, audio, video, any file) and get them with clean names, SHA-256 and size, plus one ZIP. Google Drive, Dropbox, OneDrive links work. For n8n, Make and AI agents.

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

## Pricing

from $1.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 or Dataset to Files & ZIP

![A scraper dataset of 4 products turned into 7 files named by SKU (JPG and PDF) plus one ZIP; a duplicate image and a YouTube link were skipped for free (real output)](https://api.apify.com/v2/key-value-stores/UJXqVadHhfb2eqS2e/records/bulk-file-downloader.png)

Download **files in bulk** from a **list of links** or from a **column of any Apify dataset** — PDFs, images, Word, Excel, PowerPoint, CSV, ZIP, audio, video or any other file — and get them back with **clean, unique file names**, their **size, type and SHA-256**, a **download link for each file** and **one ZIP with everything**.

**$1.50 per 1,000 files** (first 10 MB of each file included). Failed, skipped and duplicate files are **free**.

### ✨ What it does

- ✅ **Any file type** from direct links, plus share links of **Google Drive (files and public folders), Dropbox, OneDrive / SharePoint, GitHub and Wikimedia Commons** (turned into direct downloads automatically)
- ✅ **Chain it after a scraper**: pick the dataset, name the field (`images`, `images.url`, `pdfUrl`, `media.0.src`…) and every link in every row is downloaded — lists of links inside one row too
- ✅ **Clean names**: original name from the server (`Content-Disposition`) or the link, **numbered in input order**, or **taken from a dataset field** (SKU, title, id). Repeated names get `-2`, `-3`…
- ✅ **Real file types**: the extension is fixed from the file's content (a `download?id=…` link that is really a PDF is saved as `.pdf`)
- ✅ **One ZIP** with all the files (split into parts for big jobs), included in the price
- ✅ **Skip duplicates**: repeated links are downloaded once and identical files (same SHA-256) are saved once
- ✅ **Only the types you want**: e.g. `pdf, docx` — everything else is skipped for free
- ✅ **Safe and honest**: web pages, login pages and "file not found" answers are reported as failed rows with the reason, **never charged**
- ✅ **Fast and polite**: up to 32 parallel downloads, automatic retries that respect `Retry-After` on busy servers (HTTP 429/5xx), and a time limit per file so one stuck server never blocks the run

### 🚀 How to use it

1. Paste your **file links** (one per line), **or** pick a **dataset** with links and write the field name.
2. Choose how to **name** the files and whether you want a **ZIP**.
3. Run it. Each file appears in the **Output** tab with its **Download** link; the ZIP is the last row and is also listed in the run's **key-value store**.

#### Input example (API, n8n, Make, AI agents)

```json
{
  "fileUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "naming": "original",
  "createZip": true
}
```

From a scraper's dataset, naming each image by the product SKU:

```json
{
  "datasetId": "YOUR_DATASET_ID",
  "datasetUrlFields": "images",
  "datasetNameField": "sku",
  "naming": "field",
  "fileTypes": "jpg, png, webp"
}
```

`fileUrls` also accepts objects like `{"url": "https://…"}` (the format of Apify request lists).

### 📤 Output

One row per file:

```json
{
  "type": "file",
  "position": 1,
  "status": "ok",
  "fileName": "dummy.pdf",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/…/records/dummy.pdf?signature=…",
  "contentType": "application/pdf",
  "sizeBytes": 13264,
  "sizeMb": 0.013,
  "sha256": "3df79d34abbca99308e79cb94461c1893582604d68329a41fd4bec1885e6adb4",
  "sourceUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "kvStoreKey": "dummy.pdf",
  "charged": true
}
```

- `position` is the link's place in your input (rows arrive as downloads finish); `datasetRow` is the source row when you used a dataset.
- `status`: `ok`, `failed` (with `error`: not found, access denied, web page instead of a file, too big…), `skipped` (type filter or size) or `duplicate`. Only `ok` is charged.
- `fileUrl` is a **signed link that opens without an API token**, ready for n8n, Make, Zapier or an AI agent.
- The **ZIP row** has `"type": "zip"`, its `fileUrl` and `filesInZip`. A summary (files, MB, ZIP links) is saved as `OUTPUT` in the key-value store.

### 💰 Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| File | **$0.0015** ($1.50 / 1,000) | each file saved, first 10 MB included |
| Extra 10 MB | **$0.001** | each started 10 MB above the first 10 MB of a file |

Examples: 1,000 product photos of 300 KB = **$1.50**. 100 PDFs of 25 MB = 100 × ($0.0015 + 2 × $0.001) = **$0.35**. The ZIP, failed links, skipped files and duplicates cost nothing. Apify store discounts apply on paid plans.

### ❓ FAQ

**Which links work?** Any public `http(s)` link to a file, Google Drive files shared as "Anyone with the link" (any link format: `/file/d/…/view`, `open?id=`, `uc?id=`) and **public Drive folders** (every file inside; sub-folders are not opened), Dropbox, OneDrive/SharePoint and GitHub share links, Wikimedia Commons pages, Amazon S3 / Cloud Storage / Azure links (also pre-signed ones).

**Why did a link fail with "web page, not a file"?** The link opens a page (a viewer, a share page or a login screen), not the file itself. Use the direct download link, or turn on **Also save web pages** if you really want the HTML.

**YouTube, TikTok, Instagram, Facebook, X, Vimeo?** Not supported, on purpose: their terms forbid downloading their content. Files on their CDNs are refused too.

**How big can files be?** Up to 500 MB each (default limit 200 MB). With the ZIP on, one run keeps up to 2 GB with the default 2 GB memory (more memory = more room, up to 2.5 GB); with the ZIP off there is no total limit.

**What happens when my spending limit is reached?** The run stops cleanly: you are never charged above your **Max cost per run**, and every link that was not downloaded gets a `skipped` row, so you can run just those again.

**How long are the files kept?** In the run's default key-value store, for your plan's data retention (7 days on the free plan). Copy them to your storage or download the ZIP before that.

**Can I use it from an AI agent or n8n?** Yes: call it through the Apify API, MCP server or the n8n / Make Apify integration and read the dataset; every row has a direct `fileUrl`.

**Is it legal?** The Actor downloads only the links you give it, without logging in or bypassing any paywall. Make sure you have the right to download and use those files.

### 🔗 Related Actors

- [Merge, Dedup & Transform Datasets](https://apify.com/tidydata/merge-dedupe-datasets) — clean and combine the dataset before downloading its files
- [Bulk Image Downloader & Converter](https://apify.com/tidydata/bulk-image-downloader-converter) — images resized and converted to WebP/JPEG/PNG
- [PDF & Image to Text (OCR)](https://apify.com/tidydata/pdf-image-text-extractor) — read the text of the PDFs you downloaded
- [Document to Markdown for AI](https://apify.com/tidydata/document-to-markdown) — Word, PowerPoint, Excel and PDF to Markdown

⭐ If it saved you time, a review on the Store helps a lot. Questions or a missing feature? Open an **Issue** — answered within a day.

# Actor input Schema

## `fileUrls` (type: `array`):

One link per line: PDFs, images, Word/Excel/PowerPoint, CSV, ZIP, audio, video or any other file. Direct links, Google Drive files and public folders, Dropbox, OneDrive/SharePoint, GitHub and Wikimedia Commons share links work. Files on YouTube, TikTok, Instagram, Facebook, X, Vimeo and their CDNs are refused (their terms forbid downloading). Only download files you have the right to use.

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

A dataset from another run (a scraper, Merge, a Google Sheet import…) whose rows contain file links. Only read access to this one dataset is requested.

## `datasetUrlFields` (type: `string`):

Field name(s), comma separated. Nested paths and lists work: images, images.url, media.0.src. Leave empty to detect it (fileUrl, downloadUrl, url, imageUrl, image, src…).

## `datasetNameField` (type: `string`):

Used with naming 'From a dataset field', e.g. sku, title or id. The real extension is added (APL-001.jpg, APL-001.pdf); a repeated name gets -2, -3…

## `naming` (type: `string`):

Names are cleaned (no spaces or special characters) and kept unique: a repeated name gets -2, -3…

## `fileTypes` (type: `string`):

Comma separated extensions, e.g. pdf, docx, xlsx. Other files are skipped for free. Leave empty to keep every file.

## `createZip` (type: `boolean`):

One ZIP with all the files (split into parts over the size below). Included in the price.

## `zipName` (type: `string`):

The ZIP is saved as zip-<name>.zip in the run's key-value store.

## `zipPartMb` (type: `integer`):

Bigger downloads are split into several ZIP parts.

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

Repeated links are downloaded once, and files with exactly the same content (same SHA-256) are saved once. Duplicates are free.

## `maxFiles` (type: `integer`):

Safety limit for long lists and datasets.

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

Bigger files are skipped for free (up to 500 MB per file with the default 2 GB memory).

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

Lower it if a server starts refusing requests (HTTP 429).

## `fileTimeoutSecs` (type: `integer`):

A file that takes longer (a very slow server) fails for free and the run goes on with the others.

## `allowHtmlPages` (type: `boolean`):

Off: a link that opens a web page instead of a file fails for free (usual with share or login pages). On: the HTML is saved as a file. Note: Apify adds a small safety script when it serves HTML records; the copy inside the ZIP is the original.

## Actor input object example

```json
{
  "fileUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "naming": "original",
  "createZip": true,
  "zipName": "files",
  "zipPartMb": 500,
  "skipDuplicates": true,
  "maxFiles": 1000,
  "maxFileSizeMb": 200,
  "maxConcurrency": 8,
  "fileTimeoutSecs": 600,
  "allowHtmlPages": false
}
```

# Actor output Schema

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

One row per file: name, signed download link, size, type, SHA-256 and status; plus one row per ZIP.

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

Every downloaded file and the ZIP, in the run's key-value store.

# 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 = {
    "fileUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "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("tidydata/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 = { "fileUrls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "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("tidydata/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 '{
  "fileUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ]
}' |
apify call tidydata/bulk-file-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tidydata/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/wAwaKcAFc9j1IaqoH/builds/9C7otlB9XKBsLqNUj/openapi.json
