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

Find every broken link on a website: 404s, dead domains, server errors, redirect loops and redirect chains, each with the pages and anchor texts that link to it. Crawl a site, its XML sitemap or a URL list; monitor mode reports only new and fixed broken links. Respects robots.txt.

- **URL**: https://apify.com/promur/broken-link-checker.md
- **Developed by:** [PROMUR s.r.o.](https://apify.com/promur) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

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: 404s, Dead Links & Redirects Monitor

Find **every broken link on a website** - **404 / 410 pages, dead domains, server errors, redirect loops** - each with **the pages that link to it and the anchor text** visitors click, so you know exactly what to fix and where. Internal and external links, optionally images, scripts and stylesheets. Crawl a whole site, check **every URL in its XML sitemap**, check the links on a few pages, or verify a list of URLs. Schedule it as a **monitor** and get only the links that broke (or were fixed) since the last run.

Plain HTTP, no browser - fast and inexpensive. robots.txt is respected.

### Why this Actor

**Price, quality, reliability, responsibility - in balance:**

- 💵 **Low price** - $0.50 per 1,000 checked links, no start fee; each unique link is checked (and charged) once, however many pages link to it.
- 🔍 **Fix-ready rows** - every broken link comes with up to 10 source pages and their anchor texts, the status code, the redirect chain and a plain-English "what to do" note.
- 🔁 **Dependable verdicts** - a light HEAD request, and every error answer confirmed with a full GET before it is reported; a site that asks to slow down (HTTP 429) is waited out and retried; "blocked" (401 / 403) and "timeout" are reported separately, never counted as broken - no false alarms to chase.
- 🤝 **Responsible crawling** - every site's robots.txt is read first, links it disallows are never requested (and never charged), and at most 2 requests run in parallel per site.

**What you get:**

- 🔗 **One row per unique link** - `result` (broken, dns, server_error, client_error, redirect_loop, redirected, blocked, timeout, ...), `statusCode`, `finalUrl`, `redirects`, `redirectChain`, `responseMs`, `isInternal`, `linkType`.
- 📍 **Where it is linked from** - `sourceCount` (how many times the link appears) and `sources` (page + anchor text): fix the most-linked broken URLs first; the rows are sorted that way.
- 🗺️ **Sitemap health** - in crawl mode orphan pages from the XML sitemap are crawled too; in sitemap mode every sitemap URL is checked (dead pages in your sitemap hurt crawling).
- 🔔 **Monitor mode** - only `new-broken` and `fixed` links since the previous run (a broken link removed from the site also counts as fixed). Run it daily with an Apify schedule and connect Slack, email or a webhook.
- 🧾 **Site report** - `SUMMARY` per site: pages crawled, links found and checked, broken, redirected, blocked, timeouts, links skipped by robots.txt, external links not checked.

### Modes

| Mode | Input | What is checked |
| --- | --- | --- |
| **Crawl the site** (default) | start URL, e.g. `https://www.example.com` | the site's pages (links + XML sitemap, up to *Max pages*) and every link on them |
| **Check every URL in the XML sitemap** | site or sitemap URL | each URL listed in the sitemap (robots.txt `Sitemap:` lines or `/sitemap.xml`, sitemap indexes included) |
| **Only these pages** | page URLs | the links on those pages |
| **Only these links** | any URLs (up to 10,000) | the URLs themselves - e.g. backlinks, a migration redirect map, links in a newsletter |

### How to use

1. Paste the site's start URL under **Websites, pages or links** - several sites are fine.
2. Pick the **Mode** and set **Max pages to crawl per site** (default 100) and **Max link checks per site** (default 1,000). External links are checked by default; images, scripts and stylesheets on request.
3. Click **Start**. The **Links** view lists the broken links, most-linked first; the site report is in **SUMMARY** (Storage → Key-value store).

```json
{
    "urls": ["https://www.example.com"],
    "mode": "site",
    "maxPagesPerSite": 500,
    "maxLinksPerSite": 5000,
    "checkExternalLinks": true
}
```

Monitor a site every day (with an Apify schedule):

```json
{
    "urls": ["https://www.example.com"],
    "onlyChanges": true,
    "feedName": "daily"
}
```

### Output

```json
{
    "url": "https://www.example.com/old-sale",
    "finalUrl": null,
    "result": "broken",
    "isBroken": true,
    "statusCode": 404,
    "redirects": 0,
    "redirectChain": [],
    "responseMs": 182,
    "linkType": "link",
    "isInternal": true,
    "note": "HTTP 404: the page is gone.",
    "sourceCount": 3,
    "sources": [
        { "page": "https://www.example.com/", "anchor": "Summer sale" },
        { "page": "https://www.example.com/blog/summer", "anchor": "our sale page" }
    ],
    "changeType": null,
    "site": "example.com",
    "input": "https://www.example.com",
    "scrapedAt": "2026-11-06T12:00:00.000Z"
}
```

**Results** (`result`): `broken` (404 / 410), `client_error` (other 4xx), `server_error` (5xx), `dns` (the domain does not exist), `redirect_loop` - these are **broken** (`isBroken: true`). Not broken, but reported with *Rows in the results* = problems / all: `redirected` (works through a redirect: link to the final URL), `blocked` (401 / 403 / 429: the site refuses automated access, the link may work in a browser), `timeout`, `network_error`, `robots_disallowed` (not opened: robots.txt), `site_unreachable` (not opened: the site's robots.txt got no answer - the site may be down), `ok`.

### Pricing

**$0.50 per 1,000 checked links** - no start fee. A crawled page is one checked link too.

- A 100-page site with 800 unique links: **$0.40**.
- A daily monitor of a 50-page site with 400 links: **$0.20 a day**.

Links that robots.txt disallows, or whose site gives no answer for robots.txt, are never requested and never charged. The number of rows does not matter: "every checked link" costs the same as "broken only". Set *Maximum cost per run* in the run options: checking stops at that number of links.

### FAQ

**Why is a link "blocked" and not "broken"?** Some sites (social networks, large shops) refuse automated requests with 401 / 403 (or keep answering 429 after several polite retries). The link probably works for people, so it is not counted as broken - check it by hand if it matters.

**JavaScript-rendered sites?** Links are read from the HTML the server sends. Links that only appear after JavaScript runs are not seen.

**Why were some links not checked?** The link limit or the run budget was reached, external links were switched off, or robots.txt does not allow them - `SUMMARY` gives the numbers.

**Does it check anchors (#section)?** No - the page is checked, the part after `#` is ignored.

### Support

Missing a check you need? Open an issue on the **Issues** tab - we usually add it fast.

# Actor input Schema

## `urls` (type: `array`):

<b>Crawl the site</b> and <b>XML sitemap</b>: one start URL per site (usually the home page; in sitemap mode a sitemap URL also works). <b>Only these pages</b>: the pages whose links you want checked. <b>Only these links</b>: the URLs to check themselves (up to 10,000).

## `mode` (type: `string`):

What to check: a whole site from its start page, every URL listed in the site's XML sitemap, the links on the pages you list, or just the URLs you list.

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

Crawl mode: how many pages of the site are read to collect links (closest to the start page first). Every crawled page is also one checked link.

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

Upper limit of checked links per site (crawled pages included). Each unique link is checked once, however many pages link to it.

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

Also check links to other websites (partners, sources, social profiles). Off: only links inside the site are checked.

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

Check <code>\<img></code>, <code>\<script></code> and stylesheet URLs too, not only <code>\<a href></code> links.

## `useSitemap` (type: `boolean`):

Crawl mode: pages listed in the sitemap but not linked from anywhere (orphan pages) are crawled too, after the linked pages.

## `includeQueryUrls` (type: `boolean`):

Follow internal links like <code>/shop?color=red\&page=2</code> while crawling. Off by default: filter and sort URLs can multiply endlessly. (Such links are still checked.)

## `report` (type: `string`):

Which checked links become rows. The price is the same: you pay per checked link, not per row.

## `onlyChanges` (type: `boolean`):

Schedule the Actor (e.g. daily) with this on: the first run saves every broken link as your baseline, later runs return only links that broke since the last run (<code>new-broken</code>) and links that were fixed or removed (<code>fixed</code>).

## `feedName` (type: `string`):

Monitor mode: keep several independent monitors of the same site apart (e.g. <code>daily</code> and <code>client-report</code>).

## Actor input object example

```json
{
  "urls": [
    "https://basecamp.com/"
  ],
  "mode": "site",
  "maxPagesPerSite": 10,
  "maxLinksPerSite": 150,
  "checkExternalLinks": true,
  "checkResources": false,
  "useSitemap": true,
  "includeQueryUrls": false,
  "report": "problems",
  "onlyChanges": false,
  "feedName": "default"
}
```

# Actor output Schema

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

One row per link: url, finalUrl, result (broken, dns, server_error, client_error, redirect_loop, redirected, blocked, timeout, network_error, robots_disallowed, site_unreachable, ok), isBroken, statusCode, redirects, redirectChain, responseMs, linkType, isInternal, note, sourceCount, sources (page, anchor), changeType, site, input, scrapedAt.

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

Per site: status, pages crawled, sitemap URLs, links found and checked, broken, redirected, blocked, timeouts, links skipped by robots.txt, external links not checked, new-broken and fixed (monitor), and a plain-English note.

# 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 = {
    "urls": [
        "https://basecamp.com/"
    ],
    "maxPagesPerSite": 10,
    "maxLinksPerSite": 150,
    "report": "problems"
};

// Run the Actor and wait for it to finish
const run = await client.actor("promur/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 = {
    "urls": ["https://basecamp.com/"],
    "maxPagesPerSite": 10,
    "maxLinksPerSite": 150,
    "report": "problems",
}

# Run the Actor and wait for it to finish
run = client.actor("promur/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 '{
  "urls": [
    "https://basecamp.com/"
  ],
  "maxPagesPerSite": 10,
  "maxLinksPerSite": 150,
  "report": "problems"
}' |
apify call promur/broken-link-checker --silent --output-dataset

```

## MCP server setup

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