# Broken Link & Image Checker - Sitemap or Crawl, $0.0009/URL (`digivibetech/broken-link-image-checker`) Actor

Find broken links and images on your site: crawl pages or read a sitemap.xml, check every link, image and srcset once, and get the status, redirects and the pages each one is on. $0.0009 per URL checked; crawled pages and robots-skipped URLs free. Respects robots.txt.

- **URL**: https://apify.com/digivibetech/broken-link-image-checker.md
- **Developed by:** [DigiVibeTech](https://apify.com/digivibetech) (community)
- **Categories:** SEO tools, Developer tools, E-commerce
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.89 / 1,000 url checked (link or image status determined)s

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

## Broken Link & Image Checker

Find **broken links and broken images** on your website in one run. Start from a page (the actor crawls internal links) or from your **sitemap.xml**. Every unique link and image is checked once, and you get its HTTP status, where it redirects, and **the pages it appears on**, so you know exactly what to fix.

Built for shop owners, SEOs and developers: after a catalog update, a migration or a theme change, catch 404 product pages, deleted product photos, broken `srcset` variants and dead outbound links before customers or Google do.

### What it checks

- **Links**: every `<a href>` (internal, and optionally external)
- **Images**: `<img src>`, `data-src`, every `srcset` candidate, `<picture><source>` and `og:image` / `twitter:image`
- **States**: `ok` (2xx), `redirect` (3xx or redirected to another URL), `broken` (4xx/5xx, or an image URL that does not return an image) and `unreachable` (DNS, timeout, TLS)
- **Where**: `foundOn` (up to 10 pages) and `foundOnCount` for each URL

### Input

| Field | Default | Meaning |
|---|---|---|
| `startUrls` | (required) | Pages or sitemap.xml / sitemap index URLs |
| `maxPages` | 20 | HTML pages scanned per start URL (scanning is free) |
| `followLinks` | true | Crawl internal links on the same host |
| `checkLinks` / `checkImages` | true | What to check |
| `checkExternal` | true | Also check other hosts (image CDNs, outbound links) |
| `maxUrlsToCheck` | 1000 | Limit on checked (charged) URLs |

### Output

One dataset item per checked URL: `url`, `type` (link/image), `status`, `state`, `ok`, `redirectedTo`, `contentType`, `error`, `external`, `foundOn`, `foundOnCount`.
The **BROKEN** record in the key-value store lists only the problems. **SUMMARY** (also saved as **OUTPUT**) has the counts. **ERRORS** lists pages that could not be scanned and URLs skipped by robots.txt.

```json
{"url": "https://shop.example/img/blue-mug.jpg", "type": "image", "status": 404, "state": "broken", "ok": false,
 "foundOn": ["https://shop.example/mugs/blue-mug"], "foundOnCount": 1}
```

### Speed and the run timeout

To stay polite, each site gets about **one request per second**. Pages are scanned first, then every found URL is checked (up to 16 at a time, but still about 1 per second per host). Rough guide with the default 1-hour timeout:

- 20 pages (the default) take about 20-30 seconds to scan.
- 1,000 URLs on your own site (the default limit) take about 17 minutes; links to other hosts are checked in parallel.
- Large sites (thousands of pages or URLs) need a longer timeout, or several runs with lower limits.

The actor watches its own timeout. Shortly before it (10 % of the run time, at least 30 seconds), it stops, keeps every result found so far, and finishes as **Succeeded**. Page scanning uses at most half of the time, so links always get checked. SUMMARY then has `stoppedEarly: true`, `pagesLeft` (pages not scanned) and `urlsLeft` (found URLs not checked, not charged). Raise the timeout or lower `maxPages` / `maxUrlsToCheck` to finish the rest.

### Limits

- It reads the HTML the server sends (no browser), so text, links or markup added later by JavaScript are not seen.
- Sites that block automated requests or rate-limit hard can show up as `broken` or `error` even if a browser loads them.
- Pages disallowed by robots.txt are not crawled, so links found only there are not checked.

### Responsible crawling

We follow each site's **robots.txt** for every page and every checked URL (disallowed URLs are skipped and not charged), send at most about one request per second per host, check with `HEAD` first (a small `GET` of at most 1 KB only if the server does not support `HEAD`), use an honest User-Agent (`LinkImageChecker/1.0`) and never log in, use proxies or bypass bot protection. Check sites you own or are allowed to check.

### Example input

```json
{
  "startUrls": [
    "https://www.iana.org/help/example-domains"
  ],
  "maxPages": 1,
  "maxUrlsToCheck": 5,
  "checkExternal": true
}
```

### Example output (one record)

Real record from a test run on the input above.

```json
{
  "url": "https://www.iana.org/",
  "type": "link",
  "status": 200,
  "state": "ok",
  "ok": true,
  "redirectedTo": null,
  "contentType": "text/html",
  "error": null,
  "external": false,
  "foundOn": [
    "https://www.iana.org/help/example-domains"
  ],
  "foundOnCount": 1,
  "checkedAt": "2026-10-18T05:38:58.050401+00:00"
}
```

### Pricing

| Event | Price |
|---|---|
| URL checked (link or image status determined) | $0.0009 |

Scanning pages is free, robots-skipped URLs are free, and there is no start fee. A shop with 300 unique links and images costs $0.27. Set a maximum cost per run and the actor stops checking before it is reached.

### Use it in n8n, Make or Zapier

Schedule a weekly run, then read the `BROKEN` record (`/key-value-stores/{id}/records/BROKEN`) and send it to Slack or email when it is not empty.

*Maintained by DigiVibeTech. Questions: [digivibetech.com/support](https://digivibetech.com/support/)*

# Actor input Schema

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

Pages to start from, or sitemap.xml / sitemap index URLs (every page in the sitemap is scanned). Public pages only; robots.txt is respected.

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

How many HTML pages are scanned for links and images per start URL (free). 1 = only the start page. Pages are fetched at about 1 per second per site, so 20 pages take roughly 20-30 seconds.

## `followLinks` (type: `boolean`):

Follow links on the same host to find more pages (up to 'Max pages'). Ignored for sitemap input.

## `checkLinks` (type: `boolean`):

Check <a href> targets.

## `checkImages` (type: `boolean`):

Check <img src>, srcset, <picture> sources and og:image. Also flags image URLs that do not return an image.

## `checkExternal` (type: `boolean`):

Also check links and images on other hosts (e.g. your image CDN). Off = same host only.

## `maxUrlsToCheck` (type: `integer`):

Upper limit of unique URLs checked (and charged) per run. URLs on one host are checked at about 1 per second, so 1,000 URLs on your own site take about 17 minutes; external hosts are checked in parallel. If the run's timeout comes first, the run stops early, keeps every result so far and reports how many URLs were left.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.iana.org/help/example-domains"
  ],
  "maxPages": 20,
  "followLinks": true,
  "checkLinks": true,
  "checkImages": true,
  "checkExternal": true,
  "maxUrlsToCheck": 1000
}
```

# Actor output Schema

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

All result items (overview view)

## `errors` (type: `string`):

Inputs that could not be processed, with the reason

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

Counts of processed, billed and failed items

## `broken` (type: `string`):

Only the broken or unreachable URLs with the pages they are on

# 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://www.iana.org/help/example-domains"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("digivibetech/broken-link-image-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 = { "startUrls": ["https://www.iana.org/help/example-domains"] }

# Run the Actor and wait for it to finish
run = client.actor("digivibetech/broken-link-image-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 '{
  "startUrls": [
    "https://www.iana.org/help/example-domains"
  ]
}' |
apify call digivibetech/broken-link-image-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,digivibetech/broken-link-image-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/vLquJ7FdXet8Nx07y/builds/hu4ERboYl6zTYfEyj/openapi.json
