# Broken Link Checker – Crawl a Website for 404s (`quillbit-tools/broken-link-crawler`) Actor

Crawl a website and find every broken link (404, 410, 5xx, DNS errors, timeouts), with the page it was found on and the anchor text. Checks internal and external links. No browser, $1 per 1,000 links checked.

- **URL**: https://apify.com/quillbit-tools/broken-link-crawler.md
- **Developed by:** [Quillbit Tools](https://apify.com/quillbit-tools) (community)
- **Categories:** SEO tools, Developer tools
- **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 – Crawl a Website for 404s

**Broken Link Checker** crawls a website from a start URL, collects every link on every internal page, and checks them all. It returns each **broken link** (404, 410, 5xx, DNS errors, timeouts) together with **the page it was found on** and its **anchor text**, so you know exactly what to fix and where.

Internal pages on the same host are crawled (up to `maxPages`); external links are checked but not crawled. It uses plain HTTP requests (no browser), which keeps it fast and cheap.

### What can you use it for?

#### Find broken links on your website

Run it on your homepage and get a fix list of every dead internal and outbound link.

#### 404 checker for SEO audits

Broken links waste crawl budget and hurt user experience. Schedule a weekly run and catch new 404s early.

#### Check outbound / external links

Find links to other sites that have gone dead, been moved, or no longer resolve.

#### Site migration QA

Crawl the new site after launch and find links still pointing to removed pages.

#### Full link inventory

Turn off `onlyBroken` to export every checked link with its status code.

### How to use it

1. Click **Try for free** (or **Start**).
2. Enter your input (see the example below) and click **Save & Start**.
3. Download results as JSON, CSV, Excel or HTML, or read them via the API.

### Input

- `startUrl` — Homepage or section to start from. Only pages on the same host are crawled.
- `maxPages` — Max internal pages to crawl (default 200).
- `checkExternal` — Also check links to other domains (default on; they are checked, not crawled).
- `onlyBroken` — Output only broken links (default on). Turn off to output every checked link.
- `concurrency` — Parallel requests (default 10, max 50).

Example input:

```json
{
  "startUrl": "https://books.toscrape.com",
  "maxPages": 30,
  "checkExternal": true,
  "onlyBroken": true
}
```

### Output example

Example below: one Wikipedia page (`maxPages: 1`) produced 35 broken outbound links like these.

| link | status | broken | error | foundOn | anchorText |
|---|---|---|---|---|---|
| https://www.wired.com/rawfile/2009/11/geocities | 404 | True |  | https://en.wikipedia.org/wiki/GeoCities | "Ghost Pages: A Wired.com Farewell to GeoCities" |
| https://money.cnn.com/1999/01/28/technology/yahoo_a/ | 503 | True |  | https://en.wikipedia.org/wiki/GeoCities | the original |
| http://yhoo.client.shareholder.com/press/ReleaseDetail.cfm?ReleaseID=173652 |  | True | ENOTFOUND | https://en.wikipedia.org/wiki/GeoCities | the original |

All output fields: `link`, `status`, `broken`, `error`, `foundOn`, `anchorText`, `internal`. If nothing is broken you get a single row with a note such as `No broken links among 453 checked`.

### How much does it cost?

This Actor uses **pay-per-event** pricing. You pay only for results, not for servers or subscriptions:

- **$0.001 per link checked**, which is **$1.00 per 1,000 links**
- plus Apify's standard **Actor start** event of $0.00005 per run (per GB of memory; the default 1 GB memory = one event)

| You process | You pay (approx.) |
|---|---|
| 500 links | $0.50 |
| 1,000 links | $1.00 |
| 10,000 links | $10.00 |

Apify's free plan includes monthly platform credit, which is enough to try this Actor at no cost.

### Run it via API, schedule or AI agents

Run from your own code with the Apify API, JavaScript or Python client, schedule it in Apify Console, connect it to Make, Zapier, n8n or Google Sheets, or let an AI agent call it through the Apify MCP server (`https://mcp.apify.com`).

```bash
curl -X POST "https://api.apify.com/v2/acts/quillbit-tools~broken-link-crawler/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrl": "https://books.toscrape.com", "maxPages": 30, "checkExternal": true, "onlyBroken": true}'
```

### FAQ

**What counts as broken?**
No response (DNS error, connection error, timeout) or an HTTP status of 400 or higher, except 401, 403, 429 and 999, which usually mean "login required" or "bot blocked" rather than a dead page.

**What am I charged for?**
One `link-checked` event per unique link checked (crawled pages included), whether it is broken or not. A 30-page site with 450 links costs about $0.45. Use `maxPages` to cap the cost.

**Does it check images, PDFs or other files?**
It checks `<a href>` links of any type, including PDFs and images that are linked, but it does not crawl into them. `<img src>` and scripts are not checked.

**Does it render JavaScript?**
No. Links must be in the HTML the server returns. Sites that build their navigation purely in JavaScript will show fewer links.

**Can I schedule it?**
Yes. Save it as a task and add a schedule in Apify Console, then get results by email, webhook, Slack or Google Sheets integrations.

### Related tools by Quillbit Tools

- [Bulk URL Status & Redirect Chain Checker](https://apify.com/quillbit-tools/bulk-redirect-status-checker)
- [Sitemap URL Extractor](https://apify.com/quillbit-tools/sitemap-url-extractor)
- [Domain Expiry, DNS & SSL Certificate Checker](https://apify.com/quillbit-tools/domain-expiry-dns-ssl-checker)
- [Website Tech Stack Detector](https://apify.com/quillbit-tools/tech-stack-detector)
- [Webpage to Markdown for LLMs & RAG](https://apify.com/quillbit-tools/webpage-to-markdown)
- [RSS & Atom Feed to JSON Reader](https://apify.com/quillbit-tools/rss-feed-to-json)

Questions or a feature request? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `startUrl` (type: `string`):

The homepage or section to crawl. Only pages on the same host are crawled.

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

Maximum internal pages to crawl.

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

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

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

If off, every checked link is output with its status.

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

How many requests to run in parallel.

## Actor input object example

```json
{
  "startUrl": "https://example.com",
  "maxPages": 200,
  "checkExternal": true,
  "onlyBroken": true,
  "concurrency": 10
}
```

# Actor output Schema

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

All result items in the default dataset.

# 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 = {
    "startUrl": "https://example.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("quillbit-tools/broken-link-crawler").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 = { "startUrl": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("quillbit-tools/broken-link-crawler").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 '{
  "startUrl": "https://example.com"
}' |
apify call quillbit-tools/broken-link-crawler --silent --output-dataset

```

## MCP server setup

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

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/AgSnQAQe4fWbq40eI/builds/EjbCoKxlPQC0UvpsL/openapi.json
