# Bulk File Downloader: URL List to Storage or ZIP (`fecklesspleb/bulk-file-downloader`) Actor

Bulk file downloader for a list of direct URLs (PDF, CSV, ZIP, images, …): saves each file to Apify storage with content type, size and SHA-256, plus an optional free archive.zip. HTML pages, duplicates and failures free. Respects robots.txt. $1 per 1,000 files. Plus $0.00005 start.

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

## Pricing

Pay per event

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

Download a list of direct file URLs into an Apify key-value store. Each saved file is stored under a content-hash key and listed in the dataset with URL, status, content type, size and SHA-256. Optionally write a single `archive.zip` of the saved files into the same store (zipping is free).

**At a glance:** $1.00 per 1,000 files saved ($0.001 per file), plus the Apify run-start event. Duplicates, filtered, failed and skipped URLs are free. Any response that is an HTML page (for example a login wall or a soft-404 page) is not saved and not charged.

**Scheduled runs skip what was already saved (default).** Runs started by an Apify Schedule skip files that an earlier scheduled run already saved, and skipped files are not charged. This creates a named key-value store `bulk-file-downloader-skip-state` in your Apify account (or the name you set in **Skip state store name**). To opt out, set **Skip files downloaded by earlier runs** (`skipAlreadyDownloaded`) to `never`. Manual, API, webhook and integration runs are not affected unless you set it to `always`.

robots.txt is respected (RFC 9309) on every request and redirect hop. Private, loopback and link-local addresses are refused on the Apify platform.

### Use cases

- Archive a list of PDFs, CSVs, ZIPs or images you have the right to fetch.
- Feed another workflow that expects files in a key-value store.
- Bundle a small set of public assets into one zip for hand-off.

### Input

```json
{
  "urls": [
    {"url": "https://www.python.org/static/img/python-logo.png"},
    {"url": "https://www.python.org/static/favicon.ico"}
  ],
  "maxFileSizeMb": 50,
  "createZip": false
}
```

Empty `urls` (and `{}`) uses the same sample pair as the schema default/prefill. A URL without a scheme gets `https://`.

### Output example

```json
{
  "url": "https://www.python.org/static/img/python-logo.png",
  "status": "downloaded",
  "reason": null,
  "kvKey": "9c121e619bfe02eaba582d70.png",
  "fileUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/...",
  "finalUrl": "https://www.python.org/static/img/python-logo.png",
  "contentType": "image/png",
  "bytes": 15770,
  "sha256": "9c121e619bfe02eaba582d7080eea46fd53ec0b50717e6794a948fada4ae8f3c",
  "charged": true,
  "downloadedAt": "2026-11-05T16:00:00+00:00"
}
```

Failed and skipped URLs get a free dataset row with `status` `failed` or `skipped` and a `reason`. If no file is saved, the run adds one free status row that explains why. Run counts are saved in the `RUN_SUMMARY` record (plus `alreadyDownloaded` and `skipState` when the cross-run skip is on, `preset` with a preset, and `inputSources` with a dataset or CSV source).

### Pricing

Pay-per-event:

- `apify-actor-start`: $0.00005, the standard Apify start event (one per GB of memory, minimum 1).
- `file`: $0.001 per file saved to the key-value store ($1.00 per 1,000 files).

Duplicates, files an earlier run already saved (cross-run skip), size filters, robots blocks, timeouts, HTTP errors, private-address blocks, HTML pages and the optional zip are free. Set **Maximum cost per run** and the Actor stops cleanly when it is reached; a file that cannot be charged is not kept in the store.

### Recurring runs: skip files you already have

| `skipAlreadyDownloaded` | What happens |
|---|---|
| `auto` (default) | On only for runs started by an Apify Schedule. Manual, API, webhook, MCP and integration (n8n, Make, Zapier) runs process every URL, as before. |
| `always` | On for every run. Use it for n8n, Make, Zapier or API jobs that repeat. |
| `never` | Off. Every run saves and charges every file. |

When it is on, every URL is still fetched and hashed. A file whose SHA-256 an earlier run already saved and was charged for is not saved again. It gets a free row with `status` `skipped` and a `reason` that starts `already downloaded by an earlier run`, and is **not charged**. With `createZip`, `archive.zip` holds only the new files. `RUN_SUMMARY` counts them and shows the store in `skipState`; the log and status message say how many were skipped. If nothing new was found, the run also adds the usual free status row, which then starts `Not charged: no new file.`

The history is kept in a named key-value store in your account, **Skip state store name** (`skipStateStoreName`, default `bulk-file-downloader-skip-state`). Use one name per job if separate schedules should not share history. Named stores are kept until you delete them; this one holds about 67 bytes per remembered file (a 64-character hash in a JSON list), so 10,000 files is under 1 MB. Storage is billed by Apify under your plan; we have not measured the cost of such a small store. Delete the store, or pick a new name, to start over. Do not run two runs on the same store at the same moment: one of them may forget the other's newest entries, which only means those files are charged once more later.

Only files that were saved and charged are remembered; failed, filtered and cost-capped URLs are tried again next time.

### Other URL sources (dataset, CSV, Google Sheet)

Next to **URLs** you can add:

- **Dataset with URLs** (`datasetId`): an Apify dataset, for example the output of a scraper run. Each item's `url` is used, or the first of `fileUrl`, `imageUrl`, `src`, `link` or `href` that holds a URL. Set `datasetUrlField` for another field (dots for nested fields, for example `attachment.url`). Lists of URLs in a field are read too.
- **CSV URL or Google Sheet URL** (`csvUrl`): a public CSV file, or a Google Sheet shared as **Anyone with the link** (no Google sign-in). A normal sheet link such as `https://docs.google.com/spreadsheets/d/<ID>/edit#gid=0` is turned into its CSV export URL. The column named `url` is used, or the first column that holds URLs; set `csvUrlColumn` to pick a header. Max 5 MB.

Up to 5,000 URLs are taken from the dataset and CSV together, and they are added to the URL list without duplicates. If the URL list is still the default sample (the two python.org sample files), the sample is ignored when a dataset or CSV is set. If a source cannot be read (not found, no access, an HTML sign-in page instead of CSV), its reason is in the status row and `RUN_SUMMARY.inputSources`, and nothing is charged for it. The CSV is fetched like any other URL: robots.txt is obeyed and private addresses are blocked.

Run it after another Actor: in that Actor's **Integrations** tab, start this Actor when a run succeeds and pass `{"datasetId": "{{resource.defaultDatasetId}}"}` as the input.

### Presets

`preset` fills fields you left at their default. A field you changed keeps your value. Each preset caps `maxFiles`, so a preset run costs at most $0.01: start event $0.00005 + files × $0.001.

| `preset` | Sets | Max cost of a preset run |
|---|---|---|
| `none` (default) | nothing | (your own limits) |
| `quickSample` | `maxFiles` 5 | $0.00005 + 5 × $0.001 = $0.00505 |
| `smallFilesOnly` | `maxFileSizeMb` 5, `maxFiles` 9 | $0.00005 + 9 × $0.001 = $0.00905 |
| `newFilesOnly` | `skipAlreadyDownloaded` always, `maxFiles` 9 | $0.00005 + 9 × $0.001 = $0.00905 |

Raise `maxFiles` yourself when you need more; your value wins over the preset.

### Run it on a schedule

Use this when you want the same file list fetched on a regular cadence, then handed to another workflow.

**Scheduled runs skip what was already saved (default).** Runs started by an Apify Schedule skip files that an earlier scheduled run already saved, and skipped files are not charged. This creates a named key-value store `bulk-file-downloader-skip-state` in your Apify account (or the name you set in **Skip state store name**). To opt out, set **Skip files downloaded by earlier runs** (`skipAlreadyDownloaded`) to `never`. Manual, API, webhook and integration runs are not affected unless you set it to `always`.

**Example.** Keep a list of direct file URLs (PDFs, CSVs, images or other public files you have the right to fetch) in the `urls` field and run it daily or weekly. Each saved file is written to the key-value store and listed in the dataset with `fileUrl` and SHA-256. Runs started by an Apify Schedule skip files that an earlier run already saved (same SHA-256), so only new files are saved and charged; see [Recurring runs](#recurring-runs-skip-files-you-already-have). Optionally set `createZip` to `true` to also write `archive.zip` into the same store (zipping is free, subject to the zip size cap in Limits). Set **Key-value store name** for a named store that is kept indefinitely. Charges are unchanged; see Pricing.

#### Apify Schedules

You must have run the Actor at least once before you can schedule it. In [Apify Console](https://console.apify.com), open **Schedules** and click **Create new**. Set a name (3–63 characters) and a timezone (daylight saving is supported). Under **Schedule setup**, use the visual builder or a cron expression. For example, `0 8 * * *` runs every day at 08:00 in that timezone. Click **Add**, choose this Actor or a saved task, and optionally override the input, build, timeout or memory. If you leave the input empty, the Actor's default input is used. New schedules are created disabled; check the **Next runs** preview, then click **Enable**. One schedule can include at most 10 Actors and 10 tasks.

#### Webhook or dataset hand-off

On the Actor or a task, add a webhook for the event `ACTOR.RUN.SUCCEEDED` (you can also listen for `ACTOR.RUN.FAILED`). The event data includes `actorRunId`. Fetch that run's dataset items:

```bash
curl -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \
  "https://api.apify.com/v2/actor-runs/<RUN_ID>/dataset/items?format=json"
```

Keep the token in a credential or secret, never in a URL you share publicly. The API also accepts `?token=`, but the `Authorization` header is the recommended, more secure method. `format` may be `json` (the default), `jsonl`, `csv`, `xlsx`, `xml` or `rss`.

Each saved file is also in the run's key-value store; use the row's `fileUrl`, or download from **Storage → Key-value store** in Console. If `createZip` was enabled and the archive fitted the cap, `archive.zip` is in the same store.

#### n8n

1. Install the [Apify node](https://docs.apify.com/integrations/n8n): on self-hosted n8n, go to Settings → Community Nodes and install `@apify/n8n-nodes-apify`; on n8n Cloud, search for Apify and install the node.
2. Create an **Apify API** credential and store `<YOUR_APIFY_TOKEN>` there (OAuth2 is also available on n8n Cloud). Do not put the token in a node URL.
3. Add an Apify **Run an Actor** node, select this Actor, and set the input JSON below. To get rows in the same step, use **Run an Actor and get dataset** instead, which waits for the run to finish and returns the dataset items.
4. If an Apify Schedule starts the run, use the **On new Apify Event** trigger (event type **Succeeded**), then **Get Dataset Items** with the run's default dataset id.
5. Send the items to a sheet, folder or the next node.

Works with Apify's native n8n, Make and Zapier integrations. For a scheduled run, start it from an Apify Schedule or a Schedule Trigger in n8n, then read the run's default dataset in the next node.

Example input for a scheduled run:

```json
{
  "urls": [
    {"url": "https://www.python.org/static/img/python-logo.png"},
    {"url": "https://www.python.org/static/favicon.ico"}
  ],
  "maxFileSizeMb": 50,
  "createZip": false,
  "skipAlreadyDownloaded": "always",
  "skipStateStoreName": "n8n-daily-files"
}
```

n8n starts runs through the API, so `skipAlreadyDownloaded` is set to `always` above; the `auto` default applies only to runs started by an Apify Schedule.

#### Make

1. In a Make scenario, add the [Apify](https://docs.apify.com/integrations/make) app and connect with OAuth or an API token (store the token in the connection).
2. Add **Run an Actor**, select this Actor, and paste the same input JSON. Set **Run synchronously** to Yes only if the run will finish inside Make's synchronous timeout (Make's Apify app page states a 120-second maximum; Apify's Make docs say the timeout varies by plan). For longer runs, let an Apify Schedule start the Actor and use **Watch Actor Runs**, then **Get Dataset Items** with that run's default dataset id.
3. Map the items to Google Sheets, Drive, or the next module.

### Limits

- Direct file URLs only (no page crawl).
- HTML pages cannot be downloaded: any HTML response is skipped and free.
- No JavaScript rendering, no login, no cookie/header injection, no Cloudflare bypass.
- Max file size default 50 MB (schema maximum 100 MB).
- Concurrency is capped at 30 and lowered automatically so parallel downloads fit in about half of the Actor's memory (2 at the 256 MB default with a 50 MB max file size). Requests to one host are spaced at least 0.25 s apart, or longer if robots.txt sets a crawl-delay.
- `archive.zip` is capped at 30% of Actor memory (between 5 MB and 100 MB). Files that do not fit are left out of the zip and listed in free rows and in `RUN_SUMMARY`.
- On the Apify platform, private/loopback/link-local addresses (also after a redirect) are not fetched and are free.
- A file URL that redirects to a login page is not saved and is free (tested locally).

**What happens with invalid input?** If the input is not a JSON object, or a field has the wrong type, the run fetches nothing and ends with one free status row: `Invalid input, nothing was fetched and no results were charged: <reason>`. The standard Apify start event still applies.

### FAQ

**Can I download `.html` / HTML pages?**\
No. This Actor is for direct **file** URLs (PDF, images, ZIP, CSV, etc.). Any response that is an HTML page is skipped and not charged. That includes soft-404 HTML bodies and login walls. The check is by Content-Type (`text/html` / `application/xhtml+xml`) **or** by sniffing the body as HTML (`<!doctype html`, `<html>`, …) — so a URL that ends in `.html` and returns an HTML document is rejected the same way. (A non-HTML body such as a PDF is still accepted even if a server mis-labels Content-Type as HTML.)

**Why do only about two downloads run at once on the default settings?**\
**Max concurrency** defaults to **10**, but the Actor lowers it automatically so that `concurrency × maxFileSizeMb` fits in about **half** of Actor memory. With the defaults (**256 MB** memory, **50 MB** max file size) that budget is `floor((256 × 0.5) / 50) = 2`, so effective concurrency is **2**. Raise memory and/or lower **Max file size (MB)** to allow more parallel downloads (hard cap 30). Separately, requests to the **same host** are spaced at least **0.25 s** apart (or longer if robots.txt sets a crawl-delay), which further serialises same-host URLs even when the global concurrency is higher.

### Is this legal?

The Actor downloads only public files from URLs you give it and obeys robots.txt. Files are often protected by copyright: make sure you have the right to download and use them, and follow each site's terms.

# Changelog

This Actor's version history is a separate document: https://apify.com/fecklesspleb/bulk-file-downloader/changelog.md

# Actor input Schema

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

Direct file URLs to download. HTML pages (login walls, soft-404s) are skipped and not charged. To read URLs from a CSV file, a public Google Sheet or an Apify dataset, use CSV URL or Dataset below.

## `minSizeKb` (type: `number`):

Skip files smaller than this. 0 keeps all.

## `maxFileSizeMb` (type: `number`):

Larger files are skipped and not charged.

## `keyValueStoreName` (type: `string`):

Save files to a named key-value store instead of the run's default store.

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

After downloads, write archive.zip of saved files into the same key-value store. Zipping is free. The zip is capped at 30% of Actor memory (5 to 100 MB); files that do not fit are left out and listed.

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

Downloads in parallel. The Actor may lower this automatically so that parallel downloads fit in its memory. Requests to one host are spaced at least 0.25 s apart.

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

Stop after saving this many files. 0 means no cap.

## `preset` (type: `string`):

Optional shortcut. A preset only fills fields you left at their default; any field you changed keeps your value. Each preset caps the files it saves, so a preset run costs at most $0.01 (see Pricing).

## `skipAlreadyDownloaded` (type: `string`):

Default Auto: runs started by an Apify Schedule skip files that an earlier scheduled run already saved, and skipped files are not charged. This creates a named key-value store bulk-file-downloader-skip-state in your Apify account (or the name in Skip state store name). To opt out, set this to Never. Files whose SHA-256 is already in the skip state store (saved and charged by an earlier run) are not saved again and not charged; they get a free row with status skipped. The file is still fetched to compute its hash. Auto turns this on only for scheduled runs; manual, API, webhook and integration (n8n, Make, Zapier) runs keep downloading every file unless you choose Always.

## `skipStateStoreName` (type: `string`):

Named key-value store that remembers downloaded files (default bulk-file-downloader-skip-state). Use a different name per job so separate schedules do not share history. 1-63 letters, digits or hyphens.

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

Optional. Read URLs from an Apify dataset, for example the output of a scraper run. Added to the URL list (the default sample URL list is ignored when a dataset or CSV is set). Up to 5,000 URLs from Dataset and CSV together.

## `datasetUrlField` (type: `string`):

Field that holds the URL in each dataset item (dots for nested fields, e.g. product.image). Empty: the first of url, fileUrl, imageUrl, src, link, href that holds a URL. Lists of URLs are read too.

## `csvUrl` (type: `string`):

Optional. A public CSV file URL, or a Google Sheet shared as 'Anyone with the link' (its normal URL is turned into the CSV export URL; no Google sign-in). Max 5 MB. Added to the URL list.

## `csvUrlColumn` (type: `string`):

Header of the column with URLs. Empty: a column named url, else the first column that holds URLs (a file without a header row works too).

## Actor input object example

```json
{
  "urls": [
    {
      "url": "https://www.python.org/static/img/python-logo.png"
    },
    {
      "url": "https://www.python.org/static/favicon.ico"
    }
  ],
  "minSizeKb": 0,
  "maxFileSizeMb": 50,
  "createZip": false,
  "maxConcurrency": 10,
  "maxFiles": 0,
  "preset": "none",
  "skipAlreadyDownloaded": "auto"
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        {
            "url": "https://www.python.org/static/img/python-logo.png"
        },
        {
            "url": "https://www.python.org/static/favicon.ico"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fecklesspleb/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": [
        { "url": "https://www.python.org/static/img/python-logo.png" },
        { "url": "https://www.python.org/static/favicon.ico" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("fecklesspleb/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": [
    {
      "url": "https://www.python.org/static/img/python-logo.png"
    },
    {
      "url": "https://www.python.org/static/favicon.ico"
    }
  ]
}' |
apify call fecklesspleb/bulk-file-downloader --silent --output-dataset

```

## MCP server setup

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