# Broken Link Checker - Find 404s & Redirects (Crawl or List) (`admirala/broken-link-checker-bulk`) Actor

Broken link checker: crawl a site or check a URL list for 404s, 5xx, timeouts and redirect chains, with the pages and anchor text linking to each URL. $0.00045 per link checked.

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

## Pricing

from $0.30 / 1,000 per unique 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 (Crawl or List)

> ✅ **Tested daily** with its default input (Apify's automated QA plus our own smoke test before every release).

**Broken link checker**: dead links hurt SEO, annoy visitors and make a site look abandoned. Point this Actor at one or more pages and it checks every link on them (optionally crawling the site), or hand it a list of URLs and it checks exactly those. You get **404s, 5xx errors, timeouts and redirect chains** plus the pages that link to each URL, for **$0.00045 per link**.

### Two modes

- **crawl** (default): reads the pages you give it, optionally follows internal links on the same host up to `maxPages` (breadth-first, `robots.txt` respected), and checks every unique link it finds — internal and external.
- **list**: checks only the URLs you supply. Useful for backlink lists, sitemap exports or a CSV of product URLs.

### What you get per link

- `status` (HTTP code) and `broken` (`true` for 4xx/5xx, timeouts, DNS or SSL errors)
- `finalUrl`, number of `redirects` and the full `redirectChain` with the status of each hop
- `linkType`: internal, external or listed
- `foundOn`: up to 10 pages that contain the link, plus the `anchorText`
- `error` text for timeouts, SSL problems, redirect loops and connection failures

Each link is checked once per run, no matter how many pages it appears on. A `HEAD` request is tried first; servers that refuse `HEAD` get a light `GET` instead, so you don't see false 405s.

### Input

| Field | Default | Description |
|---|---|---|
| `startUrls` | – | Pages to scan (crawl mode) or URLs to check (list mode) |
| `mode` | crawl | `crawl` or `list` |
| `maxPages` | 1 | Pages to read per start URL (1 = only the start page) |
| `maxLinks` | 1000 | Hard cap on unique links checked (and charged) per run |
| `checkExternal` | true | Also check links to other domains |
| `includeImages` | false | Also check images, scripts and stylesheets |
| `onlyBroken` | false | Only output broken links |
| `timeoutSecs` | 15 | Per-request timeout |

### Output example

```json
{
  "url": "https://example.org/old-page", "status": 404, "broken": true,
  "finalUrl": "https://example.org/old-page", "redirects": 0, "linkType": "internal",
  "foundOn": ["https://example.org/", "https://example.org/blog"], "anchorText": "Read more"
}
```

The key-value store record `OUTPUT` contains a summary (pages read, links checked, broken count and a list of broken links) — ready for a webhook, Slack or email integration on a schedule.

### Pricing (pay per event)

- **$0.00045 per unique link checked.** Reading the pages themselves is free. `maxLinks` keeps your cost predictable.

### Fair use

Only the pages you supply (and, in crawl mode, pages of the same host allowed by `robots.txt`) are read. Requests are identified with a clear user agent. No personal data is collected — the output contains URLs and status codes only.

### Use with AI agents (MCP)

This Actor can be used as a tool by AI agents (Claude, Cursor, VS Code, other MCP clients) through the official [Apify MCP server](https://docs.apify.com/platform/integrations/mcp):

- Add only this Actor as a tool: `https://mcp.apify.com?tools=admirala/broken-link-checker-bulk` (sign in with OAuth or an Apify API token).
- Or connect `https://mcp.apify.com` and let the agent find it with `search-actors` (e.g. "broken link checker"), read the input schema with `fetch-actor-details` and run it with `call-actor`.

Example input an agent can pass:

```json
{
  "startUrls": [
    "https://books.toscrape.com/"
  ],
  "mode": "crawl",
  "maxPages": 20,
  "onlyBroken": true
}
```

Cost per call: $0.00045 per unique link checked; reading pages is free. `maxLinks` caps cost. Results come back as dataset items (`get-dataset-items`).

### FAQ

**How do I find broken links on my website?**
Put your homepage in `startUrls`, keep `mode: crawl` and raise `maxPages`. Set `onlyBroken: true` to see only problems.

**Can I check a list of URLs for 404 errors?**
Yes, use `mode: list`; each URL gets its status code, final URL and redirect chain.

**Does it respect robots.txt?**
Yes, in crawl mode only pages allowed by robots.txt on the same host are read.

### Related actors

- [SSL Certificate Checker - Bulk Expiry, Chain & TLS](https://apify.com/admirala/ssl-certificate-expiry-checker)
- [Website Uptime Monitor - Status, Response Time & SSL](https://apify.com/admirala/website-uptime-ssl-monitor)
- Domain Expiry Checker - Bulk WHOIS/RDAP Expiration Dates (coming soon to Apify Store)
- [WHOIS Lookup Bulk - Domain RDAP, DNS Records & SSL](https://apify.com/admirala/domain-whois-rdap-dns-lookup)
- SPF, DKIM & DMARC Checker - Bulk Email Deliverability Audit (coming soon to Apify Store)
- Security Headers Checker - Bulk HSTS, CSP Audit (A+ to F) (coming soon to Apify Store)
- [Tech Stack Detector - BuiltWith & Wappalyzer Alternative](https://apify.com/admirala/website-tech-stack-detector)

# Actor input Schema

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

crawl mode: pages whose links are checked (and crawl starting points). list mode: the exact URLs to check. Example: \["https://example.com/"].

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

'crawl' = read the pages (up to maxPages per site) and check every link found; 'list' = check only the URLs you supply.

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

Pages to read per start URL in crawl mode. 1 = only the start page; higher follows internal links breadth-first (robots.txt respected). Reading pages is free.

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

Hard cap on unique links checked (and charged at $0.00045 each) per run, e.g. 1000 = max $0.45.

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

true = also check links to other domains.

## `includeImages` (type: `boolean`):

true = also check images, scripts and stylesheets (img/script src, link rel=stylesheet).

## `onlyBroken` (type: `boolean`):

true = output only links with status >= 400 or a connection error (all links are still checked and charged).

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

Per-request timeout in seconds (3-60).

## Actor input object example

```json
{
  "startUrls": [
    "https://books.toscrape.com/"
  ],
  "mode": "crawl",
  "maxPages": 1,
  "maxLinks": 1000,
  "checkExternal": true,
  "includeImages": false,
  "onlyBroken": false,
  "timeoutSecs": 15
}
```

# Actor output Schema

## `results` (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": [
        "https://books.toscrape.com/"
    ]
};

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

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

```

## MCP server setup

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

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/VJvWXz5ruvUfkjDZD/builds/cWh5pudgK6l6AkmdZ/openapi.json
