# Bulk File & Image Downloader — S3, Cloudflare R2, ZIP & WebP (`structmint/bulk-file-media-downloader`) Actor

Bulk download public images, PDFs, audio, and media files from URLs or Apify Datasets. Optimize images to WebP/AVIF, deduplicate by SHA-256, create ZIP archives, or sync to AWS S3, Cloudflare R2, and Backblaze B2.

- **URL**: https://apify.com/structmint/bulk-file-media-downloader.md
- **Developed by:** [StructMint](https://apify.com/structmint) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 files downloaded

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/actors/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 File & Media Downloader — S3, Cloudflare R2, ZIP & WebP

Download public images, PDFs, documents, audio, video, and binary assets in bulk from **direct URL lists** or **any Apify Dataset** — with built-in **sharp image optimization (WebP / AVIF / JPEG / PNG)**, **SHA-256 deduplication**, **streaming `ARCHIVE.zip` packaging**, and **direct upload to AWS S3, Cloudflare R2, Backblaze B2, and S3-compatible buckets**.

Built for reliable, memory-safe automation at **256 MB – 4,096 MB RAM** under `LIMITED_PERMISSIONS`: every URL and redirect hop is SSRF-validated, oversized files are aborted mid-stream before blowing memory, and failed, rejected, skipped, or duplicate files are **never billed**.

***

### Key Capabilities

- **Flexible Input Sources:** Pass plain URL strings, rich URL objects (`{ url, filename, folder, metadata }`), an Apify Dataset ID (`sourceDatasetId`), or a remote JSON/NDJSON dataset endpoint (`sourceDatasetUrl`).
- **Deep Nested Field Extraction:** Extract URLs from any dataset shape using dot and bracket paths such as `imageUrl`, `images[].url`, `media.files[].href`, `gallery[0].src`, or `attachments[]`.
- **On-the-Fly Image Optimization (`sharp`):** Convert raster images (JPEG, PNG, WebP, AVIF, TIFF, GIF) to **WebP**, **AVIF**, **JPEG**, or **PNG**, resize within `maxWidth`/`maxHeight` without upscaling, auto-orient pixels, and strip EXIF/GPS metadata. PDFs, archives, and non-image files pass through untouched.
- **Direct Cloud Sync (Zero Egress Lock-In):** Stream downloaded assets straight to **AWS S3**, **Cloudflare R2**, **Backblaze B2**, **GCS S3-interop**, **Wasabi**, **DigitalOcean Spaces**, or **MinIO**, with optional `HeadObject` checks (`skipExistingInBucket`) and custom CDN `s3PublicBaseUrl`.
- **Apify Key-Value Store & Streaming `ARCHIVE.zip`:** Save individual files with sanitized collision-free filenames in the run's Key-Value Store and/or pack everything into a single downloadable `ARCHIVE.zip`.
- **SHA-256 Deduplication & Incremental Watch Mode:** Eliminate duplicate binaries within a run (`deduplicateByHash: true`) and skip previously processed URLs/hashes across scheduled runs (`watchMode: true`, `onlyNew: true`) using a user-scoped Named Key-Value Store (90-day retention).
- **Enterprise Network & Memory Safety:** Strict `http:`/`https:` SSRF guard resolves DNS on every request and every redirect hop, blocks private/loopback/link-local/CGNAT/ULA/metadata IP ranges, strips `Authorization`/`Cookie` on cross-origin redirects, filters by `allowedMimePrefixes` before buffering, and aborts oversized downloads mid-stream.

***

### Transparent Pay-Per-Event Pricing

All usage is billed exclusively through Apify Pay-Per-Event. **Failed, SSRF-blocked, MIME-rejected, oversize-aborted, deduplicated, watch-skipped, and bucket-skipped URLs incur zero event charges.**

| Event | Description | FREE | BRONZE | SILVER | GOLD | PLATINUM | DIAMOND |
| :--- | :--- | ---: | ---: | ---: | ---: | ---: | ---: |
| `apify-actor-start` | One-time platform run start fee | `$0.00005` | `$0.00005` | `$0.00005` | `$0.00005` | `$0.00005` | `$0.00005` |
| `file-downloaded` | Per successfully downloaded non-duplicate file | `$0.0018` | `$0.0018` | `$0.0016` | `$0.0014` | `$0.0014` | `$0.0014` |
| `stored-10mib` | Per started 10 MiB stored in Apify KVS / `ARCHIVE.zip` per file (`0` if cloud-only) | `$0.0025` | `$0.0024` | `$0.0023` | `$0.0022` | `$0.0022` | `$0.0022` |
| `cloud-uploaded-10mib` | Per started 10 MiB uploaded to S3/R2/B2/S3-compatible storage across the run | `$0.0050` | `$0.0046` | `$0.0043` | `$0.0040` | `$0.0040` | `$0.0040` |
| `image-optimized` | Per raster image resized or converted via `sharp` | `$0.0015` | `$0.0014` | `$0.0013` | `$0.0012` | `$0.0012` | `$0.0012` |

#### Cost Examples (BRONZE Tier)

- **100 product photos (~50 MB raw → ~16 MB WebP) synced straight to Cloudflare R2 (`storeInKvs: false`):**
  `100 × $0.0018` + `100 × $0.0014` + `2 × $0.0046` + `$0.00005` = **`~$0.329`**
- **200 public PDFs (~40 MB total) downloaded & packaged into `ARCHIVE.zip`:**
  `200 × $0.0018` + `200 × $0.0024` + `$0.00005` = **`~$0.840`**
- **Budget Protection:** Set `maxTotalChargeUsd` in input or via Apify's run-level spend cap. If the cap is reached mid-run, remaining queued URLs are gracefully marked `budget_skipped` without exceeding your limit.

***

### Quickstart Example Input

```json
{
  "urls": [
    "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf",
    {
      "url": "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png",
      "folder": "icons",
      "metadata": { "assetGroup": "store-badges" }
    }
  ],
  "concurrency": 5,
  "optimizeImages": true,
  "imageFormat": "webp",
  "imageQuality": 82,
  "maxWidth": 1200,
  "storeInKvs": true,
  "createZipArchive": true,
  "deduplicateByHash": true
}
```

### Example Dataset Output Item

```json
{
  "sourceUrl": "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png",
  "finalUrl": "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png",
  "status": "downloaded",
  "httpStatus": 200,
  "filename": "pdf-structured-tables-watch.webp",
  "folder": "icons",
  "mimeType": "image/webp",
  "extension": "webp",
  "originalBytes": 42180,
  "finalBytes": 14620,
  "bytesSaved": 27560,
  "sha256": "6e8b9c1f4d2a...",
  "imageOptimized": true,
  "imageWidth": 512,
  "imageHeight": 512,
  "kvsKey": "icons__pdf-structured-tables-watch.webp",
  "kvsUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/icons__pdf-structured-tables-watch.webp",
  "zipEntryPath": "icons/pdf-structured-tables-watch.webp",
  "cloudProvider": null,
  "cloudBucket": null,
  "cloudKey": null,
  "cloudUrl": null,
  "duplicateOfUrl": null,
  "errorCode": null,
  "errorMessage": null,
  "metadata": { "assetGroup": "store-badges" },
  "processedAt": "2026-12-06T10:15:00.000Z"
}
```

A consolidated run diagnostic report (counts, total bytes saved, `ARCHIVE.zip` link, billing breakdown, and warnings) is saved to the default Key-Value Store under **`OUTPUT`**.

***

### Cloud Storage Setup Examples

Credentials (`accessKeyId` and `secretAccessKey`) are marked secret in Apify Input Schema — encrypted at rest and never written to logs or datasets.

#### 1. Cloudflare R2 (Zero Egress)

```json
{
  "sourceDatasetUrl": "https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json",
  "urlFieldPaths": ["imageUrl", "images[].url"],
  "optimizeImages": true,
  "imageFormat": "webp",
  "storeInKvs": false,
  "uploadToS3": true,
  "s3Endpoint": "https://<YOUR_ACCOUNT_ID>.r2.cloudflarestorage.com",
  "s3Region": "auto",
  "s3Bucket": "my-media-bucket",
  "s3Prefix": "catalog/2026",
  "accessKeyId": "<R2_ACCESS_KEY_ID>",
  "secretAccessKey": "<R2_SECRET_ACCESS_KEY>",
  "s3PublicBaseUrl": "https://cdn.example.com",
  "s3Acl": "",
  "skipExistingInBucket": true,
  "watchMode": true,
  "onlyNew": true,
  "watchStateKey": "catalog-r2-sync"
}
```

#### 2. AWS S3

```json
{
  "urls": ["https://example.com/reports/q4-summary.pdf"],
  "storeInKvs": false,
  "uploadToS3": true,
  "s3Region": "us-east-1",
  "s3Bucket": "my-s3-archive-bucket",
  "s3Prefix": "documents/q4",
  "accessKeyId": "<AWS_ACCESS_KEY_ID>",
  "secretAccessKey": "<AWS_SECRET_ACCESS_KEY>",
  "s3CacheControl": "private, max-age=86400",
  "s3Acl": "",
  "skipExistingInBucket": true
}
```

#### 3. Backblaze B2 (S3-Compatible API)

```json
{
  "urls": ["https://example.com/assets/brochure.pdf"],
  "storeInKvs": false,
  "uploadToS3": true,
  "s3Endpoint": "https://s3.us-west-004.backblazeb2.com",
  "s3Region": "us-west-004",
  "s3Bucket": "my-b2-media-bucket",
  "s3Prefix": "backups/brochures",
  "accessKeyId": "<B2_KEY_ID>",
  "secretAccessKey": "<B2_APPLICATION_KEY>",
  "skipExistingInBucket": true
}
```

***

### Integrations: Direct Apify Add Integration, n8n, Make & Apify MCP

#### Direct Apify Actor-to-Actor Integration (`Add integration`)

Wire this Actor directly after any upstream scraper from the source Actor's **Integrations → Add integration** tab without glue code:

- **Recommended (`LIMITED_PERMISSIONS` safe):** Map `"sourceDatasetId": "{{resource.defaultDatasetId}}"` (or choose a dataset in the native Dataset Resource Picker). Because `sourceDatasetId` declares `resourceType: "dataset"` and `resourcePermissions: ["READ"]`, Apify automatically grants read-only access to the triggering run's private dataset without requiring `FULL_PERMISSIONS`.
- **Implicit webhook payload fallback:** If `urls`, `sourceDatasetId`, and `sourceDatasetUrl` are omitted, the Actor automatically inspects Apify's implicit webhook `payload.resource.defaultDatasetId` (or `resource.defaultDatasetId`).

```json
{
  "sourceDatasetId": "{{resource.defaultDatasetId}}",
  "urlFieldPaths": ["imageUrl", "images[].url", "pdfUrl"],
  "optimizeImages": true,
  "imageFormat": "webp",
  "createZipArchive": true
}
```

#### n8n / Make Synchronous Webhook Run

Trigger the Actor synchronously from an n8n HTTP Request node or Make HTTP module and receive the manifest dataset JSON directly:

```text
POST https://api.apify.com/v2/actors/structmint~bulk-file-media-downloader/run-sync-get-dataset-items?maxTotalChargeUsd=0.25
Authorization: Bearer <APIFY_API_TOKEN>
Content-Type: application/json
```

Pair with `watchMode: true` and `onlyNew: true` on a schedule so unchanged assets return `status: "watch_skipped"` with zero upload or download charges.

#### AI Agent & MCP Usage (`mcp.apify.com`)

This Actor exposes complete JSON schemas for both input and dataset output (`overview` table view + typed fields), making it directly callable from MCP-compatible AI agents via `mcp.apify.com` to fetch, optimize, archive, and mirror public media/PDF assets into Cloudflare R2 or AWS S3.

***

### Notes on `LIMITED_PERMISSIONS` & External Datasets

This Actor runs under `LIMITED_PERMISSIONS` for account safety. Selecting a private dataset via `sourceDatasetId` (declared with `resourceType: "dataset"` and `resourcePermissions: ["READ"]`) lets Apify safely grant read-only access to only that dataset at run start. If a dataset is unreadable under the active run token, the Actor reports a clear diagnostic warning in `OUTPUT.warnings` instead of crashing.

# Actor input Schema

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

Array of public HTTP/HTTPS URLs to download. Each entry may be a plain URL string or an object { "url": "https://...", "filename": "optional.webp", "folder": "catalog/2026", "metadata": { "sku": "A1" } }. Private, loopback, link-local, and metadata IP addresses are blocked across initial requests and redirects.

## `sourceDatasetId` (type: `string`):

Optional Apify Dataset to read records from and extract URLs using urlFieldPaths. Uses Apify's native Dataset Resource Picker with READ-only scope under LIMITED_PERMISSIONS, and supports direct Actor-to-Actor Add integration triggers (pass {{resource.defaultDatasetId}} or rely on automatic payload.resource.defaultDatasetId fallback when omitted).

## `sourceDatasetUrl` (type: `string`):

Optional public or token-authorized HTTP/HTTPS URL returning a JSON array (or { "items": \[...] } / NDJSON) of records whose URLs are extracted using urlFieldPaths.

## `urlFieldPaths` (type: `array`):

Dot and bracket paths used to extract URLs from each dataset item (supports nested arrays such as 'imageUrl', 'images\[].url', 'media.files\[].href', or 'attachments\[]').

## `maxFiles` (type: `integer`):

Upper limit on unique URLs queued per run (1 to 50,000).

## `concurrency` (type: `integer`):

Number of simultaneous HTTP download workers (1 to 20). Keep between 4 and 10 for balanced throughput without overwhelming origin servers.

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

Maximum seconds to wait per HTTP request before aborting and retrying if eligible.

## `maxRetries` (type: `integer`):

Number of automatic retries with exponential backoff on HTTP 429, 502, 503, 504, or temporary network errors.

## `maxRedirects` (type: `integer`):

Maximum redirect hops followed per URL. Every redirect hop is validated against SSRF network rules before connecting.

## `maxFileSizeMb` (type: `integer`):

Hard streaming byte cap per file in megabytes. Downloads exceeding this limit are aborted mid-stream before consuming excess memory and are never billed.

## `allowedMimePrefixes` (type: `array`):

Optional allowlist of MIME type prefixes (for example \['image/', 'application/pdf']). Leave empty to accept all content types. Rejected files are aborted before buffering and are never billed.

## `customHeaders` (type: `object`):

Optional key-value HTTP headers sent on download requests (for example { "Accept": "image/\*,application/pdf" }). Sensitive Authorization and Cookie headers are automatically stripped on cross-origin redirects.

## `filenameStrategy` (type: `string`):

How output filenames are chosen when an item does not supply an explicit filename. Collisions are automatically suffixed (-2, -3) so files never overwrite each other.

## `optimizeImages` (type: `boolean`):

When enabled, converts and/or resizes supported raster images and records originalBytes, finalBytes, bytesSaved, width, and height in the dataset.

## `imageFormat` (type: `string`):

Output format applied to raster images when optimizeImages is true. Select 'original' to re-encode in the source format.

## `imageQuality` (type: `integer`):

Encoder quality setting for WebP, AVIF, JPEG, or PNG optimization (1 to 100).

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

Optional maximum width in pixels. Aspect ratio is preserved and images smaller than maxWidth are never upscaled.

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

Optional maximum height in pixels. Aspect ratio is preserved and images smaller than maxHeight are never upscaled.

## `stripMetadata` (type: `boolean`):

When true (default), auto-orients pixels then strips EXIF, GPS, and XMP metadata from optimized images to save bytes and protect privacy.

## `storeInKvs` (type: `boolean`):

Store each downloaded file as a record in the default Key-Value Store and emit its direct kvsUrl in the dataset. Disable when streaming directly to S3/R2 only.

## `createZipArchive` (type: `boolean`):

Stream all downloaded non-duplicate files into a single ZIP archive saved in the default Key-Value Store (default key ARCHIVE.zip).

## `zipFilename` (type: `string`):

Record key name used when saving the ZIP archive to the default Key-Value Store.

## `uploadToS3` (type: `boolean`):

When enabled, uploads downloaded files directly via PutObject to AWS S3, Cloudflare R2, Backblaze B2, GCS S3-interop, Wasabi, MinIO, or DigitalOcean Spaces.

## `s3Endpoint` (type: `string`):

Custom endpoint URL for Cloudflare R2 (https://<account-id>.r2.cloudflarestorage.com), Backblaze B2 (https://s3.<region>.backblazeb2.com), GCS S3-interop, Wasabi, or MinIO. Leave empty for standard AWS S3.

## `s3Region` (type: `string`):

Storage region name (use 'auto' for Cloudflare R2, or the AWS/B2 region such as 'us-east-1' or 'eu-central-1').

## `s3Bucket` (type: `string`):

Destination S3/R2/B2 bucket name (required when uploadToS3 is true).

## `s3Prefix` (type: `string`):

Optional leading folder prefix prepended to all uploaded object keys (for example 'media/catalog/2026').

## `accessKeyId` (type: `string`):

Access Key ID for AWS S3, Cloudflare R2, Backblaze B2, or S3-compatible HMAC authentication. Encrypted at rest by Apify and never written to logs or datasets.

## `secretAccessKey` (type: `string`):

Secret Access Key paired with accessKeyId. Encrypted at rest by Apify and never written to logs or datasets.

## `s3ForcePathStyle` (type: `boolean`):

Enable path-style addressing (endpoint/bucket/key) when required by MinIO or self-hosted S3-compatible gateways.

## `s3PublicBaseUrl` (type: `string`):

Optional custom public CDN or R2 custom domain (for example 'https://cdn.example.com') used to construct clean cloudUrl links in the output dataset.

## `s3CacheControl` (type: `string`):

Cache-Control HTTP header stored on uploaded cloud objects.

## `s3Acl` (type: `string`):

Optional canned ACL sent on PutObject. Leave empty (recommended) for Cloudflare R2 and buckets with Object Ownership / Bucket Owner Enforced.

## `skipExistingInBucket` (type: `boolean`):

Performs a lightweight HeadObject check before uploading. If the exact object key already exists in the bucket, skips re-uploading and avoids cloud upload charges.

## `deduplicateByHash` (type: `boolean`):

Computes SHA-256 digests within each run so duplicate binaries served at different URLs are skipped with zero storage, upload, or billing duplication.

## `watchMode` (type: `boolean`):

Persists processed URL and SHA-256 fingerprints in a user-scoped Named Key-Value Store (structmint-bulk-media-watch-v1, 90-day retention) so recurring schedules process only newly added files.

## `onlyNew` (type: `boolean`):

Used with watchMode=true. Skips URLs and SHA-256 hashes already processed in earlier runs with zero event charges.

## `watchStateKey` (type: `string`):

Stable namespace separating saved watch checkpoints for different pipelines or schedules (for example 'daily-catalog-r2-sync').

## `maxTotalChargeUsd` (type: `number`):

Optional hard spend ceiling in USD for this run. If reached, remaining queued URLs are gracefully skipped and marked budget_skipped without exceeding the cap.

## Actor input object example

```json
{
  "urls": [
    "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf",
    "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": 5,
  "timeoutSecs": 30,
  "maxRetries": 2,
  "maxRedirects": 5,
  "maxFileSizeMb": 50,
  "allowedMimePrefixes": [],
  "customHeaders": {},
  "filenameStrategy": "original",
  "optimizeImages": false,
  "imageFormat": "webp",
  "imageQuality": 82,
  "stripMetadata": true,
  "storeInKvs": true,
  "createZipArchive": false,
  "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"
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

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

No description

## `archive` (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://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf",
        "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("structmint/bulk-file-media-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://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf",
        "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("structmint/bulk-file-media-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 '{
  "urls": [
    "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/samples/public-cloud-fee-schedule-q4-2026.pdf",
    "https://raw.githubusercontent.com/stqnbapxao-source/structmint-b2b-automation-kit/main/assets/icons/pdf-structured-tables-watch.png"
  ]
}' |
apify call structmint/bulk-file-media-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,structmint/bulk-file-media-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/szxBZWVjoOwVr1MXL/builds/knm4dELnCaBVBPSLL/openapi.json
