# Bulk Image Downloader & WebP Optimizer

**Use case:** 

Download public image collections in bulk, resize without upscaling, strip EXIF metadata, convert to compact WebP, deduplicate by SHA-256, and package into ARCHIVE.zip.

## Input

```json
{
  "urls": [
    "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png"
  ],
  "urlFieldPaths": [
    "url",
    "imageUrl",
    "fileUrl",
    "pdfUrl",
    "downloadUrl",
    "images[].url",
    "media.files[].href"
  ],
  "maxFiles": 1000,
  "concurrency": 8,
  "timeoutSecs": 30,
  "maxRetries": 2,
  "maxRedirects": 5,
  "maxFileSizeMb": 50,
  "allowedMimePrefixes": [
    "image/"
  ],
  "customHeaders": {},
  "filenameStrategy": "original",
  "optimizeImages": true,
  "imageFormat": "webp",
  "imageQuality": 82,
  "maxWidth": 1600,
  "stripMetadata": true,
  "storeInKvs": true,
  "createZipArchive": true,
  "zipFilename": "ARCHIVE.zip",
  "uploadToS3": false,
  "s3Region": "auto",
  "s3Prefix": "",
  "s3ForcePathStyle": false,
  "s3CacheControl": "public, max-age=31536000, immutable",
  "s3Acl": "",
  "skipExistingInBucket": true,
  "deduplicateByHash": true,
  "watchMode": false,
  "onlyNew": true,
  "watchStateKey": "default-media-watch"
}
```

## Output

```json
{
  "status": {
    "label": "Status",
    "format": "string"
  },
  "filename": {
    "label": "Filename",
    "format": "string"
  },
  "mimeType": {
    "label": "MIME Type",
    "format": "string"
  },
  "finalBytes": {
    "label": "Final Bytes",
    "format": "integer"
  },
  "imageOptimized": {
    "label": "Optimized",
    "format": "boolean"
  },
  "kvsUrl": {
    "label": "KVS File URL",
    "format": "string"
  },
  "cloudUrl": {
    "label": "Cloud URL",
    "format": "string"
  },
  "zipEntryPath": {
    "label": "ZIP Path",
    "format": "string"
  },
  "sourceUrl": {
    "label": "Source URL",
    "format": "string"
  },
  "errorCode": {
    "label": "Error Code",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Bulk File & Image Downloader — S3, Cloudflare R2, ZIP & WebP Actor is ready to run with the inputs already set for "Bulk Image Downloader & WebP Optimizer". [Sign up or log in](https://console.apify.com/create-task-from-example/AviJA6voVu6bnerRZ) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Bulk Image Downloader & WebP Optimizer" task

The Bulk File & Image Downloader — S3, Cloudflare R2, ZIP & WebP Actor will start running based on the input automatically. You can also change all the input fields, like file & media urls, dataset url field paths, and more, to match your specific use case.

### 3. Receive the "Bulk Image Downloader & WebP Optimizer" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as status, filename, MIME Type, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Bulk Image Downloader & WebP Optimizer" task via API](https://apify.com/structmint/bulk-file-media-downloader.md).

## FAQ

### Does image optimization ever upscale small images?

No. Resizing uses fit='inside' with withoutEnlargement=true, so aspect ratios are always preserved and images smaller than maxWidth/maxHeight keep their native dimensions.

### Are non-image URLs rejected before buffering?

Yes. With allowedMimePrefixes set to ['image/'], any non-image response is aborted immediately after inspecting response headers and incurs zero event charges.

## About this Actor

This example demonstrates how to use [Bulk File & Image Downloader — S3, Cloudflare R2, ZIP & WebP](https://apify.com/structmint/bulk-file-media-downloader.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/structmint/bulk-file-media-downloader.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/structmint/bulk-file-media-downloader.md

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`).
