# Bulk Image Downloader: Page URLs, Image List or Dataset to ZIP (`appley_rhodolite/bulk-image-downloader`) Actor

Download images from web pages (page URLs), an image URL list or another Apify dataset. Optional ZIP bundles, resize, convert to JPG/PNG/WebP, minimum size filter, dedupe. Respects robots.txt and rate limits.

- **URL**: https://apify.com/appley_rhodolite/bulk-image-downloader.md
- **Developed by:** [TW Data Tools](https://apify.com/appley_rhodolite) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 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 Image Downloader - page URLs, image URL list or dataset to files and ZIP

Download all the images from web pages, from a list of image links, or from the dataset of a scraper you already ran. Images are saved in the key-value store (or bundled into ZIP files) together with a clean report: size, dimensions, SHA-256, the page each image came from and a download link. Resize, convert to JPG/PNG/WebP, remove duplicates, filter by minimum size and choose your own file names.

**$0.005 per saved image plus $0.005 per run start.** You only pay for images that were actually saved. Failed, skipped, too-small and duplicate images are free.

### Example 1: all images from a web page (page URLs mode)

Give the Actor one or more page addresses. It fetches each page and downloads the images found on it.

```json
{
  "pageUrls": ["https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa"],
  "maxImagesPerPage": 10,
  "minWidth": 200,
  "zipOutput": true
}
```

What is picked up from each page:

- `<img src>` and lazy-load attributes such as `data-src`
- `srcset` and `data-srcset`, choosing the largest candidate
- `<picture><source>` (one image per `<picture>`, the largest one)
- `og:image` and `twitter:image` meta tags
- `url(...)` in inline `style="background-image: ..."` (can be turned off)

Relative links are resolved against the page (and `<base href>`), `data:` URIs are ignored and duplicates are removed. Each output item has a `pageUrl` field with the page it was found on.

**Plain HTTP only, no JavaScript rendering.** The page HTML is fetched and parsed as the server sends it. Images that a page inserts later with JavaScript (infinite scroll, single-page apps, images behind a login) are not found. For those, run a browser-based scraper first and pass its dataset to this Actor (Example 3).

Page mode options:

| Field | Meaning | Default |
|---|---|---|
| `pageUrls` | Pages to scrape for images, one per line | - |
| `maxImagesPerPage` | Keep at most this many images per page, in document order (0 = no limit) | 100 |
| `sameDomainOnly` | Only images hosted on the same site as the page (`img.example.com` counts as `example.com`) | off |
| `minWidth` / `minHeight` | Skip smaller images. Checked after download, free, reason `too_small_dimensions` is recorded with the real size | 0 |
| `includeCssBackgrounds` | Also read inline CSS background images | on |

### Example 2: a list of image links

```json
{ "imageUrls": ["https://example.com/a.jpg", "https://example.com/b.png"], "convertTo": "webp", "maxWidth": 1600 }
```

### Example 3: after another scraper (dataset mode)

This is the typical workflow: scrape products, posts or listings, then download all their pictures.

1. Run your scraper and select its dataset in the `datasetId` field (or paste the dataset ID: Storage tab, or `defaultDatasetId` of the run).
2. Set `urlField` to the field that holds the image link, for example `imageUrl`, `images` or `media.photos`.
3. The field can hold one URL, an array of URLs, nested arrays, or objects with a `url` / `src` key. Dotted paths like `variants.image` work too.

```json
{ "datasetId": "AbCdEf123456", "urlField": "images", "zipOutput": true, "convertTo": "webp", "maxWidth": 1600 }
```

The Actor runs with limited permissions: it can read only the dataset you pass in `datasetId`, not the rest of your account.

You can combine `pageUrls`, `imageUrls` and `datasetId` in one run.

### What it does

- Scrapes the images of web pages (plain HTML), or downloads direct image URLs (JPG, PNG, WebP, GIF, BMP, SVG, AVIF, ...), following redirects.
- Reads URLs from another Apify dataset (`datasetId` + `urlField`), including nested arrays.
- Optional ZIP bundles split at about 100 MB (adjustable up to 400 MB), so large jobs stay easy to download.
- Optional resize (keeps aspect ratio, never enlarges) and conversion to JPG, PNG or WebP.
- Skips non-images, tracking pixels (`minBytes`, `minWidth`, `minHeight`), oversized files and duplicates (by URL and by content hash).
- One dataset item per image with the status (and one item per page that could not be read or had no images), so you can see exactly what happened.
- Polite by design: 5 parallel downloads, 2 requests per second per host, robots.txt respected for pages and images, 429 and `Retry-After` honored.

### All input fields

| Field | Meaning | Default |
|---|---|---|
| `pageUrls`, `maxImagesPerPage`, `sameDomainOnly`, `minWidth`, `minHeight`, `includeCssBackgrounds` | Page URLs mode, see above | - |
| `imageUrls` | Direct image links, one per line | - |
| `datasetId` + `urlField` | Take URLs from another Apify dataset | - |
| `zipOutput` / `zipSplitMB` | Bundle into ZIP files, new ZIP at about this size | off / 100 |
| `convertTo` | `original`, `jpg`, `png`, `webp` | original |
| `maxWidth` / `maxHeight` | Shrink to fit, keeping aspect ratio (0 = off) | 0 |
| `fileNamePattern` | `index` (00001.jpg), `original` (from the URL), `hash` (SHA-256 prefix) | index |
| `skipDuplicates` | Skip repeated URLs and identical content | on |
| `minBytes` | Skip files smaller than this | 0 |
| `maxFileSizeMB` | Per-file limit (hard cap 50) | 20 |
| `maxTotalSizeMB` | Per-run limit, the run stops cleanly when reached (hard cap 10,000) | 5,000 |
| `maxItems` | Process only the first N image URLs (0 = all) | 0 |
| `timeoutSecs`, `maxConcurrency`, `perHostRequestsPerSecond` | Speed and politeness | 30, 5, 2 |
| `respectRobotsTxt` | Skip pages and images disallowed by the host's robots.txt | on |

### ZIP output

With `zipOutput` on, images are written into `images-001.zip`, `images-002.zip`, ... in the run's key-value store instead of one record per image. A new ZIP starts at about `zipSplitMB` (default 100 MB). Each dataset item tells you the `zipFile`, the `zipEntry` (file name inside) and the `downloadUrl` of the ZIP.

### Pricing

- **$0.005 per saved image** plus **$0.005 per run start** (the start fee is charged once per GB of run memory; the default is 1 GB, so $0.005). The price is the same on every Apify plan.
- Examples: 100 images cost about $0.505. 1,000 images cost about $5.005. 10,000 images cost about $50.005.
- You are not charged for pages that fail, URLs that fail, files that are not images, images disallowed by robots.txt, images skipped for being too small, or duplicates.
- Set a maximum cost per run in the Apify run options. The Actor stops cleanly when the limit is reached, and finished images stay saved.

### Output example

```json
{
  "sourceUrl": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/The_Great_Wave_off_Kanagawa.jpg/330px-The_Great_Wave_off_Kanagawa.jpg",
  "pageUrl": "https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa",
  "status": "ok",
  "error": null,
  "reason": null,
  "contentType": "image/jpeg",
  "width": 330,
  "height": 223,
  "bytes": 36653,
  "sha256": "3f0c...e91a",
  "kvKey": "00003.jpg",
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/xxxx/records/00003.jpg",
  "zipFile": null,
  "zipEntry": null,
  "fetchedAt": "2026-11-08T12:00:00Z"
}
```

`pageUrl` is `null` for images that came from `imageUrls` or a dataset. A skipped image looks like `{"status": "error", "reason": "too_small_dimensions", "error": "Image is 40x40 px, smaller than minWidth x minHeight (200x0)"}`. A page that cannot be used appears as one item with the page in `sourceUrl` and `pageUrl`.

Reason codes: `http_404`, `http_429`, `not_image`, `not_html`, `too_large`, `too_small`, `too_small_dimensions`, `robots_disallowed`, `no_images_found`, `duplicate_url`, `duplicate_content`, `timeout`, `dns_error`, `blocked_host`, `process_failed`.

### FAQ

**Can I give it a web page and get all images on it?** Yes, use `pageUrls`. It reads the page's HTML only: images added by JavaScript after the page loads are not found.

**Why was my page or image skipped with `robots_disallowed`?** The host's robots.txt forbids automated access to that path for this bot. Turn `respectRobotsTxt` off only for hosts you own or that explicitly allow automated downloads.

**Why did a page give `no_images_found`?** The page has no images in its HTML, often because it is rendered by JavaScript, or every image was filtered out by `sameDomainOnly`.

**What happens when the limit is hit?** When `maxTotalSizeMB` or your maximum cost per run is reached, the run stops cleanly, finished images stay saved and the log says why.

**How long are the files kept?** In the run's key-value store, subject to your Apify storage retention.

**Do you bypass logins or paywalls?** No. See the legal note.

### Legal note

You are responsible for having the right to download and use the images you request. Check copyright, licenses and the website's terms. This Actor follows robots.txt rules by default (for page fetches and image downloads), applies rate limits, honors 429 and Retry-After, and does not log in, bypass paywalls, solve CAPTCHAs or get around anti-bot protection. Private and local network addresses are refused.

# Actor input Schema

## `pageUrls` (type: `array`):

Web pages to scrape for images, one per line. The Actor fetches each page with plain HTTP (no JavaScript rendering) and downloads the images it finds: <img src> and data-src, srcset (largest), <picture><source>, og:image / twitter:image and inline CSS background-image. Relative links are resolved, duplicates removed.

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

Direct links to image files (one per line). Can be combined with page URLs and the dataset fields.

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

Take the image URLs from another Apify dataset, for example the output of a scraper you ran before. Needs 'URL field' too.

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

Name of the field that holds the image URL or an array of URLs. Nested arrays and dotted paths (media.images) work; objects with a url / src key are accepted.

## `maxImagesPerPage` (type: `integer`):

Page URLs mode: keep at most this many images from each page (document order). 0 = no limit.

## `sameDomainOnly` (type: `boolean`):

Page URLs mode: only download images hosted on the same site as the page (images.example.com counts as example.com).

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

Skip images narrower than this. Checked after download, the skip reason is recorded (too_small_dimensions) and the image is free. 0 = off.

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

Skip images shorter than this. Checked after download, the skip reason is recorded (too_small_dimensions) and the image is free. 0 = off.

## `includeCssBackgrounds` (type: `boolean`):

Page URLs mode: also pick up url(...) from inline style="background-image: ..." attributes.

## `zipOutput` (type: `boolean`):

Store the images inside ZIP files (key images-001.zip, ...) instead of one record per image. A new ZIP starts at about the size below.

## `zipSplitMB` (type: `integer`):

Start a new ZIP file after about this many MB of images.

## `convertTo` (type: `string`):

Re-encode every image to this format. 'original' keeps the file bytes untouched.

## `maxWidth` (type: `integer`):

Shrink images wider than this, keeping aspect ratio. 0 = no limit. Never enlarges.

## `maxHeight` (type: `integer`):

Shrink images taller than this, keeping aspect ratio. 0 = no limit. Never enlarges.

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

index = 00001.jpg (position in your list), original = name taken from the URL, hash = first 16 characters of the SHA-256.

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

Skip repeated URLs and images with identical content (SHA-256). Skipped duplicates are free.

## `minBytes` (type: `integer`):

Skip files smaller than this, e.g. 1x1 tracking pixels.

## `maxFileSizeMB` (type: `integer`):

Files larger than this are skipped (reason too_large).

## `maxTotalSizeMB` (type: `integer`):

The run stops cleanly once this much data has been saved.

## `maxItems` (type: `integer`):

Process only the first N URLs. 0 = all.

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

Give up on a request that stalls for this long. Failed requests are retried up to 3 times.

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

Parallel downloads (all hosts together). Keep it low to be polite.

## `perHostRequestsPerSecond` (type: `number`):

Rate limit for each website. 429 and Retry-After responses are honored automatically.

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

Fetch robots.txt once per host and skip URLs it disallows for this bot. Turn off only for hosts you own or that explicitly allow automated downloads.

## Actor input object example

```json
{
  "pageUrls": [
    "https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa"
  ],
  "maxImagesPerPage": 10,
  "sameDomainOnly": false,
  "minWidth": 200,
  "minHeight": 0,
  "includeCssBackgrounds": true,
  "zipOutput": false,
  "zipSplitMB": 100,
  "convertTo": "original",
  "maxWidth": 0,
  "maxHeight": 0,
  "fileNamePattern": "index",
  "skipDuplicates": true,
  "minBytes": 0,
  "maxFileSizeMB": 20,
  "maxTotalSizeMB": 5000,
  "maxItems": 0,
  "timeoutSecs": 30,
  "maxConcurrency": 5,
  "perHostRequestsPerSecond": 2,
  "respectRobotsTxt": true
}
```

# Actor output Schema

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

One item per URL (status, size, hash, download link).

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

Overview view of the default dataset.

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

Key-value store with the downloaded images or ZIP files.

# 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 = {
    "pageUrls": [
        "https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa"
    ],
    "maxImagesPerPage": 10,
    "minWidth": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("appley_rhodolite/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 = {
    "pageUrls": ["https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa"],
    "maxImagesPerPage": 10,
    "minWidth": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("appley_rhodolite/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 '{
  "pageUrls": [
    "https://en.wikipedia.org/wiki/The_Great_Wave_off_Kanagawa"
  ],
  "maxImagesPerPage": 10,
  "minWidth": 200
}' |
apify call appley_rhodolite/bulk-image-downloader --silent --output-dataset

```

## MCP server setup

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