# Broken Link Checker – Website Crawl, Images & Redirects (`rowharbor1988/broken-link-checker`) Actor

Crawl a website or check a list of pages and find broken links, missing images, scripts and stylesheets, redirect chains and slow responses – with the page where each problem appears. Internal and external links, robots.txt aware.

- **URL**: https://apify.com/rowharbor1988/broken-link-checker.md
- **Developed by:** [rowharbor1988](https://apify.com/rowharbor1988) (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.42 / 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.
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 – Website Crawl, Images & Redirects

Find every broken link on your website in minutes. The Actor crawls your pages, collects **every link, image, script, stylesheet, iframe and media file**, checks each unique target once and tells you:

- **what is broken** – 404 / 410, server errors, dead domains, SSL problems, timeouts, redirect loops
- **where it is** – every page that contains the broken link, with the **anchor text**
- **what redirects** – full redirect chain and final URL, so you can update old links
- **what could not be verified** – sites that refuse automated checks (403, 429, LinkedIn's 999) are marked as *blocked* instead of falsely broken – and are **not charged**

A **shareable HTML report** (REPORT) and a JSON summary (SUMMARY) are created for every run.

No browser, no setup – just enter your website.

### Three modes

| Mode | Use it for |
|---|---|
| **Whole website** (default) | Crawl your site (up to *Max pages*) and check all links found |
| **Only these pages** | Check all links on a list of pages – e.g. your top landing pages or a new blog post |
| **Only these URLs** | Check a list of URLs themselves – backlinks, old URLs after a migration, links in a spreadsheet |

### Output – one row per checked link

```json
{
  "status": "broken",
  "url": "https://example.com/old-pricing",
  "reason": "Not found (404)",
  "statusCode": 404,
  "type": "link",
  "isExternal": false,
  "foundOnCount": 3,
  "foundOn": [
    { "page": "https://example.com/", "anchorText": "See pricing" },
    { "page": "https://example.com/blog/launch", "anchorText": "our plans" }
  ],
  "responseMs": 84,
  "checkedWith": "HEAD"
}
```

`status` is one of **broken**, **redirect**, **blocked** (could not be verified) or **ok**. Broken links are listed first. Use *Show in results* to list only problems or only broken links.

**SUMMARY / REPORT:** links checked, broken (internal / external, by type), redirects, blocked, the pages with the most broken links and the list of broken links with their pages.

### How it checks

- Each unique URL is checked once with a fast HEAD request; if the server refuses HEAD or reports an error, the result is confirmed with a normal GET – this avoids false alarms.
- Redirects are followed step by step (max 10) and shown as a chain.
- Polite by default: max 4 parallel requests to your website and 2 to any other site, robots.txt respected for crawling your own pages, clear bot name `BrokenLinkBot`.
- mailto:, tel:, javascript: and #anchor links are ignored.

### Pricing

Pay per link checked – no start fee, no monthly fee. Links marked *blocked* (the target refused automated checks) are **free**. Set *Max links to check* to control the cost of large sites.

### Good to know

- Only what the server sends as HTML is read – links that appear only after JavaScript runs are not found.
- Some sites answer bots differently than browsers. Those links are shown as *blocked*, not as broken.
- No personal data is collected – only link targets, status codes and the visible link text of public pages.

### Support

Found a problem or missing an option? Open an issue on the Actor's Issues tab – I answer quickly.

# Actor input Schema

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

The website to check (e.g. https://example.com) – or pages / URLs, depending on the mode below.

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

Website: follows internal links (and optionally the sitemap) and checks every link it finds. Pages: no crawling, checks all links on the given pages. URLs: checks a list of URLs (e.g. backlinks, old URLs after a migration).

## `output` (type: `string`):

Filters the table only. You pay for every link checked; the full counts are always in the summary.

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

How many pages of your website are read to find links (mode 'Whole website').

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

Upper limit of unique links checked per run – your cost limit.

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

Also check links to other websites.

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

Also check images, scripts, stylesheets, iframes and media files.

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

Finds pages that are not linked anywhere (orphan pages).

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

Treat blog.example.com etc. as part of the website.

## `excludeUrlPatterns` (type: `array`):

Regular expressions, e.g. /cart or ?sort=

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

Clicks away from the start page.

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

Skip pages of your website that robots.txt disallows.

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

Links that do not answer in time are reported as broken (Timeout).

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

At most 4 at a time go to your own website and 2 to any other website.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "mode": "site",
  "output": "all",
  "maxPages": 10,
  "maxLinks": 200,
  "checkExternal": true,
  "checkResources": true,
  "useSitemap": false,
  "includeSubdomains": false,
  "excludeUrlPatterns": [],
  "maxDepth": 20,
  "respectRobotsTxt": true,
  "timeoutSecs": 20,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

No description

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

No description

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

No description

# 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"
        }
    ],
    "maxPages": 10,
    "maxLinks": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("rowharbor1988/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" }],
    "maxPages": 10,
    "maxLinks": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("rowharbor1988/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"
    }
  ],
  "maxPages": 10,
  "maxLinks": 200
}' |
apify call rowharbor1988/broken-link-checker --silent --output-dataset

```

## MCP server setup

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