# Broken Link Checker (`properscraper/broken-link-checker`) Actor

Find the broken links on a website: crawls its pages, checks every link once, internal and external, and reports each dead link with its status and the pages it appears on. Fast, with no browser, and it obeys robots.txt.

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

## Pricing

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

Find the broken links on a website. Give it a start page: it reads the site's pages, checks every link on them once (to the site's own pages and files, and to other websites) and reports each dead link with its status and the pages it appears on.

No browser is used, so a site of a few hundred pages is checked in minutes.

Use it to:

- find 404s, dead domains and server errors before your visitors or search engines do
- check a site after a redesign, a migration or a change of URL structure
- audit outbound links that have rotted over the years
- keep a site healthy by running it on a schedule
- check a client's or a competitor's site without installing anything

### Input

| Field | What it does |
|---|---|
| **Websites** | One per line: the page to start from on each website, such as `example.com` or `https://example.com/blog/`. |
| **Pages per website** | The most pages read on each website. Default 100. Every link on those pages is checked. |
| **Save only broken links** | Off (default): every link checked is saved, with a column saying whether it is broken. On: only broken links are saved, and you are charged only for those. |
| **Check links to other websites** | On by default. Turn off to check only the site's own pages and files. |
| **Stay under the start page's folder** | On: starting at `example.com/blog/` reads only pages under `/blog/`. Links on those pages are still checked wherever they lead. |
| **Obey robots.txt** | On by default: addresses a website asks crawlers to stay away from are neither read nor checked. |

```json
{
    "urls": ["https://example.com/"],
    "maxPagesPerWebsite": 500,
    "onlyBroken": true
}
```

### Output

One record per link, broken links first:

```json
{
    "startUrl": "https://example.com/",
    "link": "https://example.com/pricing-2023",
    "broken": true,
    "result": "client_error",
    "httpStatus": 404,
    "error": null,
    "redirectsTo": null,
    "internal": true,
    "foundOnCount": 3,
    "foundOn": ["https://example.com/", "https://example.com/about", "https://example.com/blog/launch"],
    "scrapedAt": "2026-11-18T12:00:00.000Z"
}
```

- `result` is `ok`, `client_error` (such as 404 or 410), `server_error` (5xx), `unreachable` (nothing answered: a dead domain, a timeout, a refused connection), `blocked` or `redirect`.
- `broken` is `true` for `client_error`, `server_error` and `unreachable`.
- **`blocked` is not counted as broken.** Some sites (social networks especially) answer 401, 403 or 429 to any automated check although the link works in a browser. They are flagged so you can open them yourself.
- `foundOn` lists up to ten pages that contain the link, and `foundOnCount` says how many there are in all, so you know where to fix it.
- `redirectsTo` is filled when the link works but leads somewhere else; updating such links saves your visitors a hop.
- `internal` is `true` for links to the same website.

A `SUMMARY` record in the run's key-value store gives, for each website, the pages read, links checked, broken and blocked links, and links not checked because of robots.txt.

### Pricing

Pay per result. You are charged once for each link saved, at the per-result price shown on this page, however many pages it appears on. With "Save only broken links" on, working links are not saved and cost nothing.

A website whose start page could not be read costs nothing. The run stops as soon as it reaches the maximum charge you set for it.

### Limits

- Links are found in the pages as the server sends them, without running JavaScript. Links that a script adds later, and links in images, buttons or style sheets, are not checked.
- A link is checked with a lightweight request; a server that dislikes that is asked once more in the normal way, so a page is not called broken just because of how it was asked.
- Only the part of the address before `#` is checked; whether an anchor exists on the target page is not.
- Requests to any one site are spaced half a second apart, so a site with thousands of links to itself takes a while.
- Up to 20,000 pages per website.

### Is this allowed?

The Actor behaves like a search engine's crawler: it identifies itself in its User-Agent, obeys robots.txt by default, paces its requests to each site and asks each link only once.

# Actor input Schema

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

One per line: the page to start from on each website, such as example.com or https://example.com/blog/. The checker follows links from there to other pages of the same website.

## `maxPagesPerWebsite` (type: `integer`):

The most pages read on each website. Every link on those pages is checked.

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

Off: every link checked is saved, with a column saying whether it is broken. On: only broken links are saved, and you are charged only for those.

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

Also check links that lead away from the website. Turn off to check only its own pages and files.

## `stayUnderStartPath` (type: `boolean`):

On: starting at example.com/blog/ reads only pages under example.com/blog/. Links on those pages are still checked wherever they lead.

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

Do not read or check addresses a website's robots.txt asks crawlers to stay away from.

## Actor input object example

```json
{
  "urls": [
    "https://crawlee.dev/js/docs/quick-start"
  ],
  "maxPagesPerWebsite": 100,
  "onlyBroken": false,
  "checkExternalLinks": true,
  "stayUnderStartPath": false,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `links` (type: `string`):

One record per link checked.

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

Totals for the run and, for each website, how many results were saved and any error.

# 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 = {
    "urls": [
        "https://crawlee.dev/js/docs/quick-start"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("properscraper/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 = { "urls": ["https://crawlee.dev/js/docs/quick-start"] }

# Run the Actor and wait for it to finish
run = client.actor("properscraper/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 '{
  "urls": [
    "https://crawlee.dev/js/docs/quick-start"
  ]
}' |
apify call properscraper/broken-link-checker --silent --output-dataset

```

## MCP server setup

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