# Broken Link Checker: 404s, Redirect Chains & Mixed Content (`latamdatatools/broken-links-checker`) Actor

Crawl a website or check a list of URLs and find broken links (404, 410, 5xx), dead domains, redirect chains, mixed content and blocked resources, with the pages and anchor text where each link appears. Respects robots.txt.

- **URL**: https://apify.com/latamdatatools/broken-links-checker.md
- **Developed by:** [Julian Genuario](https://apify.com/latamdatatools) (community)
- **Categories:** SEO tools, Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 checked links

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: 404s, Redirect Chains & Mixed Content

Crawl a website, or check a plain list of URLs, and get **every link's HTTP status** with the **pages and anchor text where it appears**. Find broken links (404, 410, 5xx), dead domains and timeouts, redirect chains, links blocked by bot protection, and **mixed content** (http images and scripts on https pages) in one run.

### What does Broken Link Checker do?

Broken Link Checker crawls a website or checks a list of URLs and finds broken links (404, 410, 5xx), dead domains, redirect chains, mixed content and blocked resources, with the source page and anchor text where each link appears. Use it for technical SEO audits and website maintenance.

### How to use Broken Link Checker

1. Click **Try for free** on this page (a free Apify account is enough to start).
2. Fill in the input (see the examples below) or keep the prefilled example.
3. Click **Start** and wait for the run to finish.
4. Download the results from the **Output** tab as JSON, CSV, Excel or HTML, or read them with the Apify API.
5. Optional: create a **Schedule** to run it daily or weekly, and connect a webhook or an integration (Make, Zapier, n8n, Slack).

### What it checks

- **Internal links**: followed and crawled (up to your page and depth limits); every page found is also checked.
- **External links**: checked once each (never crawled), with the full **redirect chain** (`301 → 302 → 200`) and final URL.
- **Resources** (optional): images (including `srcset`), scripts, stylesheets, iframes, video/audio, favicons, canonical and hreflang URLs.
- **Mixed content**: `http://` resources loaded on `https://` pages.
- **Where each link is**: up to N source pages with the anchor text, plus the total count.

Each unique URL is checked once per run, no matter how many pages link to it.

### Status values

| status | Meaning |
|---|---|
| `ok` | 2xx, no redirect |
| `redirect` | Ended on 2xx after one or more redirects (see `redirectChain`). Update the link to the final URL to save a hop. |
| `broken` | 4xx or 5xx (404 Not Found, 410 Gone, 500...) |
| `restricted` | 401, 403, 429 or 999: usually login or bot protection (LinkedIn, npm, Stack Overflow...). Often fine for humans: check by hand. |
| `error` | Domain does not resolve, timeout, connection or TLS error, too many redirects (loop) |
| `robots-disallowed` | Not checked because that site's robots.txt disallows it (listed for transparency, not charged) |

### Polite by design

- **robots.txt is respected** on the site you crawl **and** on every external site before a link is checked (and on every redirect hop).
- At most **one request per second per host** (or the host's `Crawl-delay`), several hosts in parallel.
- Identifiable user agent (`BrokenLinkCheckerBot`), no proxies, no headless browser, no bypassing of bot protection.

### Use cases

- **SEO audits**: broken internal links and redirect chains waste crawl budget and link equity.
- **Website QA before and after a migration**: check the old URL list (paste it or load a CSV) and see where each one ends up.
- **Content maintenance**: find outbound links to dead pages in blog archives and docs.
- **HTTPS hygiene**: find mixed-content resources that browsers block.
- **Backlink / affiliate link monitoring**: schedule a list check and get only the problems.

### Input

| Field | What it does |
|---|---|
| **Websites to crawl** | Start URLs. Internal = same host (with or without `www.`). |
| **URLs to check (no crawling)** / **Dataset** / **CSV URL** | Check a list of URLs one by one. Can be combined with a crawl. |
| **Max pages to crawl**, **Max crawl depth**, **Max links to check** | Limits (defaults 50 pages, depth 3, 2,000 links). |
| **Check external links** | On by default. |
| **Check images, scripts, stylesheets, iframes** | On by default; also enables mixed-content detection. |
| **Ignore URLs containing** | Skip logout links, cart actions, calendars... |
| **Output** | All links, problems only, or problems + redirects. |

#### Example

```json
{
  "startUrls": ["https://www.example.com"],
  "maxPages": 200,
  "maxDepth": 4,
  "maxLinks": 5000,
  "outputMode": "problems-and-redirects",
  "ignoreUrlsContaining": ["/logout", "?replytocom="]
}
```

### Output

One row per unique URL, sorted with problems first:

```json
{
  "url": "https://sdk.apify.com/docs/guides/getting-started",
  "status": "redirect",
  "httpStatus": 200,
  "error": null,
  "finalUrl": "https://docs.apify.com/sdk/js/docs/overview",
  "redirectCount": 2,
  "redirectChain": [
    { "url": "https://sdk.apify.com/docs/guides/getting-started", "status": 301 },
    { "url": "https://docs.apify.com/sdk/js/docs/guides/getting-started", "status": 302 }
  ],
  "isInternal": false,
  "linkType": "link",
  "contentType": "text/html",
  "responseTimeMs": 2243,
  "mixedContent": false,
  "foundOnCount": 11,
  "foundOn": [
    { "pageUrl": "https://crawlee.dev/js/docs/guides", "anchorText": "2.2", "tag": "a" }
  ],
  "checkedAt": "2026-10-26T22:40:00.000Z"
}
```

`linkType` is `start`, `list`, `link`, `image`, `script`, `stylesheet`, `iframe`, `media`, `canonical`, `hreflang` or `form`. A `RUN_SUMMARY` record has the totals (pages crawled, links found, broken, redirects, mixed content...).

### Pricing

Pay per event: **USD 1 per 1,000 links checked** (USD 0.001 per unique URL). URLs not checked because of robots.txt, ignored URLs, external links when you turn them off, and links beyond your limits are **not charged**. With "problems only", all checked links are billed even if hidden. The Actor never checks more links than your "max charge per run" allows.

### Limitations

- Pages are read as HTML without running JavaScript: links added only by client-side JavaScript are not found.
- `restricted` (401/403/429/999) often means bot protection, not a dead link.
- Some servers answer differently to bots than to browsers; a link reported `broken` should be confirmed before you remove it.
- Results reflect the network of a US cloud server (geo-blocked sites may fail).

### Cost examples

Prices at the current pay-per-event rate: USD 1.00 per 1,000 unique links checked (links skipped by robots.txt, ignored links and links over your limits are free). You can set a maximum charge per run in the run options.

| Job | Approximate cost |
|---|---|
| Test run: 3 pages of crawlee.dev, 39 links (measured: 32 s) | about $0.04 |
| Prefill: 10 pages, up to 300 links | up to $0.30 |
| Full check of a 50-page site, 2,000 links | about $2.00 |
| List mode: 10,000 URLs from a sheet | about $10.00 |

### Use it from your code, an integration or an AI agent

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("latamdatatools/broken-links-checker").call(run_input={
  "startUrls": [
    "https://crawlee.dev"
  ],
  "maxPages": 10,
  "maxLinks": 300,
  "outputMode": "problems"
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["status"], item["httpStatus"], item["url"])
```

**JavaScript / Node.js** (`npm install apify-client`):

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('latamdatatools/broken-links-checker').call({
  startUrls: [
    'https://crawlee.dev'
  ],
  maxPages: 10,
  maxLinks: 300,
  outputMode: 'problems'
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.filter((i) => i.status === "broken"));
```

**No code:**

- **Schedules:** save your input as a Task and run it daily or weekly from Apify Console (Schedules).
- **Integrations:** send the results to Google Sheets, Slack, email, Make, Zapier, n8n or Airbyte from the Integrations tab, or call your own webhook when a run finishes.
- **AI agents:** add it as a tool in Claude, Cursor, VS Code and other MCP clients through the Apify MCP server (`https://mcp.apify.com`), so the agent can audit a site and list the broken links for you.

### FAQ

**Can I call it from my own code or from an AI agent?** Yes. Start runs and fetch results with the Apify API or the JavaScript / Python clients, or use it as a tool from Claude, Cursor and other MCP clients through the Apify MCP server (`mcp.apify.com`).

**Can I run it automatically?** Yes. Create a Schedule in Apify Console (for example every morning) and add a webhook or an integration to get the results where you need them.

**Which export formats are available?** JSON, JSONL, CSV, Excel (XLSX), XML, RSS and HTML table, from the Output tab or the API.

**What does it cost?** See the Pricing section above. You only pay for the events listed there.

### Changelog

- 0.1 (2026-10): first version.

# Actor input Schema

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

Home page (or any page) of each site. The Actor follows internal links up to the page and depth limits and checks every link it finds.

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

A plain list of URLs to check one by one: status code, redirect chain and final URL. Use for backlink lists, migrations or sitemap exports.

## `datasetId` (type: `string`):

Check the URLs in an Apify dataset (field set below). No crawling.

## `csvUrl` (type: `string`):

Public CSV with a header row, or a Google Sheets link shared as "Anyone with the link". No crawling.

## `urlField` (type: `string`):

Field or column with the URL in the dataset or CSV.

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

Internal HTML pages opened to find links (per run).

## `maxDepth` (type: `integer`):

Clicks away from the start URL (0 = only the start page).

## `maxLinks` (type: `integer`):

Unique URLs checked per run (pages + links + resources). Each checked URL is one billable event.

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

Also check links to other websites (never crawled, only checked).

## `includeAssets` (type: `boolean`):

Besides <a> links, check resources and flag mixed content (http resources on https pages).

## `ignoreUrlsContaining` (type: `array`):

Skip links whose URL contains any of these texts (e.g. "/logout", "?add-to-cart=").

## `outputMode` (type: `string`):

"Problems only" lists broken, errors, restricted and mixed content (every checked link is still billed).

## `foundOnLimit` (type: `integer`):

How many source pages (with anchor text) to list for each link. The total count is always given.

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

Across different hosts. The same host is never hit more than once per second (or its robots.txt Crawl-delay).

## `requestTimeoutSecs` (type: `integer`):

A link that does not answer in time is reported as an error (timeout).

## Actor input object example

```json
{
  "startUrls": [
    "https://crawlee.dev"
  ],
  "urlField": "url",
  "maxPages": 10,
  "maxDepth": 3,
  "maxLinks": 300,
  "checkExternal": true,
  "includeAssets": true,
  "outputMode": "all",
  "foundOnLimit": 10,
  "maxConcurrency": 5,
  "requestTimeoutSecs": 20
}
```

# Actor output Schema

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

No description

## `runSummary` (type: `string`):

No description

# 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"
    ],
    "maxPages": 10,
    "maxLinks": 300
};

// Run the Actor and wait for it to finish
const run = await client.actor("latamdatatools/broken-links-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"],
    "maxPages": 10,
    "maxLinks": 300,
}

# Run the Actor and wait for it to finish
run = client.actor("latamdatatools/broken-links-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"
  ],
  "maxPages": 10,
  "maxLinks": 300
}' |
apify call latamdatatools/broken-links-checker --silent --output-dataset

```

## MCP server setup

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