# Broken Link Checker - Find 404s & Dead Links on Any Site (`bluemoonstone/broken-link-checker`) Actor

Returns every broken link on a website (404, 410, 5xx, timeout, DNS error) with the page it appears on and its link text, internal and external. Input: website URLs and a page limit. For SEO and site QA. Priced per page crawled.

- **URL**: https://apify.com/bluemoonstone/broken-link-checker.md
- **Developed by:** [Blue Moon](https://apify.com/bluemoonstone) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 pages crawled

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/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 & Dead Links on Any Site

Crawl a website and find **every broken link** on it: 404 and 410 pages, server errors (5xx), timeouts, DNS failures and dead external links. Each result tells you **which page the broken link is on** and its link text, so you can fix it right away.

### Features

- Crawls the site (same domain) up to your page limit
- Checks internal and external links (and optionally images)
- Smart checking: HEAD first, GET fallback, follows redirects
- One row per broken link with `status`, `error`, `foundOn` pages and `linkText`
- Optionally report all links with their status codes
- Multiple websites per run

### Use cases

- SEO: broken links hurt rankings and crawl budget
- Website QA after a redesign or migration
- Agencies: quick audit reports for clients
- Link-building: find dead external links on other sites to suggest replacements

### Input example

```json
{ "startUrls": ["https://www.example.com"], "maxPagesPerSite": 500, "checkExternalLinks": true }
```

### Output example

```json
{
  "site": "example.com",
  "brokenUrl": "https://www.example.com/old-page",
  "status": 404,
  "error": null,
  "isInternal": true,
  "linkText": "Our old pricing",
  "foundOn": ["https://www.example.com/blog/post-1"],
  "foundOnCount": 1
}
```

Note: 401/403/429 answers are not counted as broken (sites often block bots that way); turn on *Report all links* to see them.

**Pricing: you pay per page crawled.** Checking all the links found on those pages is included.

**Polite by design:** obeys robots.txt and sends at most about 1 request per second to each host, so large sites take a while.

### How much does it cost?

$1 per 1,000 pages crawled ($0.001 per page); checking all links on those pages is included. Example: a 500-page site costs about $0.50. Apify's free plan includes monthly platform credit, enough to try it at no cost.

### How to use it

1. Click **Try for free** (an Apify account is free).
2. Fill in the input, or paste the JSON example below.
3. Click **Start** and wait for the run to finish.
4. Download the results as JSON, CSV, Excel or HTML, or get them by API, webhook or an integration (Google Sheets, Zapier, Make, n8n, Slack).

### Run it by API

Run the Actor and get the results in one call:

```bash
curl -X POST 'https://api.apify.com/v2/acts/bluemoonstone~broken-link-checker/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"startUrls": ["https://example.com"], "maxPagesPerSite": 500, "checkExternalLinks": true}'
```

Or use the official [JavaScript](https://docs.apify.com/api/client/js/) and [Python](https://docs.apify.com/api/client/python/) clients.

### Use it from AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor, VS Code and other MCP clients through the [Apify MCP server](https://mcp.apify.com/). Add this server URL to your client:

```
https://mcp.apify.com?tools=bluemoonstone/broken-link-checker
```

Then ask, for example: *"Crawl my website example.com and list every broken link with the page it appears on."*

It also works with LangChain, LlamaIndex, CrewAI and the OpenAI Agents SDK through the Apify integrations.

### FAQ

**Which errors are reported?**

404, 410, other 4xx and 5xx responses, timeouts and DNS errors, for internal and (optionally) external links and images.

**Will it overload my site?**

No. It respects robots.txt and limits itself to about one request per second per host.

**Can I run it every week?**

Yes. Add a Schedule in Apify Console and get results by email, Slack, Google Sheets or webhook.

**Something not working, or need a feature?**

Open an issue in the **Issues** tab. Feature requests are welcome and shape what gets built next.

### Related tools by the same developer

- [Greenhouse, Lever & Ashby Jobs Scraper - Company Careers](https://apify.com/bluemoonstone/ats-jobs-scraper)
- [Website Technology Detector - Tech Stack Lookup in Bulk](https://apify.com/bluemoonstone/tech-stack-detector)
- [Sitemap URL Extractor - All Pages of Any Website](https://apify.com/bluemoonstone/sitemap-url-extractor)
- [SEO Audit Tool - Bulk On-Page SEO Checker for Any URL](https://apify.com/bluemoonstone/seo-page-audit)
- [Website Screenshot & PDF API - Bulk URL to PNG, JPEG or PDF](https://apify.com/bluemoonstone/website-screenshot-pdf)
- [PDF Text Extractor - Bulk PDF URLs to Text, Pages & Metadata](https://apify.com/bluemoonstone/pdf-text-extractor)

### Responsible use

- This Actor reads **publicly available** pages and data only. It never logs in and does not bypass CAPTCHAs or other access controls.
- You must have the right to access each target and must follow its terms of service and all applicable laws (including privacy and data-protection laws such as GDPR).
- It is not designed to collect personal data. Do not use it to build lists of people.
- Not affiliated with, endorsed by or sponsored by any company, website or brand named here; names are used only to describe compatibility.

# Actor input Schema

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

Start pages (usually the homepage). The crawler stays on the same domain.

## `maxPagesPerSite` (type: `integer`):

How many pages of the site are crawled to collect links.

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

Also check links pointing to other websites.

## `checkImages` (type: `boolean`):

Also check <img> sources.

## `reportAllLinks` (type: `boolean`):

Output every checked link with its status, not just the broken ones.

## `useProxy` (type: `boolean`):

Turn on if the site blocks the crawler.

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com"
  ],
  "maxPagesPerSite": 200,
  "checkExternalLinks": true,
  "checkImages": false,
  "reportAllLinks": false,
  "useProxy": false
}
```

# Actor output Schema

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

Dataset items.

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

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

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

```

## MCP server setup

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