# Broken Link Checker – Find Dead Links & Missing Images (`coresight-data/broken-link-checker`) Actor

Crawl any website and find every broken link, missing image and dead external link, with the exact page it is on and the link text. Fast, no browser, respects robots.txt.

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

## Pricing

from $2.00 / 1,000 page crawleds

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 any website and find **every broken link, missing image and dead external link**, with the exact page each one is on and the link text, so you can fix them in minutes.

Fast and light: it reads pages directly without a browser, checks every link once even if it appears on hundreds of pages, and respects `robots.txt`.

### Why broken links matter

- Visitors who hit a 404 page leave, and enquiries are lost.
- Search engines waste crawl time on dead links, and broken internal links stop pages from passing ranking value.
- Missing images and stylesheets make a site look broken.

### What it checks

- **Links between your own pages**: 404 not found, 410 gone, 500 server errors, timeouts.
- **Links to other websites**: dead domains, expired pages, SSL certificate problems.
- **Images, scripts, stylesheets, videos and iframes**: missing files.

### Input

- **Websites**: one or more addresses, for example `example.com`. It starts there and follows links within the same site (with or without `www.`).
- **Maximum pages per website**: default 200.
- **Check links to other websites**: on by default.
- **Check images, scripts, stylesheets and files**: on by default.
- **Report external links that block checkers**: off by default. Sites such as LinkedIn and Amazon answer `403` or `999` to every automated check even when the link works, so these are left out to avoid false alarms.

### Output

One row for each broken link on each page it appears on:

```json
{
  "website": "https://example.co.uk",
  "pageUrl": "https://example.co.uk/about",
  "brokenUrl": "https://example.co.uk/old-offer",
  "linkText": "See our summer offer",
  "linkType": "page",
  "statusCode": 404,
  "error": "Not found",
  "external": false
}
```

`linkType` is `page`, `image`, `script`, `stylesheet`, `media` or `iframe`.

A **summary per website** (pages crawled, links checked, broken links found, whether the page limit was reached) is saved in the `SUMMARY` record of the run.

Export to Excel, CSV or JSON, or connect to Google Sheets, Slack, Zapier, Make or the API. Schedule it weekly to catch new broken links as soon as they appear.

### Pricing

You pay **per page crawled**. Every link on those pages is checked at no extra cost, including images and links to other sites. A site with 200 pages costs the same whether it has no broken links or hundreds.

### Good to know

- Pages that need a login, or links added later by JavaScript, are not checked.
- Pages blocked by the site's `robots.txt` are not crawled.
- Links are counted as broken when they return an error status (400 or above), fail to connect, or time out.

### Support

If a result looks wrong, open an issue on this page with the page address and the link, and it will be looked at.

# Actor input Schema

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

Website addresses to check, one per line, for example example.com. The checker starts at this page and follows links within the same site.

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

You are charged per page crawled. Links on those pages are all checked at no extra cost.

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

Also check links that point to other sites.

## `checkImagesAndFiles` (type: `boolean`):

Find missing images and files as well as broken page links.

## `reportBotBlocks` (type: `boolean`):

Some sites (LinkedIn, Amazon and others) answer 403 or 999 to any automated check even when the link works. These are left out by default to avoid false alarms.

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

Keep this low to be gentle on small websites.

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

A link that does not answer within this time is reported as timed out.

## Actor input object example

```json
{
  "startUrls": [
    "https://the-internet.herokuapp.com/broken_images"
  ],
  "maxPagesPerSite": 50,
  "checkExternalLinks": true,
  "checkImagesAndFiles": true,
  "reportBotBlocks": false,
  "maxConcurrency": 5,
  "timeoutSecs": 20
}
```

# Actor output Schema

## `brokenLinks` (type: `string`):

One row for each broken link on each page it appears on.

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

Pages crawled, links checked and broken links found for each site.

# 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://the-internet.herokuapp.com/broken_images"
    ],
    "maxPagesPerSite": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("coresight-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://the-internet.herokuapp.com/broken_images"],
    "maxPagesPerSite": 50,
}

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

```

## MCP server setup

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