# Broken Link Checker (404s, Redirects, Missing Images) (`pagecraft/broken-link-checker`) Actor

Crawl any website and check every link and image: find broken links (404, 500, dead domains), redirect chains and missing images, with the pages they appear on. Bulk websites, fast, no browser.

- **URL**: https://apify.com/pagecraft/broken-link-checker.md
- **Developed by:** [Pagecraft Tools](https://apify.com/pagecraft) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 link checkeds

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

## Broken Link Checker: Find 404s, Redirects and Missing Images

Crawl any website and **check every link and image** on it. Get a list of **broken links** (404, 500, dead domains, timeouts), **redirect chains** and **missing images**, each with **the pages they appear on**, so you know exactly what to fix.

### What it does

- 🔍 Crawls pages from the **sitemap and internal links** (same site, robots.txt respected)
- ✅ Checks **internal links, external links and images**, each unique URL once
- ↪️ Shows full **redirect chains** (301, 302, 307, 308)
- 🛡️ **No false alarms from bot protection**: links that refuse automated checks (HTTP 401, 403, 429, 503, 999) are listed as `blocked`, not broken
- 📍 Lists up to 5 **pages where each problem link was found**, with the link text
- 📊 One **summary row per website**: pages crawled, links checked, broken links and redirects
- ⚡ Fast, no browser; confirms with a small GET before calling a link broken (some servers reject HEAD requests)

### Input

| Field | What to enter |
| --- | --- |
| Domains or URLs | `acme.com`, `https://acme.com/blog` or an email address; one per line |
| Pages per website | How many pages to crawl (every link and image on them is checked) |
| Check external links | Also check links to other websites |
| Check images | Also check image URLs |
| Report every link | Return working links too, not just problems |

```json
{ "domains": ["acme.com"], "maxPagesPerSite": 100, "checkExternalLinks": true }
```

### Who it's for

- **Site owners and marketers** fixing 404s that hurt SEO and conversions.
- **SEO agencies** running link health checks for many client sites in one run.
- **Developers** checking a site after a migration or redesign.

### Output example

One row per broken or redirected link (or every link, if you choose), plus a summary row per website (`"type": "site-summary"`) with pages crawled, links checked, broken links and redirects.

```json
{ "type": "link", "url": "https://acme.com/old-pricing", "problem": "broken", "statusCode": 404, "linkType": "internal", "linkText": "See pricing", "foundOn": ["https://acme.com/", "https://acme.com/features"] }
```

### Pricing

Each unique link is checked once per website, however many pages it appears on, so you pay per unique link, not per occurrence.

| Event | When it is charged | Price per 1,000 (Free / Bronze / Silver / Gold plan) |
| --- | --- | --- |
| Website crawled | Each website: home page, robots.txt and sitemap. | $6 on every plan |
| Page crawled | Each page crawled for links. | $1 on every plan |
| Link checked | Each unique link or image checked. | $1 / $0.90 / $0.80 / $0.70 |
| Website failed | A website that could not be reached or blocked the crawl. | $3 on every plan |

Set **Maximum cost per run** to cap your spend: the run stops cleanly at your limit.

# Actor input Schema

## `domains` (type: `array`):

Company domains (acme.com), URLs, or even email addresses (the domain is used). One per line; duplicates are removed.

## `maxPagesPerSite` (type: `integer`):

Maximum pages to crawl per website. Every link and image on those pages is checked.

## `checkExternalLinks` (type: `boolean`):

Also check links to other websites.

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

Also check image URLs.

## `reportAllLinks` (type: `boolean`):

Return working links too, not just broken links and redirects.

## `reportBlockedLinks` (type: `boolean`):

Some sites (LinkedIn, review sites, Cloudflare-protected pages) refuse automated checks with HTTP 401, 403, 429, 503 or 999 even when they work in a browser. These are listed as "blocked", never as broken. Turn off to hide them.

## `proxyConfiguration` (type: `object`):

Optional. Use Apify datacenter proxies or your own proxies for websites that block automated requests.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "stripe.com",
    "bbc.co.uk"
  ],
  "maxPagesPerSite": 5,
  "checkExternalLinks": true,
  "checkImages": true,
  "reportAllLinks": false,
  "reportBlockedLinks": true
}
```

# 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 = {
    "domains": [
        "apify.com",
        "stripe.com",
        "bbc.co.uk"
    ],
    "maxPagesPerSite": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("pagecraft/broken-link-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 = {
    "domains": [
        "apify.com",
        "stripe.com",
        "bbc.co.uk",
    ],
    "maxPagesPerSite": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("pagecraft/broken-link-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 '{
  "domains": [
    "apify.com",
    "stripe.com",
    "bbc.co.uk"
  ],
  "maxPagesPerSite": 5
}' |
apify call pagecraft/broken-link-checker --silent --output-dataset

```

## MCP server setup

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