# Broken Link Checker – Broken vs Blocked (robots.txt-aware) (`quietlinklab/broken-link-checker-blocked-vs-broken`) Actor

Crawl a site, sitemap or URL list and report broken links, redirect chains and soft 404s – while separating real dead links from bot-protection (WAF/403/429) false alarms.

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

## Pricing

from $1.00 / 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

## Broken Link Checker – broken vs. blocked (robots.txt-aware)

Find dead links, long redirect chains and soft 404s on your website – **without the false alarms**.
Most link checkers report every `403`, `429` or bot-challenge page as "broken". This Actor tells you
which links are really **broken** and which ones are only **blocked** for bots (Cloudflare-style challenges,
rate limits, LinkedIn-style `999`), so you do not waste hours fixing links that work fine in a browser.

### What you get

For every unique link you get one dataset row:

| Field | Meaning |
|---|---|
| `url`, `linkType` | The checked URL and whether it is `internal` or `external` |
| `verdict` | `ok` · `redirect` · `broken` · `blocked` · `unverified` · `skipped` |
| `category` | Precise reason, e.g. `NOT_FOUND_404`, `SOFT_404`, `REDIRECT_CHAIN_LONG`, `BLOCKED_BY_BOT_PROTECTION`, `DNS_ERROR`, `TLS_ERROR`, `TIMEOUT`, `REDIRECT_LOOP`, `SKIPPED_ROBOTS_TXT` |
| `httpStatus`, `finalUrl`, `redirectHops`, `redirectChain` | Full redirect chain with a status code for every hop |
| `foundOn`, `foundOnCount`, `anchorText` | Where the link appears (first 5 pages) and its anchor text |
| `responseTimeMs`, `detail`, `checkedAt` | Timing and a human-readable explanation |

A run summary (`OUTPUT` in the key-value store) counts links per verdict and category.

#### Verdicts explained

- **broken** – 404/410, other 4xx/5xx, DNS failure, refused connection, TLS error, redirect loop, soft 404.
- **blocked** – the server answered with a bot-protection wall or a rate limit (`429`, `999`, `403`/`503` with a Cloudflare/Akamai/Sucuri/DataDome-style signature or challenge page). The link is **not proven dead**.
- **unverified** – cannot decide (timeout, plain `403`, `401` login wall). Check manually.
- **redirect** – works, but goes through one or more redirects (long chains are flagged).
- **skipped** – disallowed by `robots.txt`; the URL was **not requested** and is **not billed**.

### Modes

- `crawl` – start from one or more pages and follow internal links (depth and page limits).
- `sitemap` – read `<loc>` entries from a `sitemap.xml` and check the links on those pages.
- `urls` – just test the URLs you provide (no crawling).

### Responsible use

- Only check sites you own or are allowed to audit. You are responsible for compliance with the target sites' terms.
- The Actor identifies itself with a clear `User-Agent`, **respects `robots.txt` by default**, limits requests per host
  (default 2 requests/second/host) and never logs in, never solves captchas and never tries to bypass bot protection –
  that is why protected links are reported as `blocked` instead.
- Requests to private/loopback network addresses are refused.

### Input example

```json
{
  "startUrls": [{ "url": "https://example.com/" }],
  "mode": "crawl",
  "maxPages": 50,
  "maxDepth": 2,
  "maxLinks": 500,
  "checkExternal": true
}
```

### Output example (excerpt)

```json
{
  "url": "https://example.com/this-page-does-not-exist",
  "linkType": "external",
  "verdict": "broken",
  "category": "NOT_FOUND_404",
  "httpStatus": 404,
  "redirectHops": 0,
  "foundOn": ["https://example.com/"],
  "anchorText": "Old pricing page"
}
```

```json
{
  "url": "https://shop.example.net/members-area",
  "verdict": "blocked",
  "category": "BLOCKED_BY_BOT_PROTECTION",
  "httpStatus": 403,
  "detail": "Server answered with a bot-protection / rate-limit response; the link may work in a normal browser."
}
```

### Pricing (pay per event)

You pay per **checked link** (one dataset row), plus the small standard Actor-start event. Links skipped because of
`robots.txt` are free. Use `maxLinks` as a hard budget cap: the run stops as soon as your spending limit is reached.

### Limits and honest notes

- HTML is parsed from the server response; links created only by JavaScript in the browser are not seen.
- "Blocked" detection is heuristic. A site can still be reachable for humans while returning an error to bots, and vice versa.
- Soft-404 detection looks at the page title of crawled pages only.

# Actor input Schema

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

Pages (crawl mode), a sitemap URL (sitemap mode) or the exact URLs to test (urls mode). Only public http(s) URLs of sites you are allowed to check.

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

crawl: follow internal links from the start URLs. sitemap: read <loc> entries from a sitemap.xml and check links on those pages. urls: only test the given URLs (no crawling).

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

Upper limit of HTML pages fetched (crawl/sitemap modes).

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

0 = only the start pages.

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

Hard cap on checked links = hard cap on cost (each checked link is one billed event).

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

Also test links that point to other hosts (only their status; they are never crawled).

## `includeAssets` (type: `boolean`):

Also test img/script/link tags, not only <a> links.

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

Do not request URLs disallowed for this crawler. Disallowed links are reported as skipped and are not billed.

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

Give up on a single request after this many seconds (a timeout is reported as "unverified", not as broken).

## `concurrency` (type: `integer`):

How many requests run in parallel in total (per-host politeness limit still applies).

## `requestsPerSecondPerHost` (type: `number`):

Politeness limit for every single host.

## `userAgent` (type: `string`):

Leave empty to use the default identifying user agent.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com"
    }
  ],
  "mode": "crawl",
  "maxPages": 50,
  "maxDepth": 2,
  "maxLinks": 500,
  "checkExternal": true,
  "includeAssets": false,
  "respectRobotsTxt": true,
  "timeoutSecs": 15,
  "concurrency": 5,
  "requestsPerSecondPerHost": 2
}
```

# Actor output Schema

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

All checked links in the default dataset.

## `problems` (type: `string`):

Table view of the dataset focused on problem links.

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

// Run the Actor and wait for it to finish
const run = await client.actor("quietlinklab/broken-link-checker-blocked-vs-broken").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://example.com" }] }

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quietlinklab/broken-link-checker-blocked-vs-broken"
        }
    }
}
```

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/YexUkiDEfAmWFqeMm/builds/6Q0rEury9dj48JheH/openapi.json
