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

Crawl a website and check every link, image, script and stylesheet, or check a bulk list of URLs. Finds 404s, server errors, dead domains, SSL errors, redirect chains and loops, shows on which pages each broken link appears and its anchor text.

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

## Pricing

from $0.35 / 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: Find 404s, Redirects & Dead Links

Crawl your website and check **every link, image, script and stylesheet** in one run, or paste a **bulk list of URLs** to check their status. You get each broken link with the **pages it appears on** and its **anchor text**, so you know exactly what to fix.

- ✅ **Finds everything that breaks**: 404 and 410 pages, server errors (5xx), dead domains, expired or wrong SSL certificates, timeouts, redirect loops
- ✅ **Full redirect chains** with every hop and status code (301, 302, 307, 308), plus the final URL
- ✅ **Where to fix it**: up to 5 pages each link was found on, how often it was found, its anchor text and the tag (`a`, `img`, `script`, `link`, `iframe` …)
- ✅ **Fewer false alarms**: servers that reject `HEAD` are re-checked with `GET`; sites that block checkers (401, 403, 429, LinkedIn's 999) are marked `blocked` instead of `broken`
- ✅ **Fast and light**: plain HTTP requests, no browser. In our test 437 links on 60 pages took 6 seconds
- ✅ **Polite**: at most 3 parallel requests per host, robots.txt respected
- ✅ **Fair billing**: you pay per checked link; links skipped by robots.txt are free

### Results

Each checked URL gets a `category`:

| Category | Meaning |
|---|---|
| `ok` | Answers 2xx directly |
| `redirected` | Works, but only through redirects (update the link to `finalUrl`) |
| `broken` | 4xx or 5xx answer, or the domain does not exist |
| `blocked` | The server refuses automated checks (401, 403, 407, 429, 451, 999); check it in a browser |
| `error` | Timeout, SSL problem, redirect loop or connection failure (see `error`) |
| `skipped` | robots.txt forbids checking it (not billed) |

### Input example

```json
{
    "startUrls": ["https://crawler-test.com/"],
    "maxPages": 60,
    "urls": ["http://github.com", "https://expired.badssl.com/"],
    "checkExternalLinks": true,
    "checkResources": true,
    "onlyProblems": false
}
```

Use `startUrls` to crawl a site (www and non-www count as one site), `urls` to check a list without crawling, or both.

### Output example

Real output from a test run:

```json
{
    "url": "https://crawler-test.com/redirects/redirect_2",
    "category": "redirected",
    "status": 200,
    "ok": true,
    "finalUrl": "https://crawler-test.com/redirects/redirect_target",
    "redirectChain": [
        { "url": "https://crawler-test.com/redirects/redirect_2", "status": 301 },
        { "url": "https://crawler-test.com/redirects/redirect_1", "status": 301 }
    ],
    "type": "internal",
    "tags": ["a"],
    "anchorText": "Redirect Double 301",
    "foundOn": ["https://crawler-test.com/"],
    "foundOnCount": 1,
    "contentType": "text/html",
    "responseTimeMs": 35,
    "crawled": false,
    "error": null
}
```

From the same run's bulk list:

| url | category | error |
|---|---|---|
| `https://this-domain-does-not-exist-4711.com/` | broken | Domain does not exist (DNS lookup failed) |
| `https://expired.badssl.com/` | error | SSL certificate has expired |
| `http://github.com/` | redirected | (final URL `https://github.com/`) |

The `OUTPUT` record in the key-value store holds the totals, for example `{"linksChecked": 437, "pagesCrawled": 60, "counts": {"ok": 349, "broken": 63, "redirected": 15, "blocked": 4, "error": 6, "skipped": 21}}`.

### Pricing

A fixed price per checked link (every unique URL is checked once, however often it appears). Turn on **Only save problems** to get a short fix list; all checked links are still counted.

Paid Apify plans pay less: 10% off on Starter, 20% on Scale and 30% on Business and higher plans.

### FAQ

**Why is a link `blocked` and not `broken`?** Some sites (LinkedIn, Instagram, many shops behind bot protection) refuse requests that are not from a browser. The link may work for people, so it is listed separately for a manual check.

**Are links on pages beyond `maxPages` checked?** Links are collected only from crawled pages, but every link found there is checked, including internal pages that were not crawled any more.

**Can I check a site that blocks crawlers in robots.txt?** Only if it is your own site or you have the owner's permission: then turn off **Respect robots.txt**.

**Does it run JavaScript?** No. It reads the HTML the server sends, which covers almost all links. Links that only appear after JavaScript runs are not found.

### More tools from Tidelane Data

- [Sitemap Extractor](https://apify.com/tidelane/sitemap-extractor): all URLs of a website from its sitemaps, with lastmod
- [SEO Audit](https://apify.com/tidelane/seo-audit): on-page SEO checks for any list of URLs
- [Wayback Machine Scraper](https://apify.com/tidelane/wayback-machine): snapshots, archived URLs and site history
- [Lighthouse Audit](https://apify.com/tidelane/lighthouse-audit): bulk PageSpeed, Core Web Vitals and SEO scores

All our tools: [apify.com/tidelane](https://apify.com/tidelane)

***

#### Impressum

Levi Griesinger, Tidelane Data\
Besigheimer Straße 18\
74369, Löchgau, Deutschland\
E-Mail: LeviGriesinger@gmail.com

# Actor input Schema

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

Start pages. The Actor follows links on the same website (www and non-www count as one) and checks every link it finds.

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

Optional list of links that are checked once each, without crawling. Use this for a bulk status / redirect check.

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

How many pages are opened in total (all start URLs together) to find links. Links on further pages are not collected, but every found link is still checked.

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

Also check links to other websites.

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

Also check <img>, <script>, \<link rel=stylesheet/icon>, <iframe>, <video> and <audio> sources.

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

Save only broken, redirected, blocked and failing links. All checked links are still counted and billed.

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

Skip (and don't bill) URLs that robots.txt forbids. Turn off only for your own sites.

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

Requests in parallel overall. At most 3 run against the same host at a time.

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

How long to wait for one server answer before the link counts as failing.

## Actor input object example

```json
{
  "startUrls": [
    "https://crawler-test.com/"
  ],
  "maxPages": 200,
  "checkExternalLinks": true,
  "checkResources": true,
  "onlyProblems": false,
  "respectRobotsTxt": true,
  "maxConcurrency": 10,
  "timeoutSecs": 20
}
```

# Actor output Schema

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

All results of the run as dataset items.

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

Summary per input with status (ok, error and the reason).

# 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://crawler-test.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidelane/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://crawler-test.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("tidelane/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://crawler-test.com/"
  ]
}' |
apify call tidelane/broken-link-checker --silent --output-dataset

```

## MCP server setup

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