# Website Broken Link & 404 Anchor Text Checker (`litezero/website-broken-link-checker`) Actor

Audit website links in bulk to detect broken 404s, 500 server errors, timeouts, and redirects with anchor text and source page context.

- **URL**: https://apify.com/litezero/website-broken-link-checker.md
- **Developed by:** [LiteZero](https://apify.com/litezero) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 item scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 🔗 Website Broken Link & 404 Anchor Text Checker

Fast, automated website dead link auditor. Scan any webpage or domain to detect broken **404 Not Found**, **500 Server Errors**, **redirect chains**, and **request timeouts**. Delivers full technical audit details including HTTP status codes, clickable anchor text, and origin URLs.

***

### 🥊 Why This Actor Beats the Competition

| Feature | This Actor (Pay-Per-Result) | Traditional SEO Crawlers (Screaming Frog, Ahrefs) | Puppeteer/Playwright Headless Scrapers |
|---|---|---|---|
| **Speed** | ⚡ **Concurrent direct HTTP requests (~50ms/link)** | Requires local desktop app or heavy enterprise plans | 🐢 Slow browser overhead (3–5s per page) |
| **Pricing** | 💰 **$1.00 / 1,000 links checked** (PPR) | $200+/year subscription required | Expensive compute-hour bills |
| **Anchor Text** | ✅ **Captures full anchor text & parent page URL** | Often buried in complex CSV exports | Requires custom DOM script parsing |
| **External Links** | ✅ **Configurable internal vs external validation** | High credit consumption on external URLs | High crash rates on external timeouts |

***

### 🛠️ Step-by-Step: How to Use

#### Method 1: Apify Web Console (No-Code)

1. Enter your target webpage or domain in **Start URLs** (e.g. `https://apify.com`).
2. Set **Maximum Links to Check** (e.g. `50`).
3. Click **Start** to run the audit and download results in JSON, CSV, or Excel.

#### Method 2: Python SDK

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("litezero/website-broken-link-checker").call(run_input={
    "startUrls": ["https://apify.com"],
    "maxLinksToCheck": 50,
    "checkExternalLinks": True
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["isBroken"]:
        print(f"Broken Link: {item['targetUrl']} (Status {item['statusCode']}) from {item['parentUrl']}")
```

***

### 📥 Input Parameters

| Parameter | Type | Default | Description |
|---|:---:|:---:|---|
| `startUrls` | Array | `["https://apify.com"]` | Target URLs or pages to audit for hyperlinks. |
| `maxLinksToCheck` | Integer | `30` | Maximum number of hyperlinks to audit. |
| `checkExternalLinks` | Boolean | `true` | If enabled, outgoing external hyperlinks will also be verified. |
| `timeoutSec` | Integer | `10` | Response timeout in seconds per link. |

***

### 📤 Output Sample JSON

```json
{
  "targetUrl": "https://apify.com/pricing",
  "statusCode": 200,
  "statusMessage": "OK",
  "isBroken": false,
  "anchorText": "Pricing",
  "parentUrl": "https://apify.com/",
  "isExternal": false,
  "durationMs": 42,
  "errorMessage": null,
  "checkedAt": "2026-10-03T09:20:00.000Z"
}
```

***

### 💡 Top Commercial Use Cases

1. **Website Migration & Relaunch Audits:** Discover broken links immediately after site migrations or CMS redesigns.
2. **Affiliate & Outbound Link Monitoring:** Ensure affiliate links and partner URLs are active and not returning 404s.
3. **Automated SEO Health Monitoring:** Run weekly scheduled checks to prevent search engine crawl budget waste.\n

# Actor input Schema

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

List of URLs or webpage links to crawl and check for broken hyperlinks.

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

Maximum number of hyperlinks to audit for HTTP response status.

## `concurrency` (type: `integer`):

Number of parallel link verification workers (1 to 10).

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

If enabled, outgoing external hyperlinks will also be verified.

## `timeoutSec` (type: `integer`):

Maximum seconds to wait per link response before marking as timed out.

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com"
  ],
  "maxLinksToCheck": 15,
  "concurrency": 5,
  "checkExternalLinks": true,
  "timeoutSec": 7
}
```

# Actor output Schema

## `results` (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://apify.com"
    ],
    "maxLinksToCheck": 15,
    "concurrency": 5,
    "checkExternalLinks": true,
    "timeoutSec": 7
};

// Run the Actor and wait for it to finish
const run = await client.actor("litezero/website-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"],
    "maxLinksToCheck": 15,
    "concurrency": 5,
    "checkExternalLinks": True,
    "timeoutSec": 7,
}

# Run the Actor and wait for it to finish
run = client.actor("litezero/website-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"
  ],
  "maxLinksToCheck": 15,
  "concurrency": 5,
  "checkExternalLinks": true,
  "timeoutSec": 7
}' |
apify call litezero/website-broken-link-checker --silent --output-dataset

```

## MCP server setup

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