# Broken Link Checker – Website Dead Link Finder (`nordic-data/broken-link-checker`) Actor

Crawl a website and check every internal and external link (and optionally images) for 404s, 5xx errors, timeouts and redirects. Shows the pages each broken link was found on. $0.0009 per link.

- **URL**: https://apify.com/nordic-data/broken-link-checker.md
- **Developed by:** [Niklas Bergström](https://apify.com/nordic-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.90 / 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 – Website Dead Link Finder

Find **broken links on any website**. The Actor crawls the site's internal pages from your start URL, collects every link (and optionally every image), checks each unique target once, and tells you which ones return **404, 410, 5xx, DNS or timeout errors** — and on which pages they appear, with the anchor text, so you can fix them fast.

**$0.0009 per link checked.** Crawling pages is free; you only pay for unique links checked, and `maxLinksToCheck` caps the cost of every run.

### What you get

| Field | Meaning |
|---|---|
| `url`, `statusCode`, `error` | The link and its result (`error` for DNS, TLS or timeout failures) |
| `isBroken` | 4xx/5xx or no response (excluding 401/403/429, which are flagged separately) |
| `isBlockedOrAuth` | The target exists but blocks bots or needs a login (401, 403, 429, 999) |
| `redirected`, `redirectCount`, `finalUrl` | Where redirects lead — useful for cleaning up old internal links |
| `linkType`, `elementType` | `internal` / `external`, `link` / `image` / `page` |
| `anchorText`, `foundOn`, `foundOnCount` | Link text and up to 10 pages that contain the link |

Filter by `isBroken = true` in the dataset, or export to CSV/Excel.

### Use cases

- **SEO maintenance:** find and fix dead internal links and outbound links that waste crawl budget.
- **Site migrations and redesigns:** catch links still pointing at old URLs or redirect chains.
- **Content and docs QA:** check documentation, help centers and blogs before a release.
- **Agency reporting:** scheduled monthly broken-link reports for client sites.

### Input example

```json
{
  "startUrls": ["https://crawlee.dev/"],
  "maxPagesToCrawl": 30,
  "maxLinksToCheck": 500,
  "checkExternalLinks": true,
  "checkImages": false,
  "includeSubdomains": false,
  "maxConcurrency": 10
}
```

### Output example

```json
{
  "recordType": "link",
  "url": "https://example.com/old-pricing",
  "statusCode": 404,
  "isBroken": true,
  "isBlockedOrAuth": false,
  "error": null,
  "finalUrl": "https://example.com/old-pricing",
  "redirected": false,
  "linkType": "internal",
  "elementType": "link",
  "anchorText": "See pricing",
  "foundOn": ["https://example.com/", "https://example.com/blog/launch"],
  "foundOnCount": 2,
  "checkedAt": "2026-11-12T06:45:00Z"
}
```

### How it works

1. Breadth-first crawl of internal HTML pages (same host; subdomains optional), up to `maxPagesToCrawl`. `rel=nofollow` links and file downloads are checked but not crawled.
2. Every unique link is checked with a HEAD request, falling back to GET when servers reject HEAD. Redirects are followed.
3. Each result lists the pages where the link was found.

Plain HTTP only (no browser), so links injected purely by JavaScript are not seen. Only public pages are requested.

### Related Actors

- [Bulk URL Status & Redirect Chain Checker](https://apify.com/nordic-data/bulk-url-status-redirect-checker): check your own list of URLs.
- [Website SEO Audit](https://apify.com/nordic-data/website-seo-audit)
- [Link Preview & Open Graph Extractor](https://apify.com/nordic-data/link-preview-extractor)

# Changelog

This Actor's version history is a separate document: https://apify.com/nordic-data/broken-link-checker/changelog.md

# Actor input Schema

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

Homepages or section URLs. The Actor crawls internal pages from here and checks every link it finds.

## `maxPagesToCrawl` (type: `integer`):

How many internal HTML pages to scan for links, per run (1-2000). Crawled pages are not charged.

## `maxLinksToCheck` (type: `integer`):

Cap on unique links checked (and charged) per run (1-20,000). Use it to control cost.

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

Also check links to other websites (they are never crawled).

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

Also check <img> sources for broken images.

## `includeSubdomains` (type: `boolean`):

Crawl e.g. blog.example.com when starting at example.com.

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

3-60 seconds.

## `maxConcurrency` (type: `integer`):

Parallel requests (1-30).

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev/"
  ],
  "maxPagesToCrawl": 30,
  "maxLinksToCheck": 500,
  "checkExternalLinks": true,
  "checkImages": false,
  "includeSubdomains": false,
  "timeoutSecs": 15,
  "maxConcurrency": 10
}
```

# Actor output Schema

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

Main results (view: Overview).

## `runStats` (type: `string`):

Counts of delivered, hidden, invalid, duplicate and failed inputs.

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

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

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

```

## MCP server setup

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