# Image SEO Checker – Alt Text, Size, Format, CLS & Broken Images (`adamplaenitz/image-seo-checker`) Actor

Audits all images of a page list or small site crawl without a browser: missing alt text, missing width/height (CLS), file size, WebP/AVIF vs. JPEG/PNG, real pixel size vs. displayed size, lazy loading, broken images and og:image. Summary and issue list per page.

- **URL**: https://apify.com/adamplaenitz/image-seo-checker.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (community)
- **Categories:** SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 page checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Image SEO Checker – Alt Text, Size, Format, CLS & Broken Images

**Check every image on a list of pages or a small website crawl: missing alt texts, missing width/height (layout shift), file size, WebP/AVIF vs. JPEG/PNG, real pixel size vs. displayed size, lazy loading, broken images and the og:image preview.** One summary row with a grouped issue list per page, optionally one row per image. Plain HTTP, no browser – fast and cheap.

### What does it do?

For every page it reads the HTML and collects all images:

- `<img>` (`src`, `srcset`, common lazy-loading attributes such as `data-src` / `data-srcset`)
- `<picture>` with its `<source srcset type>` alternatives
- `og:image` and `twitter:image`
- inline `data:` images (size and pixel dimensions are decoded locally)

Each image URL is downloaded only as far as needed (usually the first few KB): HTTP status, `Content-Type`, file size (from `Content-Length`, otherwise counted), the **real format from the file's magic bytes** (JPEG, PNG, GIF, WebP, AVIF, SVG, …) and the **real pixel size**. The request sends a browser-like `Accept: image/avif,image/webp,…` header, so CDNs that negotiate modern formats are measured the way browsers see them. Every image URL is fetched once per run, even if it appears on many pages.

#### Issue codes

| Severity | Code | Meaning |
|---|---|---|
| error | `image-broken` | Image URL returns 4xx/5xx or cannot be loaded (after one retry) |
| error | `not-an-image` | URL returns e.g. an HTML error page instead of an image |
| error | `og-image-broken` | og:image / twitter:image cannot be loaded |
| warning | `alt-missing` | `<img>` without `alt` attribute (images with `aria-hidden="true"` or `role="presentation"` are skipped) |
| warning | `dimensions-missing` | No `width` and `height` attributes and no inline CSS size → layout shift (CLS) risk |
| warning | `image-file-too-large` | File larger than the threshold (default 200 KB) |
| warning | `oversized-image` | Real width more than 2 × the `width` attribute (only for images without a `w`-descriptor `srcset`) |
| warning | `mixed-content` | `http://` image on an `https://` page |
| warning | `og-image-too-small` | og/twitter image smaller than 200 × 200 px |
| notice | `alt-empty` | `alt=""` – correct for decorative images, worth a look otherwise |
| notice | `alt-too-long`, `alt-is-filename` | Alt text over 125 characters or looks like `IMG_1234.jpg` |
| notice | `legacy-format` | JPEG/PNG/GIF over 20 KB without a WebP/AVIF alternative |
| notice | `aspect-ratio-mismatch` | `width`/`height` attributes differ from the real aspect ratio by more than 5 % |
| notice | `lazy-first-image` | The first image is `loading="lazy"` (bad for LCP if it is the hero) |
| notice | `lazy-loading-missing` | Image no. 5 or later (configurable) without `loading="lazy"` |
| notice | `og-image-missing`, `og-image-below-recommended` | No og:image, or narrower than 1200 px |
| notice | `large-inline-image`, `images-not-checked` | data: image over 10 KB; more image URLs than "Maximum images per page" |

Tracking pixels and spacers (≤ 2 × 2 px) are ignored by the alt and dimension rules.

### Who is it for?

- **SEO and web performance teams** looking for quick wins (alt texts, WebP/AVIF, oversized images, CLS).
- **Agencies** auditing client sites or monitoring them on a schedule.
- **Developers** checking a release for broken or unoptimised images.

### Input

| Field | Example / default |
|---|---|
| URLs | `https://www.wikipedia.org`, `https://example.com/blog/` |
| Crawl the website | off (on: follow internal links) |
| Maximum pages / link depth (crawl) | `20` / `2` |
| Crawl only / do not crawl pages matching | `/blog/*` / `/tag/*` |
| Respect robots.txt when crawling | on |
| Add one row per image | off |
| Output | all pages / only pages with errors or warnings |
| Maximum images per page | `100` |
| Check every srcset candidate | off (src + largest candidate of each srcset) |
| Large file threshold (KB) / oversize factor / lazy loading from image no. | `200` / `2` / `5` |

Run without input, it checks three example pages.

### Output example (shortened)

```json
{
  "rowType": "page",
  "finalUrl": "https://www.wikipedia.org/",
  "statusCode": 200,
  "title": "Wikipedia",
  "imageElements": 7,
  "imageUrlsChecked": 9,
  "totalImageBytes": 216455,
  "formats": { "webp": 1, "png": 8 },
  "modernFormatShare": 11,
  "missingAlt": 0, "emptyAlt": 7, "missingDimensions": 0, "brokenImages": 0, "oversizedImages": 4, "largeFiles": 0,
  "ogImage": { "url": "https://upload.wikimedia.org/…/250px-Wikipedia-logo-v2.svg.png", "statusCode": 200, "format": "png", "width": 250, "height": 229, "bytes": 30567 },
  "largestImages": [{ "url": "https://upload.wikimedia.org/…/Badge-monthly.png", "bytes": 27349, "format": "png", "width": 200, "height": 200 }],
  "issueCounts": { "error": 0, "warning": 4, "notice": 12 },
  "issueCodes": ["oversized-image", "alt-empty", "legacy-format", "og-image-below-recommended"],
  "issues": [
    { "severity": "warning", "code": "oversized-image", "message": "Image has many more pixels than its displayed size (width attribute)", "count": 4,
      "examples": [{ "url": "https://upload.wikimedia.org/…/Badge-one-time.png", "displayedWidth": 80, "actualWidth": 200, "bytes": 23190 }] }
  ]
}
```

With "Add one row per image", each page row is followed by rows like
`{ "rowType": "image", "pageUrl": "…", "imageUrl": "…", "position": 1, "alt": "Crawlee", "widthAttr": null, "heightAttr": null, "loading": null, "format": "svg", "bytes": 6365, "width": 106, "height": 28, "issueCodes": ["dimensions-missing"] }`.

Unreachable pages, HTTP errors and non-HTML start URLs get a row with `error` – **free of charge**.

### Pricing and speed

See the **Pricing** tab. You pay per checked page; image rows are included. A typical page with 20–60 images takes 1–3 seconds; image downloads run in parallel (up to 16, at most 6 per host) and stop as soon as format and pixel size are known.

### Privacy and fair use

The Actor reads public HTML and image headers only. It does not store image contents and outputs no personal data. It identifies itself with its own User-Agent and respects robots.txt for crawled pages by default. Only check sites you are allowed to audit.

### Limits

- **No JavaScript rendering:** images inserted by JavaScript only and CSS background images are not seen. Common lazy-loading attributes (`data-src`, `data-srcset`, `data-lazy-src`, `data-original`) are understood.
- Sizing via external CSS (e.g. `aspect-ratio` in a stylesheet) is not visible – such images may still get `dimensions-missing`. Inline `style` with width + height or aspect-ratio is accepted.
- "Above the fold" is approximated by HTML order; lazy-loading findings are therefore notices.
- Sites that block data-centre IPs or bots will return errors (free rows).

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

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

Pages whose images should be checked, one per line (e.g. https://example.com/blog/post). Bare domains are checked as https://domain/. With "Crawl the website" switched on, these are the start pages of the crawl. Empty input: three example pages are checked.

## `crawl` (type: `boolean`):

Also check the internal pages linked from the start URLs (same website only), up to "Maximum pages". Off: only the listed URLs are checked.

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

Crawl mode only: stop after this many pages in total (start URLs included). You pay per checked page, so this also caps the cost.

## `maxDepth` (type: `integer`):

Crawl mode only: how many clicks away from a start URL internal links are followed.

## `crawlScope` (type: `string`):

Same domain: the start host and its subdomains. Same hostname: only the start host ("www." is ignored).

## `includePatterns` (type: `array`):

Optional, crawl mode. Glob patterns (`*` = any characters) matched against the full URL or – if they start with `/` – against path + query, e.g. `/blog/*`. Regular expressions go between slashes. Start URLs are always checked.

## `excludePatterns` (type: `array`):

Optional, crawl mode. Same syntax, e.g. `/tag/*`.

## `respectRobotsTxt` (type: `boolean`):

Do not crawl discovered pages that robots.txt disallows. Start URLs are always checked.

## `outputImageRows` (type: `boolean`):

Besides the page summary, output one extra row per image element and og/twitter image (rowType = "image") with URL, alt, attributes, format, bytes, pixel size and issue codes. Image rows are included in the page price.

## `outputFilter` (type: `string`):

All checked pages, or only pages with at least one error or warning. Hidden pages are not charged.

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

At most this many different image URLs are downloaded per page (the rest is reported as not checked). Alt, width/height and lazy-loading rules are still applied to all image elements.

## `checkAllSrcsetCandidates` (type: `boolean`):

Off: per image the src plus the largest candidate of each srcset / <source> is downloaded. On: every candidate (finds more broken variants, but needs more requests).

## `largeFileKb` (type: `integer`):

Images larger than this get an "image-file-too-large" warning.

## `oversizeFactor` (type: `string`):

An image without responsive srcset is flagged "oversized-image" when its real width is more than this factor times its width attribute (2 allows for high-DPI screens).

## `lazyAfterImages` (type: `integer`):

Images at this position or later (HTML order, first image = 0) without loading="lazy" get a "lazy-loading-missing" notice.

## `userAgent` (type: `string`):

Leave empty to identify as 'Mozilla/5.0 (compatible; image-seo-checker/0.1; Apify Actor; +https://apify.com)'.

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

How many pages are processed at the same time (1–10). Images are downloaded with up to 16 parallel requests (6 per host).

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

Inactivity timeout for page downloads (image requests use at most 15 s and are retried once).

## Actor input object example

```json
{
  "urls": [
    "https://www.wikipedia.org",
    "https://developer.mozilla.org/en-US/",
    "https://apify.com"
  ],
  "crawl": false,
  "maxPages": 20,
  "maxDepth": 2,
  "crawlScope": "same-domain",
  "respectRobotsTxt": true,
  "outputImageRows": false,
  "outputFilter": "all",
  "maxImagesPerPage": 100,
  "checkAllSrcsetCandidates": false,
  "largeFileKb": 200,
  "oversizeFactor": "2",
  "lazyAfterImages": 5,
  "maxConcurrency": 3,
  "timeoutSecs": 30
}
```

# Actor output Schema

## `results` (type: `string`):

One item per checked page with image summary and grouped issue list (plus optional image rows and free rows for unreachable URLs).

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

Counts of checked pages and images, formats, bytes and issue codes.

# 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://www.wikipedia.org",
        "https://developer.mozilla.org/en-US/",
        "https://apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/image-seo-checker").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://www.wikipedia.org",
        "https://developer.mozilla.org/en-US/",
        "https://apify.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adamplaenitz/image-seo-checker").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://www.wikipedia.org",
    "https://developer.mozilla.org/en-US/",
    "https://apify.com"
  ]
}' |
apify call adamplaenitz/image-seo-checker --silent --output-dataset

```

## MCP server setup

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

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/rvAIgfrzeduYjVusR/builds/vwYFRTXOHJXzVuHkK/openapi.json
