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

Download every image from any webpage or direct image URL - at scale. Smart srcset handling picks the highest-resolution variant. Optional sha256 dedup, EXIF stripping for privacy, and minimum size/width filters.

- **URL**: https://apify.com/thirdwatch/bulk-image-downloader.md
- **Developed by:** [Thirdwatch](https://apify.com/thirdwatch) (community)
- **Categories:** SEO tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Bulk Image Downloader

> Save every image from any webpage at scale — full files, dimensions, format, file size, and SHA-256 hash. Paste page URLs or direct image links.

### What you get

Give it a list of URLs and get back every image plus rich metadata: width, height, format, content type, byte size, and a SHA-256 hash for dedup. The actor handles both modes — point it at a webpage and it parses the HTML for `<img>`, `<picture>`, `srcset`, and Open Graph tags; or pass a direct image URL and it downloads it straight. Auto-mode picks the right path per URL by inspecting Content-Type. Highest-resolution variants from `srcset` are picked automatically. Files are saved to the run's key-value store and each dataset row carries a ready-to-use download URL.

### Bulk download images from any URL

A single tool for collecting images at scale across hundreds or thousands of pages. No browser, no JavaScript rendering — fast HTTP fetch with up to 10 concurrent connections per run. Supports webpages, direct image URLs, responsive `srcset` images, and Open Graph / Twitter card images.

### Image dataset builder for ML

Built for teams assembling training corpora. Use `dedupByHash` to skip identical images across pages, `minWidth` and `minSizeBytes` to filter out tracking pixels and tiny thumbnails, and `maxImagesPerUrl` to keep first runs cheap. Every image lands in the run's key-value store with a stable `kv_key` and a direct download URL on each dataset row, so you can pipe results straight into a downstream training pipeline.

### Output fields

| Field | Description |
|-------|-------------|
| `source_url` | The input URL the image was discovered on |
| `image_url` | Absolute URL of the image file |
| `kv_store_key` | Key under which the image is stored in the run's key-value store |
| `kv_url` | Fully formed Apify API URL to download the image |
| `filename` | Suggested filename (sequence number + short hash + extension) |
| `content_type` | HTTP `Content-Type` (e.g., `image/jpeg`, `image/png`, `image/webp`) |
| `size_bytes` | File size in bytes |
| `sha256` | SHA-256 hash of the image bytes (used for dedup) |
| `width` | Image width in pixels |
| `height` | Image height in pixels |
| `format` | Decoded image format (JPEG, PNG, WEBP, GIF, etc.) |
| `from_srcset` | `true` if extracted from a responsive `srcset` |
| `downloaded_at` | ISO-8601 timestamp when the image was fetched |

### Example output

```json
{
  "source_url": "https://en.wikipedia.org/wiki/Cat",
  "image_url": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
  "kv_store_key": "000007_3a1f9b2c.jpg",
  "kv_url": "https://api.apify.com/v2/key-value-stores/abc123/records/000007_3a1f9b2c.jpg",
  "filename": "000007_3a1f9b2c.jpg",
  "content_type": "image/jpeg",
  "size_bytes": 432109,
  "sha256": "3a1f9b2c4d5e6f7081929394a5b6c7d8e9f0a1b2c3d4e5f60718293a4b5c6d7e",
  "width": 1280,
  "height": 853,
  "format": "JPEG",
  "from_srcset": true,
  "downloaded_at": "2026-05-04T10:11:12.345678+00:00"
}
````

### Input parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `urls` | Yes | List of webpage URLs to scan for images, or direct image URLs to download. |
| `mode` | No | `auto` (default), `page`, or `direct`. Auto inspects Content-Type; page parses HTML; direct treats every URL as an image. |
| `includeSrcset` | No | Pull images from responsive `srcset` and `<picture>` elements. Default `true`. |
| `minWidth` | No | Skip images smaller than this width when dimensions are known. Default `0` (disabled). |
| `minSizeBytes` | No | Skip files smaller than this many bytes (filters tracking pixels). Default `0` (disabled). |
| `maxImagesPerUrl` | No | Cap on images downloaded per input URL. Default `100`, max `1000`. |
| `dedupByHash` | No | Skip duplicates whose SHA-256 hash matches one already downloaded. Default `true`. |
| `stripExif` | No | Re-encode JPEGs without EXIF metadata for privacy. Default `false`. |
| `proxyConfiguration` | No | Optional proxy. Most public sites do not require one. |

### Use cases

- **ML engineers**: build image datasets for training and fine-tuning by harvesting category, search, or gallery pages.
- **Site auditors**: measure image bloat across a domain — count files, total bytes, and average size per page.
- **E-commerce teams**: scrape product image catalogs for migration, redesign, or competitive research.
- **Archivists**: snapshot every image from a portfolio, gallery, or news site for offline backup.
- **Privacy-conscious publishers**: strip EXIF metadata from user-submitted images before re-publishing.

### Limitations

- `stripExif` only re-encodes JPEGs (the most common EXIF carrier). Re-encoding is light-touch but technically lossy.
- Inline `data:` URIs are skipped; only fetchable URLs are downloaded.
- Sites that gate images behind a login or short-lived signed URLs cannot be scraped.
- Maximum image count per page is capped at 1,000 to protect runtime; use `maxImagesPerUrl` to keep first runs cheap.
- The actor uses HTTP fetch only — pages that render images via JavaScript after load (some SPAs) may not expose all images.

### Compared to alternatives

- **vs. generic Apify image downloaders**: this actor returns full per-image metadata (width, height, format, hash, byte size) on the dataset row, plus a ready-to-use `kv_url` so you don't have to construct download URLs yourself. Built-in dedup, srcset handling, and EXIF stripping save a separate post-processing pass.
- **vs. running `wget` or a custom script**: hosted, retried, deduplicated, and observable in the Apify Console with no infrastructure to maintain.

### FAQ

**Where are the images stored?**
Every image is saved as a record in the run's default **key-value store**. Each dataset row carries a `kv_url` you can fetch directly, or you can browse the run's "Storage" tab in the Apify Console.

**Can I download images directly without scraping a webpage?**
Yes — set `mode: "direct"`, or leave `mode: "auto"` and pass image URLs. The actor will skip HTML parsing and download each URL as an image.

**Will it follow links to other pages?**
No. The actor only downloads images from the URLs you provide. To crawl, run a sitemap or link-extraction scraper first and feed the URLs in.

**Does it handle responsive images correctly?**
Yes. With `includeSrcset: true` (default), the highest-resolution variant from each `srcset` or `<picture>` element is selected.

**Does it dedupe across pages?**
Yes. With `dedupByHash: true` (default), an image already downloaded in this run is skipped on later pages.

**How do I keep my first run cheap?**
Lower `maxImagesPerUrl` (e.g., 10 or 20) and run on a handful of URLs first to validate output before scaling.

Last verified: 2026-05

More scrapers at [thirdwatch.dev](https://thirdwatch.dev).

# Actor input Schema

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

List of webpage URLs to scan for images, or direct image URLs to download. Mode is auto-detected by Content-Type by default.

## `mode` (type: `string`):

How to interpret each input URL. 'auto' inspects Content-Type via HEAD; 'page' always parses as HTML; 'direct' always treats URL as an image.

## `includeSrcset` (type: `boolean`):

Extract images from srcset attributes (responsive images and <picture> elements). Picks the highest-resolution variant from each set.

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

Skip images smaller than this width when dimensions can be determined. Set to 0 to disable.

## `minSizeBytes` (type: `integer`):

Skip files smaller than this many bytes (useful to filter out tracking pixels and tiny icons). Set to 0 to disable.

## `maxImagesPerUrl` (type: `integer`):

Cap the number of images downloaded per input URL.

## `dedupByHash` (type: `boolean`):

Skip images whose bytes match one already downloaded in this run.

## `stripExif` (type: `boolean`):

Re-encode JPEGs without EXIF metadata for privacy. Slightly slower; uses Pillow.

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

Optional proxy. Most public sites do not require one.

## Actor input object example

```json
{
  "urls": [
    "https://www.apify.com"
  ],
  "mode": "auto",
  "includeSrcset": true,
  "minWidth": 0,
  "minSizeBytes": 0,
  "maxImagesPerUrl": 100,
  "dedupByHash": true,
  "stripExif": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

# 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.apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thirdwatch/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 = { "urls": ["https://www.apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("thirdwatch/bulk-image-downloader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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.apify.com"
  ]
}' |
apify call thirdwatch/bulk-image-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=thirdwatch/bulk-image-downloader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Bulk Image Downloader",
        "description": "Download every image from any webpage or direct image URL - at scale. Smart srcset handling picks the highest-resolution variant. Optional sha256 dedup, EXIF stripping for privacy, and minimum size/width filters.",
        "version": "1.0",
        "x-build-id": "wJbjhatQBJ1pMtaeH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/thirdwatch~bulk-image-downloader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-thirdwatch-bulk-image-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/thirdwatch~bulk-image-downloader/runs": {
            "post": {
                "operationId": "runs-sync-thirdwatch-bulk-image-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/thirdwatch~bulk-image-downloader/run-sync": {
            "post": {
                "operationId": "run-sync-thirdwatch-bulk-image-downloader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "URLs",
                        "type": "array",
                        "description": "List of webpage URLs to scan for images, or direct image URLs to download. Mode is auto-detected by Content-Type by default.",
                        "default": [
                            "https://www.apify.com"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "auto",
                            "page",
                            "direct"
                        ],
                        "type": "string",
                        "description": "How to interpret each input URL. 'auto' inspects Content-Type via HEAD; 'page' always parses as HTML; 'direct' always treats URL as an image.",
                        "default": "auto"
                    },
                    "includeSrcset": {
                        "title": "Include srcset (responsive images)",
                        "type": "boolean",
                        "description": "Extract images from srcset attributes (responsive images and <picture> elements). Picks the highest-resolution variant from each set.",
                        "default": true
                    },
                    "minWidth": {
                        "title": "Minimum width (px)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Skip images smaller than this width when dimensions can be determined. Set to 0 to disable.",
                        "default": 0
                    },
                    "minSizeBytes": {
                        "title": "Minimum file size (bytes)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Skip files smaller than this many bytes (useful to filter out tracking pixels and tiny icons). Set to 0 to disable.",
                        "default": 0
                    },
                    "maxImagesPerUrl": {
                        "title": "Max images per input URL",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Cap the number of images downloaded per input URL.",
                        "default": 100
                    },
                    "dedupByHash": {
                        "title": "Deduplicate by sha256 hash",
                        "type": "boolean",
                        "description": "Skip images whose bytes match one already downloaded in this run.",
                        "default": true
                    },
                    "stripExif": {
                        "title": "Strip EXIF metadata",
                        "type": "boolean",
                        "description": "Re-encode JPEGs without EXIF metadata for privacy. Slightly slower; uses Pillow.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy. Most public sites do not require one.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
