# Bulk File Downloader - PDFs, Images & Files from URL Lists (`rjmacarthy/bulk-file-downloader`) Actor

Download lists of file URLs (PDF, images, CSV, XLSX, ZIP, audio) into storage with direct download links. Read URLs from any scraper's dataset, filter by type/size, sha256 dedupe, optional ZIP, only-new mode. First 10 MB per file included; failed files are free.

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

## Pricing

from $2.00 / 1,000 file downloadeds

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 PDFs, Images & Files from URL Lists

Give it a list of file URLs, or point it at another Actor's dataset, and it downloads every file (PDFs, images, CSV/XLSX, ZIP, audio, video, anything) into the run's key-value store. You get **one dataset row per file with a direct download link**, its size, content type and sha256. It's built for chaining: set **Dataset ID** and the field that holds the links (`imageUrl`, `pdfUrl`, `images`...) and it downloads whatever your scraper found. Arrays are flattened. Filter by content type, extension and size, and skip identical files by sha256. You can also bundle everything into one **files.zip**, and use **Only new files** on a schedule to skip URLs you downloaded in earlier runs. **You pay $0.002 per stored file (first 2 MB included) plus $0.001 per extra MB, which covers the download bandwidth.** Failed, filtered, too-large and duplicate files are free.

### What data can you get?

| Field | Example | Notes |
|---|---|---|
| `status` | `downloaded` / `skipped` / `failed` | Only `downloaded` is charged |
| `downloadUrl` | `https://api.apify.com/v2/key-value-stores/<id>/records/dummy.pdf` | Direct link to the stored file |
| `fileName`, `kvKey` | `dummy.pdf` | Key in the run's key-value store, built from **File name template** |
| `contentType` | `application/pdf` | As sent by the server |
| `sizeBytes` | `13264` | Bytes stored |
| `sha256` | `3df79d34...` | Hash of the file content |
| `url`, `finalUrl` | source URL, URL after redirects | |
| `httpStatus` | `200`, `404` | |
| `reason`, `message` | `too-large`, `"File is 120.3 MB, above Max file size (25 MB)"` | Why a file was skipped or failed |
| `duplicateOf` | `https://.../first-copy.png` | Same content was already stored. `kvKey`/`downloadUrl` point to that copy |
| `index`, `id`, `downloadedAt`, `scrapedAt` | `3`, `19d081c5...`, ISO times | `index` = position in the URL list |

Also in the key-value store: every file, an optional `files.zip`, and `RUN_SUMMARY`, which holds counts by status and reason, bytes, charged events and requests per host.

### Use cases

- **RAG and LLM pipelines:** bulk-download PDFs, docs and spreadsheets (papers, filings, manuals) for parsing and embedding. Each file has a stable sha256 for change detection.
- **E-commerce image archiving:** run a product scraper, then download every `imageUrl` (or `images` array) with this Actor and get one ZIP.
- **Research and compliance:** save copies of reports, tenders, regulations and datasets with a hash for each file.
- **Open data:** collect CSV/XLSX/JSON files from government portals and GitHub repos on a schedule. With **Only new files**, each run only fetches new links.
- **Media teams:** download audio, video and image assets from a list of links, filtered by type and size.

### How to use

1. Paste links into **File URLs** (one per line), and/or set **Dataset ID** and **URL field in dataset** to read them from a previous run of any scraper.
2. Optional: limit to certain **content types** (`application/pdf`, `image/*`) or **extensions** (`pdf`, `jpg`, `csv`), and set **Max file size**.
3. Optional: change the **File name template**, turn on **Also create files.zip**, or **Only new files** for scheduled runs.
4. Run it. Open the **Files** view and click the download links, or fetch `files.zip` from the Storage tab.

#### Input examples

Research PDFs for a RAG pipeline:

```json
{
    "urls": [
        "https://arxiv.org/pdf/1706.03762",
        "https://arxiv.org/pdf/1810.04805",
        "https://arxiv.org/pdf/2005.11401"
    ],
    "allowedContentTypes": ["application/pdf"]
}
```

Download all product images found by a scraper, as one ZIP:

```json
{
    "datasetId": "YOUR_SCRAPER_DATASET_ID",
    "urlField": "images",
    "allowedContentTypes": ["image/*"],
    "fileNameTemplate": "{index}-{name}.{ext}",
    "createZip": true
}
```

Daily schedule that only fetches new CSV files:

```json
{
    "urls": [
        "https://raw.githubusercontent.com/datasets/gdp/main/data/gdp.csv",
        "https://raw.githubusercontent.com/datasets/population/main/data/population.csv"
    ],
    "allowedExtensions": ["csv"],
    "onlyNew": true
}
```

#### File name template

The placeholders are `{name}` (the file name from Content-Disposition or the URL, without extension), `{ext}` (the extension, taken from the content type when the name has none), `{index}` (zero-padded position in the list) and `{hash}` (the first 16 characters of the sha256). The default `{name}.{ext}` gives `dummy.pdf`. Characters not allowed in Apify keys become `_`, and repeated names get `-2`, `-3` and so on.

### Output example

Real rows from local runs (a stored PDF from the prefilled input, a duplicate and a 404):

```json
[
    {
        "id": "c6720d71ee6e9f00",
        "index": 1,
        "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "finalUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "status": "downloaded",
        "reason": null,
        "message": null,
        "httpStatus": 200,
        "contentType": "application/pdf; qs=0.001",
        "sizeBytes": 13264,
        "sha256": "3df79d34abbca99308e79cb94461c1893582604d68329a41fd4bec1885e6adb4",
        "fileName": "dummy.pdf",
        "kvKey": "dummy.pdf",
        "downloadUrl": "https://api.apify.com/v2/key-value-stores/adaba544-8d42-40d6-b99f-af07d4c6d446/records/dummy.pdf",
        "duplicateOf": null,
        "downloadedAt": "2026-11-11T12:33:11.025Z",
        "scrapedAt": "2026-11-11T12:33:11.025Z"
    },
    {
        "id": "833d31e4f2876557",
        "index": 2,
        "url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg?download=1",
        "finalUrl": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg?download=1",
        "status": "skipped",
        "reason": "duplicate-content",
        "message": "Same content as https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg",
        "httpStatus": 200,
        "contentType": "image/jpeg",
        "sizeBytes": 9022,
        "sha256": "99bd915a3819b1fee3722328ae904dde5459e9b15d56abd98b903c770a2f582c",
        "fileName": "Example.jpg",
        "kvKey": "Example.jpg",
        "downloadUrl": "https://api.apify.com/v2/key-value-stores/817f2be0-8641-4fc8-a476-f0e7ff6b0b3c/records/Example.jpg",
        "duplicateOf": "https://upload.wikimedia.org/wikipedia/commons/a/a9/Example.jpg",
        "downloadedAt": null,
        "scrapedAt": "2026-11-11T12:39:05.180Z"
    },
    {
        "id": "33e69f6d7c987fda",
        "index": 3,
        "url": "https://upload.wikimedia.org/wikipedia/commons/a/a9/No_such_example_file.jpg",
        "finalUrl": null,
        "status": "failed",
        "reason": "http-404",
        "message": "HTTP 404: file not found",
        "httpStatus": 404,
        "contentType": null,
        "sizeBytes": null,
        "sha256": null,
        "fileName": null,
        "kvKey": null,
        "downloadUrl": null,
        "duplicateOf": null,
        "downloadedAt": null,
        "scrapedAt": "2026-11-11T12:39:06.309Z"
    }
]
```

### Pricing

Pay per event:

| Event | Price | When |
|---|---|---|
| `file-downloaded` | $0.002 | Per file stored in the key-value store. Includes the first 2 MiB of the file |
| `data-mb` | $0.001 | Per extra started MiB of a stored file beyond the first 2 MiB |

The per-MB price covers the download bandwidth: every byte of a file is pulled from the source site through Apify's network, and that traffic is billed by size. Small files (most PDFs, images, CSVs) only ever pay the $0.002 file price.

Free: failed downloads, files skipped by filters or **Max file size**, duplicate content, URLs skipped by **Only new files**, and `files.zip`.

Worked examples:

- A 500 KB PDF: **$0.002**.
- A 10 MB file: $0.002 + 8 x $0.001 = **$0.010**.
- 1,000 product images under 2 MB each: 1,000 x $0.002 = **$2.00**.
- 500 files where 50 return 404: you pay only for the 450 stored files.

Set **Maximum cost per run** in the run options to cap spending. The Actor checks the budget before storing each file. When a file has a known size, it checks before downloading. When the budget runs out it stops cleanly instead of overcharging.

### Tips and limits

- **Public files only.** Files behind a login, a paywall or a captcha will fail. **Extra request headers** can add a `Referer` for hotlink-protected images. Don't paste login cookies or tokens there.
- **Max file size** is 25 MB by default and goes up to 200 MB per file. Bigger files are cut off as soon as they cross the limit and are not charged.
- **files.zip** is uncompressed and holds up to 500 MB in total. Above that it is skipped with a warning, and the files are still stored one by one.
- **Security:** only `http`/`https` URLs are accepted. Addresses that resolve to private, loopback or link-local IPs are refused, and this is checked on every redirect.
- **Politeness:** at most 3 parallel downloads go to the same website (**Max concurrency** sets the total). Retries with backoff cover 429/5xx and network errors.
- **Datacenter IPs:** most CDNs, S3 buckets and file hosts serve Apify's servers fine. If a site returns 403/429, enable Apify Proxy (datacenter).
- **Download links:** whether a `downloadUrl` opens without logging in depends on your account's storage access setting (Settings > Privacy). If it is restricted, add `?token=YOUR_API_TOKEN` or open the link while logged in to Apify.
- **Retention:** files live in the run's key-value store and follow your plan's data retention. Copy them elsewhere (S3, Google Drive) with an integration if you need them for longer.

### FAQ

**Is it legal?** The Actor only downloads files you point it at, and only files that are publicly reachable without logging in. You are responsible for having the right to download and use them (copyright, terms of service, privacy laws such as GDPR). Don't use it to collect personal data.

**Can I read URLs from another scraper?** Yes. Set **Dataset ID** (or `username~dataset-name`) and **URL field in dataset**. Dotted paths (`product.image`) and arrays (`images`) work, and arrays of objects with a `url` field are flattened too.

**What happens to duplicates?** With **Deduplicate** on, a URL that appears twice is downloaded once. If two different URLs return byte-identical files, the copy is stored only once: the second URL gets a free `skipped` row with `duplicateOf` and a link to the stored copy.

**How does "Only new files" work?** URLs that were downloaded successfully are remembered in the named key-value store `bulk-file-downloader-state` in your account. Later runs don't request, output or charge them. Failed or filtered URLs are tried again next time. Delete that store to start over.

**Why was a file skipped?** See `reason`. `filtered` means it didn't match your types/extensions. `too-large` means it was over **Max file size**. `duplicate-content` means the same bytes were already stored. `budget-exhausted` means the max cost per run was reached.

**Do you use residential proxies?** No. If you select a residential or SERP proxy group, the run logs a warning and uses Apify datacenter proxy instead. You can also add your own proxy URLs.

**Can I download whole websites or follow links?** No. It downloads exactly the URLs you give it. Use a crawler first to collect file links, then pass its dataset here.

### Integrations

- **API:** start runs and read results with the [Apify API](https://docs.apify.com/api/v2) or the JavaScript/Python clients. Fetch a file with `GET /v2/key-value-stores/{storeId}/records/{kvKey}`.
- **Chaining Actors:** use **Dataset ID** after any scraper, or start this Actor from a webhook when the scraper finishes.
- **Make, Zapier and n8n:** download attachments or links from a spreadsheet, form or RSS feed, then push the files to Google Drive, Dropbox or S3.
- **MCP:** AI agents can call this Actor through the [Apify MCP server](https://mcp.apify.com) to fetch documents for analysis.
- **Schedules:** with **Only new files**, a daily schedule over a growing list only downloads, and only charges for, new links.

### Changelog

- **0.1 (November 2026):** First release. Streaming downloads to the key-value store, dataset input with array flattening, content-type/extension/size filters, sha256 content dedupe, optional files.zip, "Only new files" mode, SSRF protection, failed files free.

### More scrapers by the same developer

- [Apple App Store Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/app-store-scraper)
- [Broken Link Checker & SEO Site Audit - 404s & Redirects](https://apify.com/rjmacarthy/broken-link-checker)
- [ESPN Scraper - Scores, Odds, Standings & Tennis](https://apify.com/rjmacarthy/espn-scraper)
- [Google Play Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/google-play-scraper)
- [Image to Text OCR - Extract Text from Images & Screenshots](https://apify.com/rjmacarthy/image-ocr-text-extractor)
- [PDF to Markdown & Text Converter for LLMs and RAG](https://apify.com/rjmacarthy/pdf-to-markdown)

Browse all my Actors on [my Apify Store profile](https://apify.com/rjmacarthy).

### Support

Found a bug or need a feature (S3/Drive upload, a different naming scheme)? Open an issue on the Issues tab with the run ID and an example URL. We usually reply within a day.

# Actor input Schema

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

Direct links to the files to download, one per line: PDFs, images, CSV/XLSX, ZIP, audio, video or anything else. Only public http(s) files (no login). Required unless you set a Dataset ID below.

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

Download files listed in another Actor's dataset, e.g. image or PDF links found by a scraper. Give the dataset ID (or username~dataset-name) and the field holding the links below. Combined with File URLs.

## `urlField` (type: `string`):

Field of each dataset item that holds the file link, e.g. imageUrl, pdfUrl or images. Dotted paths work (product.image). Arrays of URLs (or of objects with a url field) are flattened.

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

Maximum number of URLs to process in this run (0 = no limit).

## `allowedContentTypes` (type: `array`):

Only keep files with these Content-Types, e.g. application/pdf or image/\*. Leave empty to keep everything. A file passes if it matches ANY allowed content type OR extension. Checked from the response headers, so filtered files are not downloaded and are free.

## `allowedExtensions` (type: `array`):

Only keep files with these extensions, e.g. pdf, jpg, png, csv, xlsx (taken from the file name in the URL or Content-Disposition, or from the content type). Leave empty to keep everything.

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

Larger files are skipped (reason too-large, not charged). The download is stopped as soon as the size is exceeded. Default 25 MB, hard maximum 200 MB. Each stored file includes its first 2 MB; extra MBs are charged per MB (data-mb).

## `fileNameTemplate` (type: `string`):

Key of each stored file. Placeholders: {name} = file name from the URL or Content-Disposition (without extension), {ext} = extension, {index} = zero-padded position in the list, {hash} = first 16 characters of the file's sha256. Example: {index}-{name}.{ext}. Characters not allowed in Apify keys are replaced with \_; duplicates get -2, -3, ...

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

Also store all downloaded files in one files.zip in the key-value store (uncompressed, up to 500 MB in total; above that the ZIP is skipped with a warning). The ZIP is not charged.

## `deduplicate` (type: `boolean`):

Download each URL only once per run, and store files with identical content (same sha256) only once: later copies get a free row pointing to the first file (duplicateOf).

## `onlyNew` (type: `boolean`):

Skip URLs already downloaded by earlier runs of this Actor in your account (remembered in the named key-value store bulk-file-downloader-state). Ideal for scheduled runs over a growing dataset. Skipped URLs are not requested, output or charged.

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

Files downloaded in parallel. At most 3 at a time go to the same website, to stay polite.

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

Maximum time for one download attempt. Raise it for big files on slow servers.

## `maxRetries` (type: `integer`):

Retries (with backoff) after HTTP 429/5xx, timeouts and network errors. 404/403 are not retried.

## `headers` (type: `object`):

Optional extra HTTP headers sent with every download, e.g. {"Referer": "https://example.com/"} for sites that check where a file is linked from. Meant for public files: do not paste login cookies or tokens.

## `proxyConfiguration` (type: `object`):

Not needed for most files. Enable Apify Proxy (datacenter) if a site blocks downloads from Apify's servers (HTTP 403/429), or add your own proxy URLs. Residential and SERP proxy groups are not supported: the run falls back to Apify datacenter proxy.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://www.rfc-editor.org/rfc/rfc2616.txt",
    "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
    "https://raw.githubusercontent.com/apify/crawlee/master/package.json",
    "https://raw.githubusercontent.com/datasets/country-codes/main/data/country-codes.csv",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "urlField": "url",
  "maxFiles": 1000,
  "maxFileSizeMb": 25,
  "fileNameTemplate": "{name}.{ext}",
  "createZip": false,
  "deduplicate": true,
  "onlyNew": false,
  "maxConcurrency": 5,
  "timeoutSecs": 60,
  "maxRetries": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Status, file name and direct download link per URL.

## `errors` (type: `string`):

Why files were skipped or failed.

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

All downloaded files in the run's key-value store.

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

All files in one ZIP (only when "Create ZIP" is on).

## `summary` (type: `string`):

Counts per status and reason, charged events, bytes, request statistics.

# 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.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "https://www.rfc-editor.org/rfc/rfc2616.txt",
        "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
        "https://raw.githubusercontent.com/apify/crawlee/master/package.json",
        "https://raw.githubusercontent.com/datasets/country-codes/main/data/country-codes.csv",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
    ],
    "fileNameTemplate": "{name}.{ext}"
};

// Run the Actor and wait for it to finish
const run = await client.actor("rjmacarthy/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.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
        "https://www.rfc-editor.org/rfc/rfc2616.txt",
        "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
        "https://raw.githubusercontent.com/apify/crawlee/master/package.json",
        "https://raw.githubusercontent.com/datasets/country-codes/main/data/country-codes.csv",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    ],
    "fileNameTemplate": "{name}.{ext}",
}

# Run the Actor and wait for it to finish
run = client.actor("rjmacarthy/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.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    "https://www.rfc-editor.org/rfc/rfc2616.txt",
    "https://raw.githubusercontent.com/github/explore/main/topics/python/python.png",
    "https://raw.githubusercontent.com/apify/crawlee/master/package.json",
    "https://raw.githubusercontent.com/datasets/country-codes/main/data/country-codes.csv",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
  ],
  "fileNameTemplate": "{name}.{ext}"
}' |
apify call rjmacarthy/bulk-file-downloader --silent --output-dataset

```

## MCP server setup

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