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

Crawl your website and find every broken link (404, 410, 5xx, timeouts, DNS errors), internal and external, plus redirect chains, with the pages and anchor text that link to them. Respects robots.txt. Fast, no browser.

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

## Pricing

Pay per event

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

**Crawl your website and find every broken link**, internal and external, in one run: 404 and 410 pages, 5xx server errors, timeouts, DNS failures, SSL errors and redirect loops. For each problem you get the **exact pages that link to it and the anchor text**, so fixing it takes seconds. Redirected links are reported with their **full redirect chain**.

- ✅ **Internal + external links:** crawls your site (same domain, with or without www) and checks every link it finds, including links to other websites
- ✅ **Where to fix it:** every broken link lists the pages it appears on with the link text
- ✅ **Redirect chains:** see `http → https → /new-path` hops that slow pages down and leak SEO value
- ✅ **Accurate:** HEAD request first, then a real GET when a server mishandles HEAD, so you don't get false alarms
- ✅ **Polite:** respects robots.txt (including crawl delay), never crawls other sites
- ✅ **Fast and light:** plain HTTP, no browser. 50 pages and hundreds of links usually take under 30 seconds.
- ✅ **Pay mainly for problems found:** a tiny fee per page crawled, and a fee per broken link. Redirects and OK links are free.

### What can you use it for?

- **SEO audits:** broken links hurt rankings and waste crawl budget. Find and fix them before Google does.
- **Website maintenance:** schedule a weekly check of your site and get a Slack or email alert when something breaks.
- **Migrations and redesigns:** after moving to a new CMS or URL structure, find every link that still points to old pages, and every redirect chain.
- **Agencies:** run it on client sites and export a CSV of exactly what to fix and where.
- **Content teams and documentation sites:** catch dead links to external sources, tools and references.

### How to use it

1. Enter your **start URL**, usually your homepage.
2. Set **max pages** (default 50, up to 2,000) and choose whether to **check external links**.
3. Click **Start**. The dataset lists one row per broken, blocked or redirected link. Download it as CSV, Excel or JSON, or connect it to Slack, email, Zapier, Make or Google Sheets.

### Input example

```json
{
  "startUrl": "https://www.example.com/",
  "maxPages": 200,
  "checkExternal": true,
  "reportRedirects": true,
  "maxConcurrency": 5,
  "timeoutSecs": 15
}
```

### Output example

A broken link:

```json
{
  "link": "https://crawler-test.com/links/not_found/foo1",
  "result": "broken",
  "linkType": "internal",
  "status": 404,
  "error": null,
  "finalUrl": null,
  "redirectChain": [],
  "foundOnCount": 1,
  "foundOn": [
    { "page": "https://crawler-test.com/links/broken_links_internal", "anchorText": "Broken Internal Link 1" }
  ],
  "checkedAt": "2026-11-22T13:27:51.499Z"
}
```

A redirected link:

```json
{
  "link": "http://peric.github.io/GetCountries/",
  "result": "redirect",
  "linkType": "external",
  "status": 200,
  "finalUrl": "https://peric.github.io/GetCountries/",
  "redirectChain": [{ "url": "http://peric.github.io/GetCountries/", "status": 301 }],
  "foundOnCount": 1,
  "foundOn": [{ "page": "https://www.scrapethissite.com/pages/simple/", "anchorText": "http://peric.github.io/GetCountries/" }]
}
```

**`result` values:** `broken` (4xx/5xx, `timeout`, `dns-error`, `connection-refused`, `connection-reset`, `ssl-error`, `redirect-loop`, `too-many-redirects`), `redirect` (works, but through one or more redirects), `blocked` (an external site answered 401/403/429/999, which usually means it blocks automated checks, not that the link is dead; check it in a browser).

The `SUMMARY` record in the run's key-value store has the totals:

```json
{
  "startUrl": "https://www.scrapethissite.com/",
  "pagesCrawled": 35,
  "uniqueLinks": 41,
  "linksChecked": 39,
  "okLinks": 36,
  "brokenLinks": 2,
  "redirectedLinks": 1,
  "blockedLinks": 0,
  "byStatus": { "400": 2, "redirect 301": 1 },
  "skippedByRobotsTxt": 2,
  "durationSecs": 1.1
}
```

### Pricing (pay per event)

| Event | Price |
|---|---|
| `page-crawled`: each page of your site that is crawled | **$0.0005** ($0.50 per 1,000 pages) |
| `broken-link`: each broken link reported | **$0.002** |

Redirected, blocked and working links are **free**. Example: a 200-page site with 12 broken links costs 200 × $0.0005 + 12 × $0.002 = **$0.124**. Set **Max cost per run** in the run options; the Actor stops crawling cleanly at that limit.

### FAQ

**Does it crawl other websites?** No. Only pages on your start URL's domain (with or without `www`) are crawled. Links to other sites are checked with a single request each, and only when **Check external links** is on.

**Does it respect robots.txt?** Yes. Pages disallowed for crawlers are neither crawled nor checked, and a crawl delay is honored (up to 10 seconds). The number of skipped links is in the summary.

**Why is a link "blocked" instead of "broken"?** Big sites such as LinkedIn, Instagram or Amazon often refuse automated requests with 403, 429 or 999 even though the page exists. We report these separately so they don't drown out real problems, and we don't charge for them.

**Does it check images, scripts or CSS?** It checks `<a href>` links, which is what visitors and search engines follow. Links that point to files (PDFs, images, downloads) are checked too.

**Can it check JavaScript-rendered links?** No, it reads the HTML the server sends, without a browser. Most CMS, ecommerce and documentation sites put their links in that HTML.

**Is this legal?** It visits public pages of the site you choose, like any search engine, follows robots.txt, and collects no personal data. Use it on sites you own or are allowed to audit.

**Can I schedule it?** Yes. Create a schedule (e.g. weekly) and add a Slack or email integration that fires when a run finishes.

### Limits

- Up to 2,000 pages per run (links on those pages are all checked, however many).
- Each link lists up to 50 pages that contain it; `foundOnCount` has the full number.
- Pages behind logins, and sites that block crawlers with CAPTCHA pages, can't be checked.

### Support

Found a bug or need a feature (sitemaps, image checks)? Open an issue on the **Issues** tab. We usually reply within a day.

*Built and maintained by Daily Pals Labs.*

# Actor input Schema

## `startUrl` (type: `string`):

The page to start from, usually your homepage, e.g. https://example.com. Only pages on the same site (same domain, with or without www) are crawled.

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

Stop crawling after this many pages of your site (1-2000). Links found on those pages are all checked.

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

Also check links that point to other websites. Pages on other websites are never crawled, only checked.

## `reportRedirects` (type: `boolean`):

Add rows for links that work but redirect (301/302/307/308), with the full redirect chain. Free: only broken links are charged.

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

How many requests run at the same time. Lower it for small servers. A crawl delay in robots.txt always wins.

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

A link that doesn't answer within this time is reported as broken with error "timeout".

## Actor input object example

```json
{
  "startUrl": "https://www.scrapethissite.com/",
  "maxPages": 50,
  "checkExternal": true,
  "reportRedirects": true,
  "maxConcurrency": 5,
  "timeoutSecs": 15
}
```

# Actor output Schema

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

Broken links and redirects as a dataset (JSON, CSV, Excel via the API).

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

Counts, failures and settings for this run.

# 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 = {
    "startUrl": "https://www.scrapethissite.com/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dailypalslab/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 = { "startUrl": "https://www.scrapethissite.com/" }

# Run the Actor and wait for it to finish
run = client.actor("dailypalslab/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 '{
  "startUrl": "https://www.scrapethissite.com/"
}' |
apify call dailypalslab/broken-link-checker --silent --output-dataset

```

## MCP server setup

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