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

Download thousands of files or images from a URL list or any dataset field. Each file gets a stable link, SHA-256 hash, size, type and image dimensions; optional ZIP parts, WebP or JPEG conversion and resizing. Failed and duplicate files are free.

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

## Pricing

from $6.40 / 1,000 file storeds

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 and Image Downloader: URLs to Files, ZIP

Download thousands of files or images from a list of direct links, or from the URL field of any dataset, and get each file back with a stable link, its size, type, SHA-256 hash and image dimensions. Direct file links only: pages that need a log-in and video or social sites are not supported. You pay only for files that were stored; failed URLs and duplicate files are free.

### What is Bulk File and Image Downloader?

Bulk File and Image Downloader is an image downloader API and bulk file downloader for Apify. Give it URLs, and it saves every file in a key-value store, adds one row per file to the dataset and can pack everything into ZIP parts. It chains after any scraper without code: point **Dataset with URLs** at the scraper's dataset and name the field that holds the image or file links.

- One stored file and one row per URL, with `storedUrl`, `contentType`, `bytes`, `sha256`, `width` and `height`.
- ZIP parts of up to 500 MB (`files-001.zip`, `files-002.zip`...) next to or instead of separate files.
- Duplicate content is stored once: the SHA-256 hash of each download is compared, and a repeat gets a free row that names the first copy.
- Optional conversion of images to WebP, JPEG or PNG, and shrinking to a maximum width.
- File names from a pattern, with any field of the dataset row (for example `{sku}-{index}`).
- Up to 50,000 URLs per run; files up to 500 MB each.

### What can it download?

Any file that a public `http` or `https` link returns directly: images (JPEG, PNG, GIF, WebP, AVIF, SVG, ICO), PDF and office documents, CSV and JSON, archives, audio and video files. The content type comes from the server; when the server sends none or a generic one, it is read from the first bytes of the file.

It does not download web pages: a link that returns an HTML page (a log-in page, a "not found" page with status 200) is listed in `FAILED` with the reason "HTML page, not a file", unless you add `text/html` to **Allowed content types**. It does not extract videos from YouTube, social networks or similar sites, and it does not log in, pass paywalls or solve captchas.

### How to download images in bulk from a list of URLs

1. Paste your links into **File URLs**, one per line, or choose a dataset in **Dataset with URLs** and set **URL field in the dataset** (for example `images` or `images.url`).
2. Choose the **Output**: separate files, ZIP parts only, or both. Optional: set **Convert images to** and **Max image width**.
3. Click **Start**. The status message shows the progress every 100 files.
4. Open the **Output** tab: the **Overview** view lists every file with its link, and the **Images** view shows thumbnails. Export the rows to CSV, Excel or JSON, or read them with the Apify API.

### How much does it cost to download 1,000 images?

You pay per stored file, plus a small fee for each started 10 MB of a file above its first 5 MB. Failed URLs, blocked URLs, HTML pages and duplicate files cost nothing.

| Event | Charged when | Free plan | Bronze | Silver | Gold |
|---|---|---|---|---|---|
| File stored (`file-stored`) | One file downloaded, stored with a link and its row saved. Failed URLs and duplicate files are not charged. | 8.00 USD per 1,000 events | 8.00 USD per 1,000 events | 7.20 USD per 1,000 events | 6.40 USD per 1,000 events |
| Actor start (`apify-actor-start`) | Charged by Apify when the run starts: once up to 1 GB of memory, then once for each extra GB. | 0.05 USD per 1,000 runs | 0.05 USD per 1,000 runs | 0.05 USD per 1,000 runs | 0.05 USD per 1,000 runs |
| Extra 10 MB (`extra-10mb`) | Each started 10 MB of a stored file above its first 5 MB (a 12 MB file adds 1, a 30 MB file adds 3). | 4.00 USD per 1,000 events | 4.00 USD per 1,000 events | 3.60 USD per 1,000 events | 3.20 USD per 1,000 events |

Example: 1,000 files on the Bronze plan cost 1,000 x 0.008 USD = 8.00 USD, plus 0.00005 USD for the run start. Platform usage (compute, storage, traffic) is included in these prices.

Free plan: the 5 USD of monthly Apify credit covers about 625 files a month when no other Actor is used.

Worked examples on the Bronze plan: 1,000 product images of about 1 MB cost 1,000 x 0.008 USD = 8.00 USD. A 30 MB PDF costs 0.008 USD plus 3 x 0.004 USD for its 25 MB above the first 5 MB, so 0.020 USD. In this README 1 MB means 1,048,576 bytes.

Set a maximum cost per run in the run options. The Actor never starts a download whose charges would pass it: it stops starting new downloads, finishes the files in progress, closes the last ZIP part and writes its summary. The URLs that were not started are counted as `notProcessed` in the `OUTPUT` record.

### Input examples

A list of links:

```json
{
    "urls": [
        "https://www.w3.org/Icons/w3c_home.png",
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ],
    "output": "files"
}
```

The image field of a scraper's dataset, with file names from the product code and WebP output:

```json
{
    "datasetId": "YOUR_DATASET_ID",
    "urlField": "images",
    "fileNamePattern": "{sku}-{index}",
    "output": "both",
    "convertImagesTo": "webp",
    "maxImageWidth": 1200,
    "allowedContentTypes": ["image/*"],
    "keyValueStoreName": "product-images"
}
```

### Output example

A row from a real run of the first input above:

```json
{
    "url": "https://www.w3.org/Icons/w3c_home.png",
    "finalUrl": "https://www.w3.org/assets/logos/w3c-2025-transitional/w3c-72x48.png",
    "fileName": "1-w3c_home.png",
    "key": "1-w3c_home.png",
    "storedUrl": "https://api.apify.com/v2/key-value-stores/STORE_ID/records/1-w3c_home.png",
    "zipPart": null,
    "contentType": "image/png",
    "bytes": 1848,
    "sha256": "590608bf256237f22d84bbab2a0a1afc0d4f20db6350bbac2c6841f1f3e13b01",
    "width": 72,
    "height": 48,
    "converted": false,
    "conversionError": null,
    "duplicateOf": null,
    "sourceRow": null,
    "downloadedAt": "2026-11-12T22:06:00Z"
}
```

The run's key-value store also holds:

- `OUTPUT`: counts of stored, duplicate, failed and skipped files, the store used and every ZIP part with its link.
- `FAILED`: each URL that gave no file, with the reason (for example `HTTP 404`, `file too large`, `HTML page, not a file`, `blocked: ...`), the HTTP status and the number of attempts.

### Output fields

| Field | Type | Description |
|---|---|---|
| `url` | string | The URL as requested, after a missing https:// was added and the host was written in lower case. |
| `finalUrl` | string | The URL that sent the file, after all redirects were followed. |
| `fileName` | string or null | Name of the stored file, from the file name pattern; unique within the run. Also the name inside the ZIP part. Null for duplicates. |
| `key` | string or null | Key of the file's record in the key-value store (the file name in the characters a key allows). Null in ZIP-only output and for duplicates. |
| `storedUrl` | string or null | Public link to the stored record; in ZIP-only output the link to the ZIP part that holds the file; for duplicates the link of the first copy. |
| `zipPart` | string or null | Key of the ZIP part that holds the file (zip and both output); null otherwise. |
| `contentType` | string | Media type of the stored file: from the server, or read from the first bytes when the server sent none or a generic one. |
| `bytes` | integer | Size of the stored file in bytes (after conversion, when converted). |
| `sha256` | string | SHA-256 hash of the stored file, in hexadecimal: compare it with your copy to check the transfer. |
| `width` | integer or null | Image width in pixels; null for files that are not images. |
| `height` | integer or null | Image height in pixels; null for files that are not images. |
| `converted` | boolean | True when the image was converted or shrunk; false when it is stored as downloaded. |
| `conversionError` | string or null | Why a requested conversion was not made (the original is stored instead); null otherwise. |
| `duplicateOf` | string or null | For a file with the same content as one stored earlier in the run: the key (or ZIP file name) of that first copy. Duplicates are not stored again and not charged. |
| `sourceRow` | object or null | Top-level text, number and true/false fields of the dataset row the URL came from (at most 20, text cut at 300 characters); null for URLs from the list. |
| `downloadedAt` | string | Time the file was downloaded (ISO 8601, UTC). |

### ZIP export and named storage

With **Output** set to `zip` or `both`, files are packed into ZIP parts of up to 500 MB, named `files-001.zip`, `files-002.zip` and so on; a new part starts before a file would make the open one pass 500 MB. Images, video, PDF and archives are stored in the ZIP as they are; text formats such as CSV and JSON are compressed. With `zip`, only the parts are stored, each row's `storedUrl` links to its part, and a file is charged when its part has been saved.

By default everything goes to the run's own key-value store. Apify removes unnamed stores after the data retention period (7 days by default). To keep the files, set **Named store**: the Actor creates the store when it is missing and writes the files there, and named stores are kept until you delete them. The files then use storage in your Apify account. ZIP parts in a named store carry the run ID in their name, so a later run does not replace them; separate files with the same name are replaced, so use `{hash}` or a different store name per batch when you need to keep both.

Each `storedUrl` is a public link to the record. If your account restricts access to storages, the link carries a signature and still works without a token.

### Convert and resize images

Set **Convert images to** to `webp`, `jpeg` or `png`, and **Max image width** to shrink wider images while keeping their aspect ratio (narrower images are not enlarged). Rotation from EXIF data is applied. JPEG output puts transparent areas on white. Converted rows have `converted: true`, and `bytes`, `sha256`, `width` and `height` describe the converted file.

An image is kept as downloaded, with the reason in `conversionError`, when it is animated, cannot be read, or has more pixels than the run's memory allows for decoding (about 67 million pixels at 1,024 MB of memory). Width and height are filled for every image Pillow can read, converted or not; files that are not images get `null`.

### Limits

- Direct links only. Pages that need a log-in, video and social sites, paywalls and captchas are not supported. `Authorization` and `Cookie` headers are refused.
- Only public `http` and `https` addresses are fetched. Local names, private, loopback and link-local addresses (for example `127.0.0.1`, `10.x`, `169.254.169.254`) are refused before the request and after every redirect, and listed in `FAILED`.
- Files above **Max file size** (at most 500 MB) are skipped: the download stops as soon as a file passes the limit.
- Up to 50,000 URLs per run, from the list and the dataset together. Longer lists: split them over several runs.
- Each download attempt has a time limit (**File timeout**, 120 seconds by default). Timeouts, dropped connections and HTTP 408, 425, 429 and 5xx answers are tried 3 times in total; other 4xx answers are not repeated.
- Disk: the run's disk is twice its memory, and each download in progress needs room for one file of the maximum size. With large limits the Actor runs fewer downloads at a time, and it says so in the log.
- Duplicates are found within one run; files stored in earlier runs are not compared.
- Apify does not document a maximum size for one key-value store record. The largest file tested with this Actor so far is 148 MB.
- You are responsible for having the rights to download and store the files you request.

### FAQ

**Am I charged for failed URLs or duplicates?** No. A file is charged only after it is stored and its row is saved. URLs that fail and files with the same content as one stored earlier in the run are free.

**How do I check that a file arrived intact?** Compare the `sha256` value with a hash of your copy, for example `shasum -a 256 file.zip` on macOS or `certutil -hashfile file.zip SHA256` on Windows.

**Can I use it after another scraper?** Yes. Set **Dataset with URLs** to the scraper's dataset ID, or add this Actor as an integration that starts when the scraper's run finishes. `sourceRow` carries the row's text and number fields, so you can join the files back to your products.

**Why does a link that works in my browser fail?** Some servers block automated clients or need a `Referer` header; add it in **Request headers**. Links that only work after logging in are not supported.

**What happens if the run is aborted?** Files saved so far stay in the store and the dataset, and the open ZIP part, `OUTPUT` and `FAILED` are written before the run stops.

**Can I run it on a schedule?** Yes. Save your input as a task and add a schedule, or call the task from Make, Zapier or n8n.

### Other Actors by the same author

- [Tech Stack Detector](https://apify.com/magicfingers/techstack-detector): the CMS, shop platform, analytics and hosting of a list of websites.
- All Actors: [apify.com/magicfingers](https://apify.com/magicfingers)

# Changelog

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

# Actor input Schema

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

Direct links to files or images, one per line (count: up to 50,000 URLs per run, together with the dataset). Only http and https links to public servers. Repeated URLs are downloaded once. Pages that need a log-in and video sites are not supported.

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

Optional: also read URLs from this dataset (ID or name), for example the output of a scraper run. The Actor only reads it. Rows are read 1,000 at a time.

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

Field of each dataset row that holds the URL, as a dot path such as images.url (text: a field name). Arrays are expanded, so a list of image links gives one file per link. Objects with a url or src field are read too.

## `output` (type: `string`):

files: each file is stored as its own record with its own link. zip: files are packed into ZIP parts of up to 500 MB and only the parts are stored. both: separate records and ZIP parts.

## `fileNamePattern` (type: `string`):

Name of each stored file (text with tokens): {index} position in the list, {basename} original file name, {stem} name without extension, {ext} extension, {hash} first 16 characters of the SHA-256 hash, {host} host name, and with a dataset any top-level field of the row, such as {sku}. The extension is added when missing; repeated names get -2, -3.

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

Optional name of a key-value store to keep the files after the run's retention period (letters, digits and hyphens, at most 63 characters). It is created when missing. Empty: the run's own store, kept for the retention period of your plan.

## `convertImagesTo` (type: `string`):

Optional format for images (PNG, JPEG, GIF, WebP, BMP, TIFF, ICO, AVIF). none keeps each image as it is. Animated images and images too large for the run's memory are kept as they are.

## `maxImageWidth` (type: `integer`):

Shrink wider images to this width, keeping the aspect ratio (unit: pixels). Empty: no resizing. Narrower images are not enlarged.

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

Store identical content once (same SHA-256 hash). A repeated file gets a free row whose duplicateOf names the first copy.

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

Skip files larger than this (unit: MB, 1 MB = 1,048,576 bytes). The download stops as soon as a file passes the limit. The run's disk is twice its memory: when a limit cannot fit, the run stops before any download and says how much memory it needs.

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

Optional allow-list of media types, one per line, for example image/\* or application/pdf. Empty: every type except HTML pages. Files of other types are listed in FAILED and not charged.

## `requestHeaders` (type: `object`):

Optional headers sent with every download, as a JSON object of text values, for example {"Referer": "https://example.com/"} (count: at most 20). Authorization and Cookie headers are not allowed: public files only.

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

Most downloads at the same time (unit: files). The Actor may use fewer when large files would not fit on the run's disk.

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

Longest time for one download attempt, redirects included (unit: seconds). Timeouts are tried 3 times in total.

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

Optional proxy for the downloads (an Apify Proxy group or your own proxy URLs). Default: no proxy.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/Icons/w3c_home.png",
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "urlField": "url",
  "output": "files",
  "fileNamePattern": "{index}-{basename}",
  "convertImagesTo": "none",
  "maxImageWidth": null,
  "skipDuplicates": true,
  "maxFileSizeMb": 50,
  "maxConcurrency": 10,
  "fileTimeoutSecs": 120,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per file: link, type, size, SHA-256 hash and image dimensions, as JSON.

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

Keys of the run's key-value store: the stored files and the ZIP parts (files-001.zip, files-002.zip...). With a named store, the files are in that store instead.

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

Counts of stored, duplicate, failed and skipped files, the store used and the list of ZIP parts with their links.

## `failed` (type: `string`):

URLs that gave no file, with the reason, the HTTP status and the number of attempts. They are not charged.

# 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/Icons/w3c_home.png",
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("magicfingers/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/Icons/w3c_home.png",
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("magicfingers/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/Icons/w3c_home.png",
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call magicfingers/bulk-file-downloader --silent --output-dataset

```

## MCP server setup

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