# Website Image Extractor: Image URLs and Alt Text (`ucchiii/website-image-extractor`) Actor

List the images on web pages you give: image URL, largest srcset image, alt text, width and height attributes, lazy loading, file size and type from a HEAD request. Flags missing alt and oversized images. Images are never downloaded. Failures are free. Empty input = free demo.

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

## Pricing

from $1.40 / 1,000 page image lists

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/running/actors-in-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

**Website Image Extractor: give it page URLs and get the list of images on each page — image URL, largest srcset image, alt text, width and height attributes, lazy loading, and file size and type — with missing alt text and oversized images flagged. Plain HTTP, no browser, no crawling, and no image is ever downloaded.**

| image | alt | width × height | loading | content-length | content-type | flags |
|---|---|---|---|---|---|---|
| https://apify.com/img/apify-logo/wordmark-white.svg | "Apify logo" | 100 × 27 | — | 2,587 | image/svg+xml |  |
| https://cdn-cms.apify.com/mcp_34048c6902.png | "Promotion image background" | — × — | lazy | 17,191 | image/png |  |
| https://cdn-cms.apify.com/apify_store_dark_bd743acd0f.webp | "Promotion image background" | — × — | lazy | 36,846 | image/webp |  |

*(real rows from a run on https://apify.com/ on 2026-11-12, shortened to 7 of the fields; the dataset has one row per page with the full `images` list and counts)*

**For SEO specialists, web developers, accessibility reviewers, content teams and site owners** who need to see which images a page really uses — to find images with no alt text, to find the heavy files that slow a page down, or to get a list of image URLs before they decide what to save — without opening the browser's developer tools page by page.

**Try it:** press **Start** with the prefilled example (2 pages) and you get 2 rows in a few seconds, for less than a cent. Clear the inputs and press Start for a **free demo** on 2 sample pages (rows carry `_demo: true`, not charged).

### What you get for each image

- **`src`**: the image URL as an absolute URL. If the page uses lazy loading with a placeholder `src` (a `data:` image), the real URL from `data-src` (or `data-lazy-src`, `data-original`) is used.
- **`largestSrcset`** and **`largestSrcsetDescriptor`**: the biggest candidate from `srcset` (`1600w`, `2x`) — also from the `<source>` tags of a `<picture>` — so you know which file a large screen gets.
- **`alt`**, **`altMissing`**, **`altEmpty`**: the alt text. `altMissing` is true when the attribute is absent. `alt=""` is accepted as a decorative image and shows as `altEmpty`, not as missing.
- **`width`, `height`**: the attributes as written in the HTML (numbers only; no CSS is evaluated). Missing values mean the browser cannot reserve space before the image loads.
- **`loading`**, **`lazy`**: the `loading` attribute, and whether the image is lazy-loaded (`loading="lazy"` or a lazy-loading source attribute).
- **`headStatus`, `contentLength`, `contentType`**: from one **HEAD request** to the image URL — file size in bytes and media type. Some servers answer HEAD with an error or without a size; then these stay empty and the image is still listed.
- **`oversized`** and **`flags`**: `oversized` when `contentLength` is above your limit (default 500 KB); `flags` lists `missing_alt` and `oversized` for easy filtering.
- **`count`**, **`inPicture`**: how often the same URL appears on the page (the image is listed once), and whether it sits in a `<picture>`.

Each page row adds the counts: `imagesTotal`, `imagesMissingAlt`, `imagesEmptyAlt`, `imagesOversized`, `imagesLazy`, `dataUriImages`, `largestImageBytes`, `knownImageBytes`.

### How to use

1. Put your page URLs in **URLs**, one per line.
2. Optionally set the **Oversized limit (KB)**, **Max images per page** (default 200) and **Max HEAD requests per page** (default 30; use 0 to skip HEAD and get only URLs and attributes).
3. Press **Start**, or call the Actor from your code:

```bash
curl -X POST "https://api.apify.com/v2/acts/ucchiii~website-image-extractor/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"urls": ["https://apify.com/", "https://docs.apify.com/"], "oversizedKb": 300}'
```

```json
{
  "urls": ["https://apify.com/", "https://docs.apify.com/"],
  "maxPages": 50,
  "maxImagesPerPage": 200,
  "maxHeadRequestsPerPage": 30,
  "oversizedKb": 500,
  "concurrency": 5
}
```

Export the dataset as JSON for the full image lists. To get one row per image in a spreadsheet, flatten the `images` field with [Dataset Transform](https://apify.com/ucchiii/dataset-transform). The **SUMMARY** record counts images, images without alt, oversized images and HEAD requests for the whole run.

### Images are not downloaded

The Actor reads the page's HTML and asks each image's server for its headers with a HEAD request. It never requests the image file itself, so nothing is downloaded or stored, and no image content is in the output. If you need the files, use [Bulk File Downloader](https://apify.com/ucchiii/bulk-file-downloader) with the image URLs from this Actor. Images can be protected by copyright: only save or reuse images you have the right to use.

### Output fields (per page)

- `inputUrl`, `finalUrl`, `statusCode`, `redirectCount`, `contentType`, `truncated`, `fetchedAt`.
- `imagesTotal`, `imagesListed`, `imagesTruncated`, `imageTags`, `dataUriImages`, `imagesMissingAlt`, `imagesEmptyAlt`, `imagesOversized`, `imagesLazy`.
- `headRequests`, `headSkipped`, `largestImageBytes`, `knownImageBytes`, `oversizedKb`.
- `images`: the list described above.
- `extracted`: true when the page was fetched and its image list was made.
- `error`: `null` when the list was made; otherwise `blocked_by_robots_txt`, `robots_txt_unavailable`, `invalid_url`, `blocked_private_address`, `timeout`, `dns_failure`, `connection_error`, `tls_error`, `http_404` (or another `http_<status>`), `too_many_redirects`, `redirect_loop`, `invalid_redirect_url` or `not_html`.

Per image, `headError` can be `blocked_by_robots_txt` (the image host's robots.txt disallows it, so no HEAD was sent), `robots_txt_unavailable`, `blocked_private_address`, `timeout`, `dns_failure`, `connection_error`, `tls_error`, `too_many_redirects` or `invalid_url`.

### Pricing

Pay per event: **$0.002 per page image list** — a page that was fetched and whose images were listed (also when it has none). That is **$2.00 per 1,000 pages** on the free plan; with Store discounts it is $1.80 (BRONZE), $1.60 (SILVER) and **$1.40 per 1,000 (GOLD)**. There is no start fee, and the HEAD requests for images cost nothing extra.

**Not charged:** pages skipped because robots.txt disallows them, 4xx/5xx pages, timeouts and other fetch errors, blocked addresses, non-HTML files, invalid URLs, and the free demo (empty input).

On the Apify Free plan, the $5 of monthly credit covers about 2,500 pages a month. Set a **maximum charge per run** to cap spend: the run stops cleanly when it is reached.

### Polite and safe by design

- **robots.txt is respected** for the pages and for the hosts of the images. Before fetching a page, the Actor reads that site's robots.txt once and follows the rules for its own name (`website-image-extractor`) or `*`. A disallowed page is not fetched and not charged (`error: blocked_by_robots_txt`). A disallowed image gets no HEAD request (`headError: blocked_by_robots_txt`) but stays in the list. If robots.txt cannot be read because of a server error or timeout, that host is not contacted (`robots_txt_unavailable`). A missing robots.txt (404) means no restrictions.
- **Capped and gentle**: at most 2 connections per site at a time and at least 0.5 s between requests to the same site (a robots.txt `Crawl-delay` is honoured up to 5 s); at most 200 HEAD requests per page (default 30), 2,000 pages per run, 10 redirects per page, 3 redirects per image, 3 MB of HTML per page. The same image URL gets one HEAD request per run, even when many pages use it.
- **Never reaches internal networks**: page and image URLs that resolve to internal addresses (localhost, private ranges, link-local such as 169.254.169.254, IPv6 loopback/unique-local) are never contacted — also when a public URL redirects to one.
- The Actor identifies itself in its User-Agent and does not log in or send cookies.

### Limits

- One request per page; links are not followed (no site crawl). To list a whole site's pages first, use [Sitemap URL Extractor](https://apify.com/ucchiii/sitemap-urls).
- HTTP only: images that a page adds with JavaScript after loading, and CSS background images, are not seen. Only `img` tags (and their `picture` sources) are listed.
- File size comes from the `content-length` header of a HEAD answer. Servers that do not send it, or do not support HEAD, give no size. Sizes are of the file as sent without compression, not of what the page weighs after optimisation.
- Only fetch pages you are allowed to access.

### FAQ

**Does it download my images?** No. It only sends HEAD requests (headers, no file) to the image URLs, and reads the page HTML. Use Bulk File Downloader if you want the files.

**Is an empty alt text "missing"?** No. `alt=""` is the correct way to mark a purely decorative image, so it is counted as `imagesEmptyAlt`. Only an `img` with no `alt` attribute is flagged `missing_alt`.

**Why does an image have no size?** The server did not answer the HEAD request with a `content-length` (some CDNs refuse HEAD, or stream the file), the image is over the per-page HEAD cap (`headChecked: false`), its host's robots.txt disallows it, or it is on a private address.

**Do I pay for pages blocked by robots.txt or broken pages?** No. Only rows with `extracted: true` are charged.

### More tools from the same developer

- [Bulk File Downloader](https://apify.com/ucchiii/bulk-file-downloader) — download files from URL lists or dataset fields into storage, with links, SHA-256 and an optional ZIP
- [Image Converter](https://apify.com/ucchiii/image-converter) — convert images between JPG, PNG, WebP and AVIF, with optional resize
- [SEO Audit Tool](https://apify.com/ucchiii/seo-audit-tool) — on-page SEO audit for URL lists and sitemaps: title, meta description, h1, canonical, noindex, robots.txt, issues and a 0-100 score
- [Bulk URL Status Checker](https://apify.com/ucchiii/url-status-checker) — bulk HTTP status and redirect-chain checker for URL lists
- [Favicon Extractor](https://apify.com/ucchiii/favicon-extractor) — favicons, Apple touch icons and manifest icons of many websites, with the best icon per site

# Actor input Schema

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

Full page URLs including http:// or https://, one per line. Each page is fetched once (links are not followed). Duplicates are removed. Leave this empty for a free demo (not charged).

## `maxPages` (type: `integer`):

Most pages processed in one run. Allowed range 1 to 2,000 (default 100). URLs over the limit are left out (counted in the SUMMARY record).

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

Most images listed for one page, in page order. Allowed range 1 to 1,000 (default 200). Extra images are left out and the row says so (imagesTruncated).

## `maxHeadRequestsPerPage` (type: `integer`):

Most images per page asked for their file size and type with a HEAD request, in page order. Allowed range 0 to 200 (default 30). Use 0 to skip HEAD requests and get only URLs and attributes. The same image URL is asked once per run. Images over the cap are still listed, without size.

## `oversizedKb` (type: `integer`):

An image is flagged oversized when its content-length is above this many kilobytes (1 KB = 1,000 bytes). Allowed range 1 to 100,000 (default 500). Only images that got a HEAD answer with a content-length can be flagged.

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

Timeout for each request, in seconds. Allowed range 1 to 60 (default 15). A request that keeps sending slowly is stopped after 3 times this value.

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

How many pages are fetched in parallel across all sites. Allowed range 1 to 20 (default 5). Per site (page host or image host), at most 2 connections are used at a time with at least 0.5 s between requests (longer when robots.txt sets a Crawl-delay, up to 5 s).

## Actor input object example

```json
{
  "urls": [
    "https://apify.com/",
    "https://docs.apify.com/"
  ],
  "maxPages": 10,
  "maxImagesPerPage": 200,
  "maxHeadRequestsPerPage": 30,
  "oversizedKb": 500,
  "timeoutSecs": 15,
  "concurrency": 5
}
```

# Actor output Schema

## `pages` (type: `string`):

One item per page, in input order: counts (images, missing alt, empty alt, oversized, lazy-loaded), largest and total known image bytes, and the images list with src, largest srcset image, alt, width and height attributes, loading, content-length and content-type from HEAD, and flags.

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

Record SUMMARY: pages processed, rows charged, images listed, images without alt, oversized images, HEAD requests sent, pages skipped by robots.txt, errors by code and whether the run stopped at the maximum charge.

# 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://apify.com/",
        "https://docs.apify.com/"
    ],
    "maxPages": 10,
    "maxImagesPerPage": 200,
    "maxHeadRequestsPerPage": 30,
    "oversizedKb": 500,
    "timeoutSecs": 15,
    "concurrency": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/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 = {
    "urls": [
        "https://apify.com/",
        "https://docs.apify.com/",
    ],
    "maxPages": 10,
    "maxImagesPerPage": 200,
    "maxHeadRequestsPerPage": 30,
    "oversizedKb": 500,
    "timeoutSecs": 15,
    "concurrency": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/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 '{
  "urls": [
    "https://apify.com/",
    "https://docs.apify.com/"
  ],
  "maxPages": 10,
  "maxImagesPerPage": 200,
  "maxHeadRequestsPerPage": 30,
  "oversizedKb": 500,
  "timeoutSecs": 15,
  "concurrency": 5
}' |
apify call ucchiii/website-image-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/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/fWQMxOcyU1MxnMlmU/builds/ajPhzsAWcjvjF5Yab/openapi.json
