# Broken Link Checker: Find 404s & Dead Links on Any Website (`data_factory_nerd/broken-link-checker`) Actor

Crawl any website and find broken links (404, 410, 5xx, DNS and timeout errors) on every page: internal links, external links and optionally images. Shows the page, anchor text and status for each dead link, flags redirects and bot-blocked links separately. robots.txt aware. $1 per 1,000 pages.

- **URL**: https://apify.com/data_factory_nerd/broken-link-checker.md
- **Developed by:** [Joe Pena](https://apify.com/data_factory_nerd) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.90 / 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.
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

### What is Broken Link Checker?

**Broken Link Checker** crawls any website and tests **every link on every page**: internal links, external links and (optionally) images. For each page you get **which links are dead, their HTTP status (404, 410, 500…) or error (DNS, timeout, SSL), and the anchor text**, so you know exactly what to fix and where.

It also separates the noise from real problems:

- 🔁 **Redirecting links** (301/302) are listed apart from broken ones, so you can update them to the final URL.
- 🛡️ **Bot-blocked links** (401, 403, 429, LinkedIn's 999) are listed as *blocked*, not broken, so you don't chase false alarms.
- 🧾 A **SUMMARY** record groups every **unique broken link** with **all the pages it appears on**, ready to hand to a developer.

**No browser, no proxy, no API key.** It's a fast HTTP crawler that respects `robots.txt`, stays on the website you give it and only sends one light request per external link.

### What data do you get?

One row per crawled page:

| Field | Example |
|---|---|
| `url` / `statusCode` / `title` | https://crawlee.dev/js/api/core/changelog / 200 / Changelog |
| `depth` / `foundOn` | 1 / https://crawlee.dev/ |
| `linksFound` / `linksChecked` | 653 / 647 |
| `brokenCount` / `brokenLinks` | 3 / `[{"url": "https://github.com//github.com/apify/crawlee/pull/1890/issues/…", "statusCode": 404, "anchorText": "…", "type": "external"}]` |
| `redirectCount` / `redirectedLinks` | 194 / `[{"url": "…", "statusCode": 301, "finalUrl": "…"}]` |
| `blockedCount` / `blockedLinks` | 1 / `[{"url": "https://www.linkedin.com/…", "statusCode": 999}]` |
| `hasProblems` | true if the page itself fails or has broken links |
| `responseTimeMs` / `checkedAt` | 412 / 2026-11-16T11:30:00Z |

Link `type` is `internal`, `external` or `image`. Errors without an HTTP status are reported as `timeout`, `dns_error`, `ssl_error`, `connection_refused`, `connection_error` or `redirect_loop`.

### Use cases

- 🔎 **SEO audits**: find 404s that waste crawl budget and leak link equity
- 🧹 **Website maintenance**: schedule a weekly check and catch dead links before visitors do
- 🏢 **Agencies**: run link audits for many client sites in one run and export to CSV or Excel
- 📚 **Docs and blogs**: find outdated external references in large documentation sites
- 🚚 **Migrations**: verify nothing broke after a redesign or domain move

### How to find broken links on a website

1. Add one or more websites to **Websites to check** (`example.com` works).
2. Set **Max pages per website** (you pay per page checked).
3. Optional: turn off **Check external links**, turn on **Check images**, or limit the crawl with **Only crawl URLs containing** (`/blog/`) and **Skip URLs containing** (`/tag/`).
4. Click **Start**. Open the **Output** tab, sort by `brokenCount`, and open the `SUMMARY` record for the de-duplicated list of broken links.

#### Input example

```json
{
  "startUrls": ["https://crawlee.dev"],
  "maxPages": 200,
  "checkExternalLinks": true,
  "checkImages": false,
  "excludePatterns": ["/tag/", "?replytocom="]
}
```

#### Output example

```json
{
  "url": "https://crawlee.dev/js/api/core/changelog",
  "statusCode": 200,
  "title": "Changelog | API | Crawlee for JavaScript",
  "depth": 1,
  "linksChecked": 647,
  "brokenCount": 3,
  "brokenLinks": [
    {"url": "https://github.com//github.com/apify/crawlee/pull/1890/issues/issuecomment-1533271694", "statusCode": 404, "error": null, "anchorText": "…", "type": "external"}
  ],
  "redirectCount": 194,
  "blockedCount": 1,
  "hasProblems": true
}
```

### How much does it cost?

**$1.00 per 1,000 pages checked** (paid Apify plans get 10% off). Every link on a page is checked at no extra cost, so a 500-page site with 30,000 links costs about $0.50. Websites that can't be reached at all are reported in SUMMARY and **not charged**.

### Scheduling and API

Create a schedule in Apify Console to run it weekly and get notified, or call it from code:

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("data_factory_nerd/broken-link-checker").call(run_input={"startUrls": ["https://example.com"], "maxPages": 300})
for page in client.dataset(run["defaultDatasetId"]).iterate_items():
    if page["brokenCount"]:
        print(page["url"], [l["url"] for l in page["brokenLinks"]])
```

### FAQ

#### Does it check links on other websites?

Yes, external links are tested with one HEAD request (GET fallback), but other websites are never crawled. Turn off **Check external links** to test only your own links.

#### Why is a link listed as "blocked" instead of broken?

Some sites (LinkedIn, Amazon, Cloudflare-protected pages) refuse automated requests with 401/403/429/999 even when the page works in a browser. These are listed separately in `blockedLinks` so they don't inflate your broken-link count.

#### Does it render JavaScript?

No. It reads the HTML the server returns, which covers most websites, including Next.js, WordPress and Shopify. Links that are only created by JavaScript after page load aren't seen.

#### Does it respect robots.txt?

Yes. Pages disallowed by the site's `robots.txt` are not crawled (the start page is always checked), and pages with a `nofollow` robots meta tag are checked but their links aren't followed.

#### Found a bug or need a field?

Open an issue on the **Issues** tab. I usually reply within 24 hours.

### Related Actors by data_factory_nerd

| Actor | What it does |
|---|---|
| [Sitemap URL Extractor](https://apify.com/data_factory_nerd/sitemap-url-extractor) | Every URL from a website's sitemaps, with lastmod and monitor mode |
| [Tech Stack Detector](https://apify.com/data_factory_nerd/tech-stack-detector) | Which CMS, analytics and frameworks a website uses |
| [Email Security Checker](https://apify.com/data_factory_nerd/email-security-checker) | SPF, DKIM, DMARC, MTA-STS and BIMI audit with a grade |
| [Bulk WHOIS & DNS Lookup](https://apify.com/data_factory_nerd/domain-whois-dns-lookup) | Domain age, expiry, registrar and DNS records |
| [Wayback Machine Scraper](https://apify.com/data_factory_nerd/wayback-machine-scraper) | Archived snapshots and page history of any URL |

# Actor input Schema

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

Homepage or any start page, e.g. https://example.com. The crawler follows links on the same host from there. A bare domain like example.com works too.

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

How many pages to crawl on each website. You pay per page checked.

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

0 = check only the start page. 1 = start page plus pages linked from it, and so on.

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

Also test links that point to other websites (one light HEAD/GET request each, never crawled).

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

Also test <img> sources for broken images.

## `includeSubdomains` (type: `boolean`):

Treat blog.example.com and docs.example.com as part of example.com.

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

Optional. Crawl only pages whose URL contains one of these strings (e.g. /blog/). Prefix with re: for a regex. Start pages are always checked.

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

Optional. Don't crawl pages whose URL contains one of these strings (e.g. /tag/, ?replytocom=). Prefix with re: for a regex.

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

Requests in flight at once. Keep it low to be polite to the website.

## `requestTimeoutSecs` (type: `integer`):

A link that doesn't answer within this time is reported as a timeout.

## `maxItems` (type: `integer`):

Overall cap across all websites. 0 = no cap (max pages per website still applies).

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev"
  ],
  "maxPages": 15,
  "maxDepth": 10,
  "checkExternalLinks": true,
  "checkImages": false,
  "includeSubdomains": false,
  "maxConcurrency": 5,
  "requestTimeoutSecs": 15,
  "maxItems": 0
}
```

# Actor output Schema

## `pages` (type: `string`):

No description

## `summary` (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 = {
    "startUrls": [
        "https://crawlee.dev"
    ],
    "maxPages": 15
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data_factory_nerd/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/0DOkIAdir91m9Cvlz/builds/4QCfANLG5mt1GJuhK/openapi.json
