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

Crawl your website and find every broken link: 404s, 5xx errors, dead domains, timeouts, SSL errors, redirect chains, broken images and missing #anchors. One row per broken URL with the pages it is on and the anchor text. $0.50 per 1,000 pages + $0.20 per 1,000 links.

- **URL**: https://apify.com/actor-forge/broken-link-checker.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (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.50 / 1,000 page crawleds

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 — Find 404s, Redirects & Dead Links

Crawl your website and find every broken link: 404s, 5xx errors, dead domains, timeouts, SSL errors, redirect chains, broken images and missing #anchors. One row per broken URL with the pages it is on and the anchor text. $0.50 per 1,000 pages + $0.20 per 1,000 links.

**Find every broken link on your website before your visitors (and Google) do.** Give it your site's URL and it crawls your pages (following links and the sitemap, respecting robots.txt) and checks **every link, image and, optionally, script, stylesheet and iframe** on them, including links to other websites. You get **one row per broken URL** with **the pages it appears on (up to 50 listed, with the anchor text) and the total page count**, so a dead link in a site-wide footer is one row "found on 480 pages", not 480 rows. Each row has the HTTP status (404, 410, 500…), the error type (**HTTP error, dead domain/DNS, timeout, SSL certificate, connection refused, redirect loop, malformed URL**), the full **redirect chain** and final URL. Optional modes add **redirects** (so you can update links that bounce through 301s) or every link checked, and **missing #anchors** (links to headings that no longer exist). Links behind bot protection (LinkedIn's 999, Cloudflare challenges, 403/429 from other sites) are reported as **blocked, not broken**, so your report has no false alarms. Use it for SEO audits, website migrations, documentation QA, content maintenance, agency client reports and scheduled monitoring. **$0.50 per 1,000 pages crawled + $0.20 per 1,000 unique links checked**: a 100-page site with 300 unique links (the 100 pages included) costs about $0.11, with no compute bill on top.

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| url | category | status | finalStatus | statusText | errorType | foundOnCount | linkType | isExternal |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| https://playwright.dev/docs/api/environment-variables/ | broken | 404 | 404 | Not Found | http | 2 | a | true |
| https://crawlee.dev/blog/img/lukasp.webp | broken | 404 | 404 | Not Found | http | 1 | img | false |
| http://www.youtube/ | broken |  |  | domain does not resolve (ENOTFOUND) | dns | 1 | a | true |
| https://sdk.apify.com/docs/guides/getting-started | redirect | 301 | 200 | OK |  | 1 | a | true |
| https://www.npmjs.com/package/cheerio | blocked | 403 | 403 | Forbidden | bot-protection | 3 | a | true |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `page-crawled` | $0.0005 | per page of your site crawled and scanned for links | 100 pages = $0.05; a 1,000-page site = $0.50 (each page URL is also one link-checked event) |
| `link-checked` | $0.0002 | per unique link checked (each URL once, however many pages link to it) | 300 unique links (the 100 crawled pages included) = $0.06, so a 100-page site ≈ $0.11 in total |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 1 GB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | array | yes | — | Where to start crawling. The crawl stays on the same site and under each URL's path: https://example.com crawls the whole site, https://example.com/blog only the blog. Every link on the crawled pages is checked, including links to other sites. |
| `maxPages` | integer | no | `500` | Stop crawling after this many pages of your site (links already found are still checked). Each crawled page is one 'page-crawled' event plus one 'link-checked' event (the page URL itself is a checked link). |
| `maxLinks` | integer | no | `10000` | Stop after checking this many unique links (each one is a 'link-checked' event). A safety limit for very link-heavy sites. |
| `maxDepth` | integer | no | `20` | How many clicks away from a start URL to crawl. 0 = scan only the start pages (their links are still checked). |
| `reportMode` | string | no | `"broken"` | Broken: 4xx/5xx, dead domains, timeouts, SSL errors, redirect loops, malformed URLs and missing anchors. Broken + redirects: also links that redirect (with the full chain), so you can update them. All: every link checked, including working ones. Same price whatever you pick. |
| `reportBlocked` | boolean | no | `true` | Some sites refuse automated checks (LinkedIn answers 999, others 403/429 or a Cloudflare challenge). Those links probably work in a browser, so they are reported separately as 'blocked', never as broken. Turn off to hide them. |
| `checkExternalLinks` | boolean | no | `true` | Also check links to other websites (they are only checked, never crawled). |
| `checkImages` | boolean | no | `true` | Check every image (img src) for broken images. |
| `checkResources` | boolean | no | `false` | Also check scripts (script src), stylesheets and icons (link href) and iframes (iframe src). |
| `checkAnchors` | boolean | no | `false` | Report links like /page#section where the crawled page has no element with that id (renamed or removed headings). Free: no extra requests. |
| `includeSubdomains` | boolean | no | `false` | Also crawl subdomains of the start site (e.g. blog.example.com when starting at example.com). Links to subdomains are always checked. |
| `includeGlobs` | array | no | `[]` | Only crawl pages matching one of these, e.g. https://example.com/docs/\*\* (\*\* = anything, \* = anything except /). Replaces the default 'stay under the start path' rule. Links to other pages are still checked. |
| `excludeGlobs` | array | no | `[]` | Never crawl pages matching these, e.g. **/tag/** or **/page/\*. Links to them are still checked. |
| `ignoreLinkGlobs` | array | no | `[]` | Links matching these are neither checked nor reported (and not charged), e.g. https://www.linkedin.com/** or **/cdn-cgi/**. |
| `useSitemap` | boolean | no | `true` | Also crawl pages listed in the site's sitemap.xml (and sitemaps in robots.txt), so orphan pages and broken sitemap entries are found too. |
| `respectRobotsTxt` | boolean | no | `true` | Don't crawl pages that robots.txt disallows (links to them are still checked with a single request). |

### Limits & honest notes

- Pages are fetched as static HTML without a browser: fast and cheap, and it covers almost all websites. Links that exist only after JavaScript runs (single-page apps that render their menus client-side) are not found.
- Some sites refuse automated requests: LinkedIn answers 999, others answer 403 or 429 or show a Cloudflare challenge. Those links usually work in a browser, so they are reported as 'blocked' (status kept) instead of broken. Hide them with 'Report bot-blocked links' or skip them with 'Ignore links matching'.
- Each unique link is checked once with a HEAD request; when a server refuses HEAD or answers a common error status (400, 403, 404, 405, 410, 5xx…) or drops the connection, the result is confirmed with GET before it is called broken. Redirects are followed up to 10 hops, with the full chain recorded. Each request times out after 20 seconds.
- Polite by design: at most 2 requests at a time per host, and a 429 'Too Many Requests' pauses that host for its Retry-After. Very link-heavy external hosts (GitHub, for example) therefore take a while to check.
- Crawling respects robots.txt and stays on your site and under the start URL's path, unless you set include globs. Links to pages robots.txt disallows are still checked with a single request, since checking a link is not crawling. If a site's robots.txt can't be fetched (HTTP 5xx or a network error, after one retry), none of that site's pages are crawled (RFC 9309) and its start URL is reported as skipped, not charged. Login-protected pages are not supported.
- Missing-anchor checks compare #fragments with the ids in the static HTML of crawled pages; anchors added by JavaScript are reported as missing. Results are delivered when the crawl finishes; runs resume after a platform migration without re-charging work already done.
- Links to internal network addresses (localhost, private IPs, cloud metadata) are never requested and never charged.
- Respects your run budget: set a maximum total charge and the run stops cleanly at the cap and reports everything checked so far.

### Related ActorForge actors

- [SEO Audit Crawler](https://apify.com/actor-forge/seo-audit) — full on-page SEO checks for every page
- [Sitemap URL Extractor](https://apify.com/actor-forge/sitemap-extractor)
- [Website Change Monitor](https://apify.com/actor-forge/website-change-monitor)
- [Website to Markdown](https://apify.com/actor-forge/website-to-markdown)

### Changelog

- **2026-10-18** — Initial release: same-site crawling with sitemaps, robots.txt and globs; checks links, images and optionally scripts, stylesheets, icons and iframes; HEAD with GET fallback; redirect chains; DNS/timeout/SSL/connection classification; bot-blocked detection; missing-anchor checks; grouped rows with every page a link appears on; migration-safe resume.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

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

Where to start crawling. The crawl stays on the same site and under each URL's path: https://example.com crawls the whole site, https://example.com/blog only the blog. Every link on the crawled pages is checked, including links to other sites.

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

Stop crawling after this many pages of your site (links already found are still checked). Each crawled page is one 'page-crawled' event plus one 'link-checked' event (the page URL itself is a checked link).

## `maxLinks` (type: `integer`):

Stop after checking this many unique links (each one is a 'link-checked' event). A safety limit for very link-heavy sites.

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

How many clicks away from a start URL to crawl. 0 = scan only the start pages (their links are still checked).

## `reportMode` (type: `string`):

Broken: 4xx/5xx, dead domains, timeouts, SSL errors, redirect loops, malformed URLs and missing anchors. Broken + redirects: also links that redirect (with the full chain), so you can update them. All: every link checked, including working ones. Same price whatever you pick.

## `reportBlocked` (type: `boolean`):

Some sites refuse automated checks (LinkedIn answers 999, others 403/429 or a Cloudflare challenge). Those links probably work in a browser, so they are reported separately as 'blocked', never as broken. Turn off to hide them.

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

Also check links to other websites (they are only checked, never crawled).

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

Check every image (img src) for broken images.

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

Also check scripts (script src), stylesheets and icons (link href) and iframes (iframe src).

## `checkAnchors` (type: `boolean`):

Report links like /page#section where the crawled page has no element with that id (renamed or removed headings). Free: no extra requests.

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

Also crawl subdomains of the start site (e.g. blog.example.com when starting at example.com). Links to subdomains are always checked.

## `includeGlobs` (type: `array`):

Only crawl pages matching one of these, e.g. https://example.com/docs/\*\* (\*\* = anything, \* = anything except /). Replaces the default 'stay under the start path' rule. Links to other pages are still checked.

## `excludeGlobs` (type: `array`):

Never crawl pages matching these, e.g. **/tag/** or \*\*/page/\*. Links to them are still checked.

## `ignoreLinkGlobs` (type: `array`):

Links matching these are neither checked nor reported (and not charged), e.g. https://www.linkedin.com/\*\* or **/cdn-cgi/**.

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

Also crawl pages listed in the site's sitemap.xml (and sitemaps in robots.txt), so orphan pages and broken sitemap entries are found too.

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

Don't crawl pages that robots.txt disallows (links to them are still checked with a single request).

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev/js/docs/quick-start"
  ],
  "maxPages": 500,
  "maxLinks": 10000,
  "maxDepth": 20,
  "reportMode": "broken",
  "reportBlocked": true,
  "checkExternalLinks": true,
  "checkImages": true,
  "checkResources": false,
  "checkAnchors": false,
  "includeSubdomains": false,
  "includeGlobs": [],
  "excludeGlobs": [],
  "ignoreLinkGlobs": [],
  "useSitemap": true,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `results` (type: `string`):

One row per problem link: status, error type, redirect chain, final URL, and every page it appears on with the anchor text.

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

Pages crawled, unique links checked, broken links by error type, redirects, bot-blocked links, and why the run stopped.

# 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/js/docs/quick-start"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/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/js/docs/quick-start"] }

# Run the Actor and wait for it to finish
run = client.actor("actor-forge/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/js/docs/quick-start"
  ]
}' |
apify call actor-forge/broken-link-checker --silent --output-dataset

```

## MCP server setup

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