DEV Community

voiddo
voiddo

Posted on Originally published at voidd0.github.io

Bulk file and image downloader: how to download images and files from a website (Python, API, no code)

Download files in bulk from direct links, or every image, video, audio file, PDF, document or archive on a list of web pages.

This tutorial shows what the Actor v0iddo/bulk-file-downloader returns, how to run it on the Apify Store without code, and how to call it from Python and cURL.

What data you get

One row per result. Every row can be downloaded as JSON, CSV, Excel or HTML, or read through the API.

Field Label Type Example
fileUrl File URL https://api.apify.com/v2/key-value-stores/GKrosZlTQ8ZrHctTs/records...
fileName Name text Trinidad_and_Tobago_hummingbirds_composite.jpg
fileType Type text image
fileBytes Bytes number 292246
imageWidth Width number 1280
imageHeight Height number 1280
altText Alt text text
url Source link URL https://thumb.wikimedia.org/wikipedia/commons/thumb/7/7c/Trinidad_a...
error Error text
kind kind text file
pageUrl pageUrl text https://en.wikipedia.org/wiki/Hummingbird
finalUrl finalUrl text https://thumb.wikimedia.org/wikipedia/commons/thumb/7/7c/Trinidad_a...
foundIn foundIn text og:image
contentType contentType text image/jpeg
sha256 sha256 text 82cafb5947635e2a5d5244de379932a7697c3aeb0e66bec7ea9e5fde9f78d303
chargeUnits chargeUnits number 1
downloadedAt downloadedAt text 2026-10-26T07:22:17Z

Real rows from a run of the Actor (fields that name people are left out):

[
  {
    "kind": "file",
    "url": "https://thumb.wikimedia.org/wikipedia/commons/thumb/7/7c/Trinidad_and_Tobago_hummingbirds_composite.jpg/1280px-Trinidad_and_Tobago_hummin...",
    "pageUrl": "https://en.wikipedia.org/wiki/Hummingbird",
    "finalUrl": "https://thumb.wikimedia.org/wikipedia/commons/thumb/7/7c/Trinidad_and_Tobago_hummingbirds_composite.jpg/1280px-Trinidad_and_Tobago_hummin...",
    "foundIn": "og:image",
    "fileName": "Trinidad_and_Tobago_hummingbirds_composite.jpg",
    "fileType": "image",
    "contentType": "image/jpeg",
    "fileBytes": 292246,
    "sha256": "82cafb5947635e2a5d5244de379932a7697c3aeb0e66bec7ea9e5fde9f78d303",
    "imageWidth": 1280,
    "imageHeight": 1280,
    "fileUrl": "https://api.apify.com/v2/key-value-stores/GKrosZlTQ8ZrHctTs/records/000001-Trinidad_and_Tobago_hummingbirds_composite.jpg?signature=z1kCA...",
    "chargeUnits": 1,
    "downloadedAt": "2026-10-26T07:22:17Z"
  },
  {
    "kind": "file",
    "url": "https://en.wikipedia.org/static/images/icons/enwiki-25.svg",
    "pageUrl": "https://en.wikipedia.org/wiki/Hummingbird",
    "finalUrl": "https://en.wikipedia.org/static/images/icons/enwiki-25.svg",
    "foundIn": "img",
    "fileName": "enwiki-25.svg",
    "fileType": "image",
    "contentType": "image/svg+xml",
    "fileBytes": 115918,
    "sha256": "095fb188212ac25419535feb7aee7a6a7b2d58270ae42a168abf9942d1b44315",
    "fileUrl": "https://api.apify.com/v2/key-value-stores/GKrosZlTQ8ZrHctTs/records/000002-enwiki-25.svg?signature=154Opp9Dy3wLYwkRpWX0e",
    "chargeUnits": 1,
    "downloadedAt": "2026-10-26T07:22:17Z"
  }
]
Enter fullscreen mode Exit fullscreen mode

No code: run it on the Apify Store

  1. Open the Bulk file and image downloader page on Apify.
  2. Fill in the input form. An example input is already filled in.
  3. Press Start, wait for the run to finish, and download the results as JSON, CSV or Excel from the Output tab.

The input that is pre-filled on the Actor page:

{
  "pageUrls": [
    "https://en.wikipedia.org/wiki/Hummingbird"
  ],
  "fileTypes": [
    "image"
  ],
  "maxFilesPerPage": 20,
  "maxItems": 20
}
Enter fullscreen mode Exit fullscreen mode

Ready-made examples

Saved inputs on Apify: run one as it is, or copy it and change the values.

Python (apify-client)

Get your API token in Apify Console under Settings, then Integrations. The Actor id is v0iddo/bulk-file-downloader.

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {'pageUrls': ['https://en.wikipedia.org/wiki/Hummingbird'],
 'fileTypes': ['image'],
 'maxFilesPerPage': 20,
 'maxItems': 20}

run = client.actor("v0iddo/bulk-file-downloader").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
Enter fullscreen mode Exit fullscreen mode

cURL

curl -X POST "https://api.apify.com/v2/acts/v0iddo~bulk-file-downloader/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pageUrls": ["https://en.wikipedia.org/wiki/Hummingbird"], "fileTypes": ["image"], "maxFilesPerPage": 20, "maxItems": 20}'
Enter fullscreen mode Exit fullscreen mode

Good to know

  • Images on pages come in the largest size the page offers in srcset, and lazy loading attributes (data-src and the like) are read, so the real image is taken instead of a placeholder.
  • The same file under two links is stored once: the second row has duplicateOf and costs nothing. A link that appears on several pages is downloaded once.

Price

$2.00 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.40 per 1,000.

FAQ

What data does the Bulk file and image downloader return?

Each result is one row in an Apify dataset. Fields include fileUrl, fileName, fileType, fileBytes, imageWidth, imageHeight, altText, url, and more. The table above shows every field with an example value.

Can I use it without writing code?

Yes. Open the Actor page on Apify, fill in the input form (an example is already filled in), press Start, and download the results as JSON, CSV, Excel or HTML. You can also schedule runs there.

How much does it cost?

$2.00 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $1.40 per 1,000. A new Apify account gets $5 of platform credit every month.

Links

Top comments (0)