# Broken Link Checker & Redirect Auditor (`sonnguyenauctor/broken-link-checker`) Actor

Crawl any website and find broken links (404, 5xx), dead domains, SSL errors, redirect chains, loops and slow links. Every link comes with the page it is on and its anchor text. Pay only per unique link checked.

- **URL**: https://apify.com/sonnguyenauctor/broken-link-checker.md
- **Developed by:** [HONG SON NGUYEN](https://apify.com/sonnguyenauctor) (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.80 / 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

### What does Broken Link Checker do?

**Broken Link Checker & Redirect Auditor** crawls your website and tests every link it finds. In one run you get a list of **broken links (404, 410, 500)**, **dead domains**, **SSL certificate errors**, **timeouts**, **redirect chains**, **redirect loops** and **slow links**. Every problem comes with **the page it is on and its anchor text**, so you can go straight to the page and fix it.

It works on any public website. No login, no API key, no browser extension, and nothing to install.

### Who is it for?

- **SEO specialists and agencies**: run a link audit for a client site in minutes and hand over a clean spreadsheet.
- **Website owners and bloggers**: find old posts that link to pages that no longer exist.
- **Web developers**: check a site after a migration, redesign or URL change, and catch redirect chains before launch.
- **Content and marketing teams**: make sure outbound links to partners, sources and products still work.
- **Online stores**: find product and category links that return 404 after items are removed.

### Why use this broken link checker?

- ✅ **Tells you where to fix each link**: the page it was found on, its anchor text, and up to 5 pages that contain the same link.
- 🔁 **Shows the full redirect chain** for every redirected link, with the status code of each hop (for example `301 → 302 → 200`) and the final URL.
- 🧭 **Clear status for every link**: `OK`, `REDIRECT`, `BROKEN`, `ERROR` or `REDIRECT_LOOP`, plus an `isSlow` flag.
- 💬 **Errors in plain English**: `Domain not found (DNS)`, `SSL certificate expired`, `Connection refused`, `Timeout after 15s`.
- 🎯 **Only problems mode**: get a short to-do list of what needs fixing instead of thousands of OK rows.
- 💸 **Each link is checked and charged once**, even if it appears in the menu or footer of every page.
- 🌍 **Checks outbound links too**, without crawling other websites.
- 📅 **Runs on a schedule**, so you get a fresh report every week or month.

### What can it find?

| Problem | Example | Shown as |
| --- | --- | --- |
| Page not found | `/old-pricing` returns 404 | `BROKEN`, `statusCode: 404` |
| Server error | Page returns 500 or 503 | `BROKEN`, `statusCode: 500` |
| Dead domain | Partner site no longer exists | `ERROR`, `Domain not found (DNS)` |
| SSL problem | Certificate expired or wrong domain | `ERROR`, `SSL certificate expired` |
| Redirect chain | `http` → `https` → `www` → final page | `REDIRECT`, `redirectCount: 3` |
| Redirect loop | Page A redirects to B, B back to A | `REDIRECT_LOOP` |
| Slow link | Response takes over 3 seconds | `isSlow: true` |
| Missing image | `<img>` file returns 404 (optional) | `BROKEN`, `linkType: image` |

### How much does it cost to check broken links?

This Actor uses **pay per event** pricing. You pay **only for unique links checked**. Crawling pages costs nothing extra, and Apify platform usage is already included in the price.

| Website size | Unique links (approx.) | Approximate cost |
| --- | --- | --- |
| Small blog or landing site | 300 | about $0.24 |
| Business website | 1,000 | about $0.80 |
| Large site or online store | 10,000 | about $8 |

The exact price per link is shown on the **Pricing** tab. You can also set a **maximum cost per run** in the run options. When it is reached, the Actor stops cleanly and keeps every result it already found.

New Apify users get free monthly platform credit, which is enough to try this Actor on a small site.

### How to check a website for broken links

1. Click **Try for free**.
2. Paste your website address into **Website URLs**, for example `https://example.com`.
3. Set **Max pages to crawl per site**. Use 50 for a quick check, or 500 to 5,000 for a full audit.
4. Turn on **Only save problem links** if you only want the list of things to fix.
5. Click **Start**. When the run finishes, open the **Link report** view or download the results as **Excel, CSV, JSON, XML or HTML**.

**Tip:** sort the report by `status` or `foundOn` to fix all problems on one page at a time.

### Input

| Field | What it does | Default |
| --- | --- | --- |
| Website URLs | One or more start pages. The crawler stays on the same domain as each URL. | required |
| Max pages to crawl per site | How many pages are opened and scanned for links. | 50 |
| Check links to other websites | Also check outbound links (checked, not crawled). | on |
| Check images | Also check image files (`img src`). | off |
| Only save problem links | Save only broken, error, redirect and slow links. | off |
| Slow link threshold (ms) | Links slower than this are flagged as slow. | 3000 |
| Request timeout (seconds) | How long to wait before a link counts as a timeout. | 15 |
| Max concurrency | How many requests run at the same time. Lower it for small or fragile servers. | 10 |

Example input:

```json
{
  "startUrls": [{ "url": "https://example.com" }],
  "maxPagesPerSite": 500,
  "checkExternalLinks": true,
  "checkImages": true,
  "onlyProblems": true
}
```

### Output

Each checked link is one row in the dataset. Example of a broken link:

```json
{
  "status": "BROKEN",
  "statusCode": 404,
  "url": "https://example.com/old-pricing",
  "foundOn": "https://example.com/blog/launch",
  "anchorText": "see our pricing",
  "foundOnPages": ["https://example.com/blog/launch", "https://example.com/faq"],
  "occurrences": 3,
  "linkType": "link",
  "isExternal": false,
  "redirectCount": 0,
  "redirectChain": [],
  "finalUrl": "https://example.com/old-pricing",
  "responseTimeMs": 182,
  "isSlow": false,
  "error": null,
  "checkedAt": "2026-11-16T10:00:00.000Z"
}
```

Example of a redirect chain:

```json
{
  "status": "REDIRECT",
  "statusCode": 200,
  "url": "http://example.com/docs",
  "redirectCount": 2,
  "redirectChain": [
    { "url": "http://example.com/docs", "statusCode": 301 },
    { "url": "https://example.com/docs", "statusCode": 301 }
  ],
  "finalUrl": "https://www.example.com/docs/"
}
```

A summary of the whole run is saved in the default key-value store under the key `SUMMARY`:

```json
{ "checked": 949, "OK": 736, "REDIRECT": 202, "BROKEN": 11, "ERROR": 0, "REDIRECT_LOOP": 0, "slow": 24 }
```

### Integrations and API

- **Schedules**: check your site every week from **Schedules** in Apify Console.
- **Google Sheets, Slack, email, Zapier, Make, n8n**: send the report or an alert to your tools when a run finishes, from the **Integrations** tab.
- **Webhooks**: call your own endpoint when a run succeeds or fails.
- **API**: start runs and download results from your own code with the [Apify API](https://docs.apify.com/api/v2) or the `apify-client` package for JavaScript and Python.
- **AI agents**: use this Actor from Claude, ChatGPT, Cursor and other assistants through the [Apify MCP server](https://mcp.apify.com), for example: "check my website for broken links and list the pages I need to fix".

JavaScript example:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('sonnguyenauctor/broken-link-checker').call({
    startUrls: [{ url: 'https://example.com' }],
    maxPagesPerSite: 200,
    onlyProblems: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Limitations

- **JavaScript-rendered links are not found.** The Actor reads the HTML your server sends, which is fast and cheap. Links that only appear after JavaScript runs are skipped.
- **Some sites block automated checks.** Large platforms (LinkedIn, Instagram, X, Amazon) often answer with `403`, `429` or `999` even when the link works in a browser. Check these by hand before you remove them.
- **Login-protected pages are not checked.** Only public pages are crawled.
- **One domain per start URL.** Subdomains count as other websites: add them as extra start URLs if you want them crawled.

### FAQ

**Is this a free broken link checker?**
New Apify accounts get free monthly credit, so you can check a small site for free. After that you pay only per unique link checked.

**How is this different from a 404 checker browser extension?**
Extensions check one page at a time. This Actor crawls the whole site, checks every link once, shows the full redirect chain and where each link appears, and can run on a schedule.

**Does it follow links to other websites?**
It checks them, but does not crawl them, so the run stays on your site.

**Will it slow down my website?**
It runs 10 requests at a time by default. Lower **Max concurrency** for small or shared hosting.

**Is it legal to use?**
The Actor only requests public pages, like a browser. Use it on websites you own or have permission to audit.

**I found a bug or need a feature.**
Open an issue on the **Issues** tab and include the run link. Feature requests are welcome.

# Actor input Schema

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

One or more pages to start from. The crawler stays on the same domain as each start URL.

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

How many pages of the site to open and scan for links. Each link found on those pages is checked once.

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

Also check links that point to other domains (they are checked, not crawled).

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

Also check image sources (img src).

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

Save only broken, error, redirect-chain and slow links. Turn off to save every checked link.

## `slowThresholdMs` (type: `integer`):

Links that take longer than this to respond are flagged as slow.

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

How long to wait for each link before marking it as a timeout.

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

How many requests run at the same time. Keep it low for small sites.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxPagesPerSite": 5,
  "checkExternalLinks": true,
  "checkImages": false,
  "onlyProblems": false,
  "slowThresholdMs": 3000,
  "requestTimeoutSecs": 15,
  "maxConcurrency": 10
}
```

# Actor output Schema

## `linkReport` (type: `string`):

One row per unique link checked, with status, status code, the page it was found on, redirects and response time.

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

Totals for the run: links checked, OK, redirects, broken, errors, redirect loops, slow links and pages scanned.

# 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": [
        {
            "url": "https://crawlee.dev"
        }
    ],
    "maxPagesPerSite": 5
};

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

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

```

## MCP server setup

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