Website image downloader API
The API is the Apify Actor sste/website-image-downloader. Create a free Apify account, copy your API token (Console → Settings → Integrations) and call it from anything that speaks HTTP.
Synchronous call (returns the image list)
curl -X POST "https://api.apify.com/v2/acts/sste~website-image-downloader/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
-d '{"startUrls":[{"url":"https://www.example.com/"}],"minWidth":300,"minHeight":300,"maxImages":200}'
For long jobs use the asynchronous endpoint POST /v2/acts/sste~website-image-downloader/runs, then read GET /v2/datasets/{defaultDatasetId}/items and the ZIP at GET /v2/key-value-stores/{defaultKeyValueStoreId}/records/images.zip (send your token).
Python
from apify_client import ApifyClient # pip install "apify-client>=3"
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("sste/website-image-downloader").call(run_input={
"startUrls": [
{
"url": "https://www.example.com/"
}
],
"minWidth": 300,
"minHeight": 300,
"maxImages": 200
})
for img in client.dataset(run.default_dataset_id).iterate_items():
print(img["width"], img["height"], img["imageUrl"])
# Download the ZIP with all files
zip_record = client.key_value_store(run.default_key_value_store_id).get_record_as_bytes("images.zip")
if zip_record: # no ZIP when no image matched the filters
open("images.zip", "wb").write(zip_record["value"])
JavaScript / Node.js
import { ApifyClient } from 'apify-client'; // npm i apify-client
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('sste/website-image-downloader').call({
"startUrls": [
{
"url": "https://www.example.com/"
}
],
"mode": "list",
"maxImages": 500
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.map((i) => `${i.width}x${i.height} ${i.imageUrl}`));
Input
| Field | Default | Meaning |
|---|---|---|
startUrls | — | Pages and/or direct image URLs (up to 10,000) |
mode | download | download (ZIP + rows), inspect (rows only), list (URLs only) |
minWidth, minHeight | 100 | Skip smaller images (icons, pixels) |
formats | all | jpg, png, gif, webp, avif, svg, ico, bmp, tiff, heic |
minFileSizeKB, maxFileSizeMB | 0, 25 | File size limits (max 50 MB) |
urlMustContain, urlMustNotContain | — | Case-insensitive text filters on the image URL |
dedupe | true | Remove repeated URLs and identical files |
crawlDepth, maxPagesPerStartUrl | 0, 20 | Follow same-site links |
maxImages, maxImagesPerPage | 1000, 500 | Limits |
createZip, saveIndividualFiles | true, false | Storage of files |
includeCssBackgrounds, includeMetaImages, includeLinkedImages, includeIcons | true, true, true, false | Where to look |
Output (one row per image)
{
"imageUrl": "https://cdn.example.com/files/blue-sneaker.jpg?width=1600",
"pageUrl": "https://www.example.com/collections/sneakers",
"startUrl": "https://www.example.com/collections/sneakers",
"alt": "Blue running sneaker",
"foundIn": "srcset",
"format": "jpg",
"width": 1600,
"height": 1600,
"bytes": 184322,
"sha256": "3fa2b1c9…",
"fileName": "blue-sneaker-3fa2b1c9.jpg",
"downloadUrl": null
}
Pricing: pay per use — $0.20 per 1,000 images delivered ($0.0002 each), $0.20 per 1,000 pages scanned, $0.05 per 1,000 URLs in list mode, $0.001 per run. A page with 40 images costs about $0.009. Skipped, duplicate and failed images are free. Details on Apify.
More examples: GitHub repository. OpenAPI and other clients: API tab on Apify.