# Broken Link Checker: Find 404s, Dead Links & Redirects (`dottti/broken-link-checker`) Actor

Crawl a website and check every internal and external link: broken links (404, 410, dead domains), server errors, redirects with the full chain, the page each link sits on and its anchor text. Follows robots.txt. Alerts on new broken links when scheduled.

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

## Pricing

from $0.49 / 1,000 link verifieds

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, Dead Links & Redirects

Give a list of websites. The checker reads pages of each site, collects every link, and checks each one. You get one row per link with a plain verdict, the HTTP status, the page the link sits on, its anchor text and the full redirect chain, plus one free summary row per site.

### Who it is for

- **SEO and content teams** who want to find 404s and dead outbound links before search engines and readers do.
- **Agencies** who check client sites every week and want an alert only when a new broken link appears.
- **Site migrations**: see which old internal links now go through redirects, and how many hops each takes.

### What each link row tells you

| Field | Meaning |
|---|---|
| `verdict` | `ok`, `redirected` (works after redirects), `broken` (404, 410, other 4xx, dead domain, redirect loop), `server_error` (5xx), `unreachable` (timeout, refused or failed secure connection), `blocked` (the site answered with an access check, so the link could not be verified) |
| `httpStatus` | Final HTTP status |
| `reason` | Plain-language reason, for example "page not found (404)" or "the domain name does not resolve (DNS)" |
| `linkType` | `internal` or `external` |
| `anchorText` | The clickable text of the link (emails removed) |
| `foundOn`, `foundOnPages`, `foundOnCount` | The first page the link was found on, up to 5 pages, and how many pages link to it |
| `finalUrl`, `redirectCount`, `redirectChain` | Where the link ends up and every hop with its status |
| `responseMs` | Response time of the final request |
| `newProblem` | With alerts on: true when this problem was not there on the last run |

The free `site_summary` row per site gives pages read, links found, links verified, counts per verdict, links closed by robots.txt and links that hit an access check.

### Example (real run, addresses shortened)

```json
{
  "recordType": "link",
  "site": "(the site checked)",
  "url": "(an external documentation file)",
  "verdict": "redirected",
  "httpStatus": 200,
  "reason": "works after 2 redirect(s)",
  "linkType": "external",
  "tag": "a",
  "anchorText": "Anthropic",
  "foundOn": "(the site's home page)",
  "foundOnCount": 2,
  "redirectCount": 2,
  "redirectChain": [
    { "url": "(old address)", "status": 301 },
    { "url": "(middle address)", "status": 308 },
    { "url": "(final address)", "status": 200 }
  ],
  "responseMs": 411,
  "charged": true
}
```

Summary row from the same run: "3 page(s) read, 40 unique link(s) found, 36 verified: 0 broken, 0 server error, 0 unreachable, 5 redirected, 31 ok. 1 answered with an access check and 3 are closed by robots.txt (both free, not verified)."

### How to use it

1. Put one or more websites in **Websites or start pages**.
2. Set **Pages to read per site** and **Links to check per site**. The link limit also caps the cost per site.
3. Turn on **Only output problems** if you only want the broken ones in the table.
4. For a weekly check, turn on **Only new problems (alerts)**, give the schedule an alert name, and add it under Schedules. From the second run on you only get problems that are new since the last run.

### Pricing

You pay per link verified: one result for every unique link that gave a definite answer (working, redirected, broken, server error or unreachable). Links that robots.txt closes to us and links that answer with an access check are not charged, because we could not verify them. Summary and status rows are free. With **Only output problems** or alerts on, working links are still verified and counted, and the summary row shows the totals.

Platform usage is included in the price.

### How it behaves

- It identifies itself honestly as `dottti-broken-link-checker` and reads each host's robots.txt before any request to that host, at every redirect hop. Addresses robots.txt closes to us are reported as not checked and are free. A robots.txt that answers with a server error is treated as "closed".
- Pages that ask robots not to follow their links (meta robots or X-Robots-Tag "nofollow") are read but their links are not collected.
- Requests to one host go out one at a time with a delay (300 ms by default). No proxy, no cookies, no browser.
- Firewall or bot-check answers (401, 403, 429 and similar) are reported as `blocked`, never bypassed, and are free.

### Limits

- Pages are read as plain HTML. Links added only by JavaScript after the page loads are not seen.
- Only pages on the same host as the start address are crawled. External links are checked once, never crawled.
- Links that need a login are reported with the answer the server gives to a visitor without one (often 401 or 403, shown as `blocked`).
- Some large sites answer automated tools with 403 or 429 even when the link works; those rows say `blocked` and are free.
- One request per link: a site that is briefly down at check time shows as `server_error` or `unreachable`. Run again to confirm.
- mailto, tel and javascript links are skipped. Emails are never output.

# Actor input Schema

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

One per line (example.com or a full page address). The checker opens pages on the same host, starting here, and checks every link it finds. Empty = a small demo on one site.

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

How many pages of each site are opened to collect links (same host only). Empty = 25 (3 on the demo).

## `maxLinksPerSite` (type: `integer`):

Most unique links checked per site. Each verified link is one paid result, so this also caps the cost per site. Empty = 500 (40 on the demo).

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

Also check links that point to other domains (only the link itself is opened, never crawled further). Off = internal links only.

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

Check img, script, stylesheet and icon addresses on each page, not only a href links.

## `onlyProblems` (type: `boolean`):

Write rows only for broken, server-error and unreachable links. Working links are still verified and counted (each verified link is one paid result); the free site summary row shows the totals.

## `onlyNewProblems` (type: `boolean`):

Remember the problem links of each site under the alert name and, from the second run on, output only problems that were not there last time. Good for a daily or weekly schedule.

## `alertName` (type: `string`):

Name of the memory used by Only new problems. Use a different name for each schedule or client.

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

How many sites are checked in parallel.

## `linkConcurrency` (type: `integer`):

Parallel link checks per site. Requests to any single host are always sent one at a time with the delay below.

## `requestDelayMs` (type: `integer`):

Minimum gap between two requests to the same host.

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

A link that does not answer in this time is reported as unreachable.

## Actor input object example

```json
{
  "startUrls": [
    "https://llmstxt.org/"
  ],
  "maxPagesPerSite": 3,
  "maxLinksPerSite": 40,
  "checkExternal": true,
  "checkResources": false,
  "onlyProblems": false,
  "onlyNewProblems": false,
  "alertName": "default",
  "maxConcurrency": 2,
  "linkConcurrency": 4,
  "requestDelayMs": 300,
  "timeoutSecs": 20
}
```

# Actor output Schema

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

Checked links, problems first, plus site summary and status rows.

# 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://llmstxt.org/"
    ],
    "maxPagesPerSite": 3,
    "maxLinksPerSite": 40
};

// Run the Actor and wait for it to finish
const run = await client.actor("dottti/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://llmstxt.org/"],
    "maxPagesPerSite": 3,
    "maxLinksPerSite": 40,
}

# Run the Actor and wait for it to finish
run = client.actor("dottti/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://llmstxt.org/"
  ],
  "maxPagesPerSite": 3,
  "maxLinksPerSite": 40
}' |
apify call dottti/broken-link-checker --silent --output-dataset

```

## MCP server setup

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