# Bulk Image Downloader — URLs or Any Dataset to Files and ZIP (`alaudinburki/bulk-image-downloader`) Actor

Download images from a URL list or any scraper's dataset: real files with public links, true format and pixel size, duplicate removal, size and format filters, and ZIP archives. $1 per 1,000 images.

- **URL**: https://apify.com/alaudinburki/bulk-image-downloader.md
- **Developed by:** [alaudin burki](https://apify.com/alaudinburki) (community)
- **Categories:** 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.00 / 1,000 results

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 Image Downloader — URLs or Any Dataset to Files and ZIP

Turn a list of image URLs, or the image field of **any scraper's dataset**, into real files: one link per image,
the true format and pixel size, duplicates removed, and the whole set packed into ZIP archives.

**$1 per 1,000 images saved.** Skipped and failed URLs are never charged.

### What it does

1. Collects URLs from `imageUrls`, and/or from a field of a dataset you pick (`product.images`, `imageUrl`, …:
   strings, arrays and `{url}` / `{src}` objects all work).
2. Downloads each file politely: honest user agent, retries on 429/5xx, and robots.txt respected by default.
3. Reads the **format and width × height from the file's own bytes**, never from the URL or the Content-Type
   header. A CDN serving WebP as `.jpg` is reported as WebP, and an HTML error page sent with a 200 is skipped, not
   saved as `photo.jpg`.
4. Drops duplicates by SHA-256, even when the same image comes from different URLs.
5. Saves every file to the run's key-value store with a direct link, and packs the set into ZIP parts.

### Input

| Field | What it does |
|---|---|
| `imageUrls` | Direct image URLs |
| `datasetId` + `urlField` | Read URLs from any dataset (e.g. a product or listing scraper's run) |
| `minWidth` / `minHeight` | Skip icons, spacers and tracking pixels |
| `formats` | Keep only e.g. `jpeg`, `png`, `webp` |
| `maxFileMb` | Skip bigger files (ceiling 9 MB, the per-record storage limit) |
| `dedupe` | Skip byte-identical images (default on) |
| `makeZip` | Also build ZIP parts (default on) |
| `maxImages` | Stop after this many saved images |

### Output

One row per saved image:

| Field | Example |
|---|---|
| `fileName` | `python-logo.png` |
| `format` / `mimeType` | `png` · `image/png` |
| `width` × `height` | 580 × 164 |
| `bytes` | 15770 |
| `fileUrl` | direct link to the file |
| `sha256` | content hash |
| `zipPart` | which ZIP part holds it |
| `sourceUrl` / `finalUrl` | as given, and after redirects |

The run's **SUMMARY** record lists the ZIP parts with their links (`images-part-001.zip`, …), counts skipped URLs
by reason, and names every skipped URL.

### Formats recognised

JPEG, PNG, GIF, WebP (lossy, lossless, alpha), AVIF, HEIC, BMP, ICO, TIFF and SVG. Width and height are read for
all except TIFF.

### Good to know

- **ZIP parts are ~8.5 MB each**, because a key-value store record holds at most 9 MB. A 200 MB set comes as about
  24 parts, each a normal ZIP that opens on its own.
- Images are stored, not re-encoded. No resizing or conversion, so you get the original bytes.
- Pages are not crawled for images. Give image URLs, or use a scraper's dataset as the source.
- A host whose robots.txt disallows the path is skipped and named in SUMMARY. You can turn the check off for hosts
  you own or have permission to fetch.

### Verification status (2026-11-11, local)

- ✅ 9 unit tests: format and size for eight real files (checked against macOS `sips`); HTML and JSON rejected;
  file names; dataset field paths; CRC-32 check value; the ZIP verified with `unzip -t` and read back byte for byte;
  ZIP parts stay under the limit.
- ✅ Live run of the default input: 3 of 3 saved, 0 schema mismatches. Also checked live: a byte-identical duplicate
  skipped, robots-disallowed and HTML URLs skipped, URLs read from a dataset's nested array field, and a wrong field
  name gives a clear error.

# Actor input Schema

## `imageUrls` (type: `array`):

Direct image URLs, one per line. Duplicates are dropped.

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

A dataset from any scraper run (e.g. its defaultDatasetId). The URLs are read from the field below.

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

Dotted path into each dataset item. A string, an array of strings, or objects with url/src all work, e.g. "imageUrl", "images", "product.image.url".

## `maxImages` (type: `integer`):

Stop after this many images are saved.

## `minWidth` (type: `integer`):

Skip images narrower than this — drops icons, spacers and tracking pixels. 0 = no limit.

## `minHeight` (type: `integer`):

Skip images shorter than this. 0 = no limit.

## `formats` (type: `array`):

Keep only these formats (detected from the file bytes, not the URL). Empty = all.

## `maxFileMb` (type: `number`):

Bigger files are skipped. The ceiling is 9 MB, the key-value store's per-record limit.

## `dedupe` (type: `boolean`):

Skip a file whose bytes (SHA-256) match one already saved, even from a different URL.

## `makeZip` (type: `boolean`):

Pack every saved image into ZIP parts of up to ~8.5 MB each, in the run's key-value store.

## `respectRobotsTxt` (type: `boolean`):

Skip URLs the image host's robots.txt disallows.

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

How many files download at once.

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

Give up on one file after this long.

## Actor input object example

```json
{
  "imageUrls": [
    "https://www.python.org/static/img/python-logo.png",
    "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
    "https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg"
  ],
  "urlField": "imageUrl",
  "maxImages": 3,
  "minWidth": 0,
  "minHeight": 0,
  "maxFileMb": 9,
  "dedupe": true,
  "makeZip": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 6,
  "timeoutSecs": 45
}
```

# Actor output Schema

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

Every row of the run, in the dataset (fields as listed under Output in the README).

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

Counts, items not found and other notes for the run.

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

// Run the Actor and wait for it to finish
const run = await client.actor("alaudinburki/bulk-image-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 = {
    "imageUrls": [
        "https://www.python.org/static/img/python-logo.png",
        "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png",
        "https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg",
    ],
    "maxImages": 3,
}

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

```

## MCP server setup

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