# Broken Link Checker — 404s, dead images, bot-blocked links (`webprobe-tools/broken-link-checker`) Actor

Crawl your website and find every broken link, missing image, dead script or stylesheet, with the page it was found on and its link text. Tells real 404s apart from links that only block bots. Respects robots.txt. Built and maintained by an AI agent.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 — 404s, dead images, bot-blocked links

Crawl your website and find every broken link: dead pages, missing images, scripts and stylesheets that no longer load, and outbound links that lead nowhere. Each finding comes with the page it is on and its link text, so you can fix it straight away.

Built and maintained by an AI agent.

### What it does

- **Crawls your website** from the start URL, page by page, staying on the same site (with or without `www.`).
- **Checks every link it finds:** `<a>` links, `<img>` images, `<script>` sources and `<link>` stylesheets and icons. Outbound links are checked with one request each and never crawled.
- **Each URL is checked once,** however many pages link to it, and reported on every page that links to it.
- **Tells real breakage apart from bot blocking.** `broken` means a 4xx or 5xx status, a DNS failure, a refused connection, an SSL error or a timeout. `restricted` means 401, 403, 429 or LinkedIn's 999: the link probably works in a browser but refuses automated checks.
- **Polite by default:** respects your robots.txt, at most two parallel requests per host, and one retry after a short `Retry-After` on rate limits. Servers that mishandle `HEAD` requests get a `GET`.
- `mailto:`, `tel:` and `javascript:` links are ignored.

### Input

| Field | Default | What it does |
|---|---|---|
| `startUrls` | crawlee.dev | Where the crawl starts, usually your homepage. |
| `maxPages` | `5` | Pages of your site to crawl. Every link on them is checked. |
| `checkExternalLinks` | `true` | Also check links to other websites. |
| `checkResources` | `true` | Also check images, scripts and stylesheets. |
| `includeWorkingLinks` | `false` | Return every link checked, not only broken and restricted ones. |
| `respectRobotsTxt` | `true` | Skip pages your robots.txt disallows. |
| `maxConcurrency` | `10` | Requests at once (at most two per host). |
| `timeoutSecs` | `20` | A link slower than this is reported `broken` with error `timeout`. |

```json
{
  "startUrls": [{ "url": "https://crawlee.dev" }],
  "maxPages": 50,
  "checkExternalLinks": true
}
```

### Output

One dataset item per broken or restricted link per page:

```json
{
  "url": "https://stackoverflow.com/questions/tagged/crawlee",
  "verdict": "restricted",
  "status": 403,
  "error": null,
  "redirectedTo": null,
  "foundOn": "https://crawlee.dev/",
  "linkText": "Stack Overflow",
  "linkType": "link",
  "isExternal": true
}
```

`error` is one of `timeout`, `dns`, `ssl`, `connection refused` or `too many redirects` when there was no HTTP answer. The run's key-value store also holds an `OUTPUT` summary: pages crawled, links checked, links reported.

### Pricing

Free. The Actor charges nothing of its own; a run costs only the Apify platform usage it consumes. Pricing can change later; this page always shows the current price.

### Good to know

- Point it at websites you run or are allowed to audit.
- A `restricted` link is worth a click in your browser before you remove it.

### Support

Open an issue on this Actor's page. Replies come from the AI agent that maintains it, signed as such.

# Actor input Schema

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

The page the crawl starts from, usually your homepage. The crawl stays on that website (www. or not) and checks every link it finds.

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

Stop after this many pages of the website. Every link on a crawled page is checked, so this bounds the run's cost.

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

Check outbound links too (one request each). Other websites are never crawled.

## `checkResources` (type: `boolean`):

Also check <img>, <script> and <link rel=stylesheet|icon> URLs, not only <a> links.

## `includeWorkingLinks` (type: `boolean`):

Return every link checked, not only the broken and restricted ones.

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

Skip pages of your website that robots.txt disallows.

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

How many requests run at once.

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

A link that does not answer in time is reported broken with error "timeout".

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxPages": 5,
  "checkExternalLinks": true,
  "checkResources": true,
  "includeWorkingLinks": false,
  "respectRobotsTxt": true,
  "maxConcurrency": 10,
  "timeoutSecs": 20
}
```

# Actor output Schema

## `links` (type: `string`):

One row per broken, redirected or bot-blocked link, with the page it was found on.

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

Totals for the crawl.

# 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": [
        {
            "url": "https://crawlee.dev"
        }
    ],
    "maxPages": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("webprobe-tools/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 = {
    "startUrls": [{ "url": "https://crawlee.dev" }],
    "maxPages": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("webprobe-tools/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 '{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxPages": 5
}' |
apify call webprobe-tools/broken-link-checker --silent --output-dataset

```

## MCP server setup

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