# Bulk Image Downloader (`brightpath-data/bulk-image-downloader`) Actor

Download images from a page or URL list, filtered by size and type, zipped in the key-value store

- **URL**: https://apify.com/brightpath-data/bulk-image-downloader.md
- **Developed by:** [Nick Randall](https://apify.com/brightpath-data) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.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

Need every product photo, gallery image or asset from a page as one download instead of dozens of right-clicks? Point this at a page or a list of direct image URLs and get back a single ZIP file with every image that passes your size and type filters.

Get a clean ZIP archive plus a per-image status report (kept, skipped, and why) as JSON, CSV or Excel, or call it as a tool from Claude, Cursor, ChatGPT or any MCP client. Pay only for the images actually included in the ZIP.

### What you get

For each run: a single ZIP file in the run's key-value store containing every image that was downloaded and passed your filters, plus a dataset with one status row per URL checked (`included`, `reason` when skipped, content type, byte size, and the filename it got in the ZIP). Give it a page URL to scan for `<img>` tags, a list of direct image URLs, or both.

Every status row is a flat record with stable field names, so it drops straight into a spreadsheet, a database or an AI agent's context, while the ZIP itself is the deliverable most buyers actually want.

### Why use this instead of downloading by hand

- Scans a page's `<img>` tags and `srcset` attributes for you, or takes a URL list directly
- Filters by content type and min/max file size before you pay for anything
- One ZIP file out, not dozens of individual downloads
- Works as an MCP tool, so AI agents can fetch a page's images on demand
- No browser, no proxies, no personal data: fast runs and a predictable cost per image

### Input

| Field | Type | Default | Meaning |
|-------|------|---------|---------|
| `startUrl` | string | | A page to scan for images (`<img>` tags and `srcset`). Optional if you pass `urls` directly. |
| `urls` | array | | Specific image URLs to download, instead of or alongside `startUrl`. |
| `contentTypes` | array | | Keep only images whose content-type contains one of these, e.g. `["png","webp"]`. Empty allows all image types. |
| `minBytes` | integer | 0 | Skip images smaller than this many bytes. |
| `maxBytes` | integer | 10000000 | Skip images larger than this many bytes. Keeps the ZIP and run memory bounded. |
| `maxResults` | integer | 50 | Cap on images downloaded and zipped. You are charged per image included, so this also caps your cost. |

Example input:

```json
{
  "startUrl": "https://en.wikipedia.org/wiki/Solar_System",
  "maxResults": 12,
  "maxBytes": 5000000
}
```

### Output

The ZIP: after the run finishes, open its **Storage > Key-value store** tab in the Apify Console and download the record named `IMAGES` (or fetch it directly, see below). The run's `OUTPUT` record also lists the direct API URL and how many images were included.

Per-URL status row (dataset), one per image candidate checked:

```json
{
  "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/example.jpg",
  "included": true,
  "reason": null,
  "contentType": "image/jpeg",
  "sizeBytes": 184213,
  "filename": "example.jpg"
}
```

Field reference: `url` (the image URL checked), `included` (true if it made it into the ZIP), `reason` (why it was skipped, e.g. "HTTP 404", "not an image content-type", "filtered by contentTypes", "larger than maxBytes (...)", null when included), `contentType`, `sizeBytes`, `filename` (its name inside the ZIP, de-duplicated automatically when two images share a name).

Fetch the ZIP directly once you have a run's key-value store ID (also printed in `OUTPUT`):

```bash
curl -o images.zip "https://api.apify.com/v2/key-value-stores/<storeId>/records/IMAGES?token=YOUR_APIFY_TOKEN"
```

### Pricing

Pay per event. You are charged **$8.00 per 1,000 images** actually downloaded and included in the ZIP, plus a fraction of a cent per run start. Nothing is charged for images that are skipped by your filters or fail to download. Set "Max total charge per run" in the run options to cap spending on any run. When a run reaches your cap it stops cleanly and keeps everything it already zipped.

Rough guide: 1,000 images cost $8.00 and take a while longer than a metadata-only Actor, since actual image bytes are downloaded; a typical run of a few dozen images finishes in well under a minute.

### Use it from an AI agent (MCP)

This Actor is available as an MCP tool through the Apify MCP server. Add it to your client, then ask the agent for the data in plain language.

Claude Desktop, Claude Code or Cursor (`mcp.json` / `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com/?actors=brightpath-data/bulk-image-downloader",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

ChatGPT and other clients that support remote MCP servers: add `https://mcp.apify.com/?actors=brightpath-data/bulk-image-downloader` as a connector with your Apify token.

Example prompt once connected: "Download every product image on this page as a zip: https://example.com/catalog"

### Use it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/brightpath-data~bulk-image-downloader/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrl":"https://en.wikipedia.org/wiki/Solar_System","maxResults":12,"maxBytes":5000000}'
```

Python (grab the ZIP after the run finishes):

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("brightpath-data/bulk-image-downloader").call(run_input={"startUrl": "https://en.wikipedia.org/wiki/Solar_System", "maxResults": 12})
store = client.key_value_store(run["defaultKeyValueStoreId"])
with open("images.zip", "wb") as f:
    f.write(store.get_record("IMAGES")["value"])
```

### Limits and fair use

- Up to 2,000 images per run; images are heavier than typical dataset rows, so very large runs take longer and use more memory. `maxBytes` (default 10 MB per image) keeps any single run bounded.
- Only URLs whose response content-type starts with `image/` are downloaded; everything else is skipped and reported with a reason.
- One request per image, with a short pause between requests to stay polite to the source server; a site that blocks automated requests will show up as failed rows with the HTTP status it returned, rather than being bypassed.
- The scan only reads `<img src>` and the first URL in each `srcset`; images injected purely by client-side JavaScript after page load are not seen (no browser is used).

### Data source and legal

This Actor downloads only images that are already publicly served by the page or URLs you give it, the same way your own browser would when loading that page. It does not bypass any login, paywall or access control. You are responsible for having the right to download and use the images you request.

### Support

Found a problem or need a field added? Open an issue on the Actor's Issues tab. Fixes for broken runs are prioritized.

# Actor input Schema

## `startUrl` (type: `string`):

A page to scan for images (its <img> tags and srcset attributes). Optional if you pass "urls" directly.

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

Specific image URLs to download, instead of or in addition to scanning a page.

## `contentTypes` (type: `array`):

Keep only images whose content-type contains one of these (e.g. "png", "jpeg", "webp"). Leave empty to allow all image types.

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

Skip images smaller than this, in bytes. 0 means no minimum.

## `maxBytes` (type: `integer`):

Skip images larger than this, in bytes. Keeps the zip and run memory bounded.

## `maxResults` (type: `integer`):

Maximum number of images to download and zip. You are charged per image included, so this also caps your cost.

## Actor input object example

```json
{
  "startUrl": "https://example.com",
  "minBytes": 0,
  "maxBytes": 10000000,
  "maxResults": 50
}
```

# Actor output Schema

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

The dataset with one flat record per result. Append ?format=csv or ?format=xlsx to the URL for other formats.

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

OUTPUT record in the key-value store: counts of results pushed and charged, requests, retries and duration.

# 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 = {
    "startUrl": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("brightpath-data/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 = { "startUrl": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("brightpath-data/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 '{
  "startUrl": "https://example.com"
}' |
apify call brightpath-data/bulk-image-downloader --silent --output-dataset

```

## MCP server setup

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