# Page Images Extractor: image URLs, alt text, sizes, lazy src (`steadydata/page-images-extractor`) Actor

Every image on a web page, up to 500 pages a run and 1,000 images each: absolute URL, alt text, title, width and height, format, lazy source, srcset, whether it sits in a link, plus per page the counts of images and images without alt text. Robots-aware, no browser, no downloads. Pay per image.

- **URL**: https://apify.com/steadydata/page-images-extractor.md
- **Developed by:** [Steadydata Team](https://apify.com/steadydata) (community)
- **Categories:** AI, SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.20 / 1,000 image listeds

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

## Page Images Extractor: image URLs, alt text, sizes, lazy src

Every image on a web page, up to 500 pages a run and 1,000 images each: absolute URL, alt text, title, width and height, format, lazy source, srcset, whether it sits in a link, plus per page the counts of images and images without alt text. Robots-aware, no browser, no downloads. Pay per image.

### Why this scraper

- **Only delivered results are charged.** Inputs that fail come back as clear error
  records at no cost.
- One plain fetch per page, parsed with lxml, no browser, no start fee and nothing downloaded. Measured on the platform: 32 images from three pages (a Wikipedia article, BBC News, python.org) in 6 seconds for a sixth of a cent.
- Every image as a usable row: the absolute URL (relative paths and `<base>` resolved), alt text with a separate missing-alt flag, title, width and height attributes, format from the URL, whether it is lazy-loaded and from which attribute, srcset candidate count and the largest candidate, whether the image sits inside a link and where that link goes, host and internal or external, and how often the page repeats it.
- Page totals on every row: unique image count, images without alt text and inline data: images, so an accessibility or SEO audit reads off the first row per page.
- Robots-aware: each host's robots.txt is read once per run and a closed path comes back as a free `ROBOTS_DISALLOWED` row (measured: Google's `/search` path).

### Who this is for

Paste page URLs in `urls` (up to 500 per run) and set `maxImagesPerPage` (default 200, ceiling 1,000, page order). Switch `includeDataUris` on to see inline base64 images as rows with their length. Built for alt-text and accessibility audits, image SEO checks, finding oversized or lazy-loaded images, building image inventories of a site and seeding download or vision pipelines with clean URLs.

### Who this is not for

No browser is used, so images that a page adds with JavaScript after loading are not seen; lazy-loading attributes in the HTML are read, scripts are not run. Only `<img>` elements count: CSS background images, `<picture>` sources without an `<img>`, videos and SVG drawn inline are not rows. `width` and `height` are the HTML attributes, not the pixel size of the file; `format` is read from the URL and empty when the URL has no extension or format parameter (measured: 1 of 32). Nothing is downloaded, so file sizes are not known. A page without any image comes back as a free `NO_IMAGES` row.

### Input example

```json
{
    "urls": [
        "https://en.wikipedia.org/wiki/Web_scraping",
        "https://www.python.org/"
    ],
    "maxImagesPerPage": 200,
    "includeDataUris": false
}
```

### Output example

- `pageUrl`
- `position`
- `url`
- `altText`
- `hasAlt`
- `title`
- `width`
- `height`
- `format`
- `isLazy`
- `lazySource`
- `srcsetCount`
- `srcsetLargest`
- `inLink`
- `linkUrl`
- `domain`
- `isInternal`
- `occurrences`
- `pageTitle`
- `pageImageCount`
- `pageMissingAltCount`
- `pageDataUriCount`

Error codes: `INVALID_URL`, `ROBOTS_DISALLOWED`, `NOT_HTML`, `NO_IMAGES`, `FETCH_FAILED`, `BLOCKED`.

One delivered row looks like this:

```json
{
  "pageUrl": "https://en.wikipedia.org/wiki/Web_scraping",
  "position": 1,
  "url": "https://en.wikipedia.org/static/images/icons/enwiki-25.svg",
  "altText": null,
  "hasAlt": false,
  "title": null,
  "width": 50,
  "height": 50,
  "format": "svg",
  "isLazy": false,
  "lazySource": null,
  "srcsetCount": 0,
  "srcsetLargest": null,
  "inLink": true,
  "linkUrl": "https://en.wikipedia.org/wiki/Main_Page",
  "domain": "en.wikipedia.org",
  "isInternal": true,
  "occurrences": 1,
  "pageTitle": "Web scraping - Wikipedia",
  "pageImageCount": 10,
  "pageMissingAltCount": 3,
  "pageDataUriCount": 0,
  "status": "ok"
}
```

### Related actors from steadydata

- [page-links-extractor](https://apify.com/steadydata/page-links-extractor): the links of the same page, with anchor text
- [image-ocr-text](https://apify.com/steadydata/image-ocr-text): the text inside the images you found
- [structured-data-extractor](https://apify.com/steadydata/structured-data-extractor): the page's own structured data and Open Graph

### Pricing

Pay per event: one `image-listed` event per delivered result. No charge for inputs
that fail, no separate platform-usage surcharge.

**Free Apify plan:** this actor delivers up to 25 rows per run for accounts on the Apify free
plan, and then stops with a message. That limit is set by us, not by Apify. It exists so the
actor keeps paying for itself for the people who do pay. Any paid Apify plan runs it at full
size, billed per delivered row, with failed rows never charged.

**Reviews:** if this actor saves you time, a short review on this page is the one thing that
helps most. Ratings are what other buyers look at first, and we have no other way to ask.

### FAQ

**Is personal data collected?**
No. Image URLs and alt texts are what the page publishes; the actor reads only the URLs you give it and downloads no image.

**How do I find images without alt text?**
Filter on `hasAlt` false. `altText` is empty both when the attribute is missing and when it is an empty string (decorative images); `hasAlt` is false in both cases, and `pageMissingAltCount` on the page row gives the total.

**Which URL is delivered for a lazy-loaded image?**
The real source: when `src` is empty or a placeholder data: image, the lazy attribute (data-src, data-lazy-src, data-original and the like) or the first srcset candidate is used, and `lazySource` shows it. `srcsetLargest` gives the biggest candidate for high-resolution needs.

**Can it download the images?**
No, by design; it lists them. Feed the `url` column to a downloader of your choice.

**What does a run cost when a page fails?**
Nothing. `ROBOTS_DISALLOWED`, `NOT_HTML`, `NO_IMAGES`, `FETCH_FAILED`, `INVALID_URL` and `BLOCKED` rows are free; only delivered images are charged.

**What happens when the source changes?**
Sources change from time to time; that is the nature of this work. The actor is
monitored daily and fixed fast, and while it is broken you are not charged, because
only delivered results cost anything.

# Changelog

This Actor's version history is a separate document: https://apify.com/steadydata/page-images-extractor/changelog.md

# Actor input Schema

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

One per row, up to 500: full page URLs (https://...). Each host's robots.txt is respected.

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

Cost ceiling per page, in page order.

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

On: inline base64 images are delivered with their length instead of a URL. Off (default): they are counted but skipped.

## Actor input object example

```json
{
  "urls": [
    "https://en.wikipedia.org/wiki/Web_scraping",
    "https://www.python.org/"
  ],
  "maxImagesPerPage": 200,
  "includeDataUris": false
}
```

# Actor output Schema

## `results` (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://en.wikipedia.org/wiki/Web_scraping",
        "https://www.python.org/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("steadydata/page-images-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://en.wikipedia.org/wiki/Web_scraping",
        "https://www.python.org/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("steadydata/page-images-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://en.wikipedia.org/wiki/Web_scraping",
    "https://www.python.org/"
  ]
}' |
apify call steadydata/page-images-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,steadydata/page-images-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/zT5kTroSHgr6RD6mF/builds/3fr19AxdpKjjyv8Hr/openapi.json
