# Website Image Extractor – Get All Images & Alt (`innovative_cookie/website-image-extractor`) Actor

Extract every image from web pages: img, srcset, lazy-load, og:image and CSS backgrounds, with width, height, format, file size and alt text. Optional download.

- **URL**: https://apify.com/innovative_cookie/website-image-extractor.md
- **Developed by:** [Innovative Cookie](https://apify.com/innovative_cookie) (community)
- **Categories:** Developer tools, Automation, SEO tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

### What does Website Image Extractor do?

**Website Image Extractor** lists **every image used on a web page**, with its **real width and height, format, file size and alt text**. Paste one or more page URLs and get a clean table you can export to **CSV, Excel or JSON**, and optionally **download all the image files**.

It finds images in places simple scrapers miss:

- 🖼️ `<img src>` and **lazy-loaded** images (`data-src`, `data-lazy-src`, `data-original`…)
- 📐 every **responsive variant** in `srcset` and `<picture><source>`
- 📣 **social preview images**: `og:image`, `twitter:image`
- 🎨 **CSS background images** in `style=""` attributes and `<style>` blocks
- 🎬 video posters, preloaded hero images, SVG `<image>`, and optionally **favicons and touch icons**

### Why use Website Image Extractor?

- 🔎 **Image SEO audit**: find images with a **missing alt text** (`altMissing`) and **heavy images** that slow the page down (`isHeavy`).
- ⚡ **Page speed**: see the real pixel size and weight of each image, and spot oversized files and old formats (JPG/PNG vs WebP/AVIF).
- 📦 **Bulk image download**: save all images of a page to a key-value store in one click.
- 🧠 **AI & data pipelines**: collect image URLs and alt texts for datasets, catalog checks or content migration.
- 🚀 **Fast and light**: plain HTTP requests, no browser. It respects `robots.txt` for the page **and for every image host**.

### How to extract all images from a website

1. Click **Try for free**.
2. Paste the page URLs in **Page URLs**, one per line.
3. Choose what to include (srcset variants, og:image, CSS backgrounds, icons).
4. Keep **Measure images** on to get size, format and weight. Turn on **Save images** to download the files.
5. Click **Start**, then export the table as CSV, Excel or JSON.

### Input

```json
{
    "startUrls": ["https://books.toscrape.com/"],
    "maxImagesPerPage": 200,
    "includeSrcset": true,
    "includeMetaImages": true,
    "includeCssImages": true,
    "measureImages": true,
    "downloadImages": false,
    "minWidth": 0,
    "heavyImageKB": 200
}
```

- **minWidth / minHeight** drop small images such as icons and tracking pixels (only measured images).
- **skipDuplicatesAcrossPages** lists a logo repeated on every page only once.
- Turn **measureImages** off for a very fast list of image URLs without downloading them.

### Output

One row per image:

```json
{
    "pageUrl": "https://books.toscrape.com/",
    "imageUrl": "https://books.toscrape.com/media/cache/2c/da/2cdad67c44b002e7ead0cc35693c0e8b.jpg",
    "sources": ["img"],
    "alt": "A Light in the Attic",
    "altMissing": false,
    "isLazy": false,
    "srcsetDescriptor": null,
    "status": "ok",
    "format": "jpg",
    "width": 125,
    "height": 155,
    "bytes": 9876,
    "contentType": "image/jpeg",
    "isHeavy": false,
    "kvUrl": null
}
```

`status` is `ok` (measured), `found` (not measured), `error`, `blocked-by-robots` or `blocked-by-anti-bot`. The **`SUMMARY`** record gives the totals per page (images found, written, missing alt). Saved files are in the run's key-value store (`img-…` keys).

### How much does it cost?

The Actor is **free to use** for now: there is no Actor fee, you only pay the small Apify platform usage. It uses no browser and no proxy, so a page with 50 images usually costs a fraction of a cent. Downloading the files uses a bit more storage.

### Is it legal to extract images from websites?

The Actor only reads **public pages**, follows **`robots.txt`**, waits between requests to the same host, and **never bypasses captchas or anti-bot protection** (such pages are reported as blocked). Images are usually protected by **copyright**: listing them for an audit is fine, but check that you have the right before reusing the files.

### Integrations

Use it from the **Apify API**, **Make**, **Zapier**, **n8n**, Google Sheets, or from an AI agent through the Apify **MCP server**. Chain it with [Bulk Image Converter & Compressor](https://apify.com/innovative_cookie/image-converter) to turn the heavy JPG and PNG files into WebP or AVIF.

### FAQ

#### Does it crawl the whole website?

No. It reads the pages you list. To get every page of a site, run [Sitemap URL Extractor](https://apify.com/innovative_cookie/sitemap-extractor) first and paste its URLs.

#### Does it run JavaScript?

No, it reads the HTML. Lazy-loaded images declared in `data-src` attributes are found, but images added only by JavaScript after load are not.

#### Why is an image marked "blocked-by-robots"?

The image host's `robots.txt` does not allow bots on that path, so the image is listed but not downloaded.

#### Something does not work?

Open an issue in the **Issues** tab with the page URL and the `SUMMARY` record.

### Related actors

More Actors by the same author ([innovative_cookie on Apify](https://apify.com/innovative_cookie)):

- [Bulk Image Converter & Compressor](https://apify.com/innovative_cookie/image-converter): convert images to WebP, AVIF, PNG or JPG and resize them.
- [Logo & Favicon Extractor](https://apify.com/innovative_cookie/logo-favicon): get the logo and favicon of any website.
- [Broken Link Checker](https://apify.com/innovative_cookie/broken-link-checker): find 404s and dead links on any website.
- [PageSpeed Insights Bulk Checker](https://apify.com/innovative_cookie/pagespeed-bulk): Core Web Vitals and Lighthouse scores for many URLs.

# Actor input Schema

## `startUrls` (type: `array`):

One page per line (https://example.com/blog/post). All images referenced by each page are listed. Pages are not crawled further.

## `maxImagesPerPage` (type: `integer`):

Stop after this many distinct images on one page.

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

List every responsive variant (srcset, <picture><source>), not only the main src.

## `includeMetaImages` (type: `boolean`):

Add the social preview images declared in meta tags.

## `includeCssImages` (type: `boolean`):

Add url(...) images from style attributes and <style> blocks (external .css files are not read).

## `includeIcons` (type: `boolean`):

Add <link rel=icon> and apple-touch-icon images.

## `includeDataUris` (type: `boolean`):

Add images embedded as data: URIs (tiny lazy-load placeholders are always ignored).

## `measureImages` (type: `boolean`):

Download each image once to read its real width, height, format and file size. Turn off for a fast list of URLs only.

## `downloadImages` (type: `boolean`):

Store each image file in the run's key-value store and add a download link (kvUrl) to the row.

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

Skip measured images narrower than this (0 = keep all). Useful to drop icons and tracking pixels.

## `minHeight` (type: `integer`):

Skip measured images shorter than this (0 = keep all).

## `heavyImageKB` (type: `integer`):

Images larger than this are flagged isHeavy (SEO / page speed).

## `maxImageMB` (type: `integer`):

Images larger than this are not downloaded.

## `skipDuplicatesAcrossPages` (type: `boolean`):

List each image URL only once in the whole run (logos, icons, banners repeated on every page).

## `maxConcurrency` (type: `integer`):

Parallel requests (the same host always gets at least the delay below between requests).

## `requestDelayMs` (type: `integer`):

Politeness delay. robots.txt Crawl-delay is respected when larger.

## `requestTimeoutSecs` (type: `integer`):

Timeout for each request.

## Actor input object example

```json
{
  "startUrls": [
    "https://books.toscrape.com/"
  ],
  "maxImagesPerPage": 25,
  "includeSrcset": true,
  "includeMetaImages": true,
  "includeCssImages": true,
  "includeIcons": false,
  "includeDataUris": false,
  "measureImages": true,
  "downloadImages": false,
  "minWidth": 0,
  "minHeight": 0,
  "heavyImageKB": 200,
  "maxImageMB": 15,
  "skipDuplicatesAcrossPages": true,
  "maxConcurrency": 5,
  "requestDelayMs": 250,
  "requestTimeoutSecs": 20
}
```

# Actor output Schema

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

Dataset with one row per result

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

SUMMARY record

## `files` (type: `string`):

Key-value store with the image files

# 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 = {
    "startUrls": [
        "https://books.toscrape.com/"
    ],
    "maxImagesPerPage": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("innovative_cookie/website-image-extractor").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 = {
    "startUrls": ["https://books.toscrape.com/"],
    "maxImagesPerPage": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("innovative_cookie/website-image-extractor").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 '{
  "startUrls": [
    "https://books.toscrape.com/"
  ],
  "maxImagesPerPage": 25
}' |
apify call innovative_cookie/website-image-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,innovative_cookie/website-image-extractor"
        }
    }
}
```

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/6Dmq3CZockVAlvNAc/builds/vu3uD24Fd64SPIWQS/openapi.json
