# Dead Link Fixer: Broken Link Checker with Wayback Replacements (`chromy_dome/dead-link-fixer`) Actor

Crawl your site or check a URL list for broken links (404, 410, soft-404, 5xx, DNS and TLS errors), then get an Internet Archive Wayback Machine copy to replace each dead link. Respects robots.txt; blocked or access-controlled links are never called broken.

- **URL**: https://apify.com/chromy_dome/dead-link-fixer.md
- **Developed by:** [Under Tree](https://apify.com/chromy_dome) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **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 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

### What does Dead Link Fixer do?

**Dead Link Fixer** is a **broken link checker** that goes one step further: for every dead link it finds, it looks up the **Internet Archive's Wayback Machine** and hands you an **archived replacement URL** you can paste straight into your page.

Point it at your website (or paste a list of URLs) and get a clean table of **404s, 410s, soft 404s, server errors, DNS and TLS failures and redirects**, the pages each bad link appears on, its anchor text, and a suggested fix. It uses the Wayback Machine's official, keyless [Availability API](https://archive.org/help/wayback_api.php), so there is no scraping of archive.org.

### Why use Dead Link Fixer?

Link rot quietly damages SEO, reader trust and citations. Most link checkers stop at "this link is broken" and leave you to hunt for a replacement by hand. Dead Link Fixer:

- ✅ **Finds broken links** across a site crawl, a set of pages, or a plain URL list
- 🗄️ **Finds a Wayback Machine copy** for each dead link, optionally the copy closest to a date you choose (for example, when you first published the link)
- 🧭 **Suggests a fix** for every row: use the archived copy, update a redirected link to its final URL, or restore/redirect an internal page
- 🤝 **Never cries wolf**: links blocked by robots.txt or by access controls (401, 403, 429) are reported as *unverified*, not broken
- 🕵️ **Detects soft 404s**: pages that answer `200 OK` but say "page not found"
- 🤖 **Respects robots.txt** for every page it crawls and every link it checks
- ⏱️ Runs on Apify, so you can **schedule** monthly link audits, call it through the **API**, and send results to Google Sheets, Slack, Zapier or Make

Useful for bloggers, publishers, SEO agencies, librarians, Wikipedia-style editors, documentation teams, legal and research teams who must keep citations alive.

### What data does Dead Link Fixer extract?

| Field | Type | Description |
|---|---|---|
| `linkUrl` | string | The link that was checked |
| `category` | string | `broken`, `client_error`, `server_error`, `network_error`, `redirect`, `unverified` or `ok` |
| `httpStatus` | number | Final HTTP status code (empty for network errors) |
| `errorCode` | string | For example `ENOTFOUND`, `TIMEOUT`, `ROBOTS_TXT_DISALLOW` |
| `foundOnPages` | array | Pages on your site that contain the link |
| `anchorTexts` | array | The visible link text used |
| `archiveUrl` | string | Wayback Machine replacement URL, when one exists |
| `archiveTimestamp` | date | When that archived copy was captured (UTC) |
| `suggestedFix` | string | Plain-language next step |
| `finalUrl`, `redirectCount` | string, number | Where redirects end up |
| `soft404` | boolean | `true` when a 200 page looks like a "not found" page |

A run summary (pages crawled, links checked, problems, archive copies found) is saved to the key-value store as `SUMMARY`.

### How to find and fix broken links

1. Click **Try for free** (or **Start**).
2. Add your website's home page to **Start URLs**.
3. Pick a **Mode**: *Crawl site* (default), *Start pages only*, or *URL list*.
4. Leave **Find Wayback Machine replacements** on.
5. Click **Start** and wait for the run to finish.
6. Open the **Output** tab, sort by *Pages linking*, and fix the links that appear most often first.
7. Export to CSV or Excel, or schedule the Actor to run monthly.

### How much will it cost to check broken links?

Dead Link Fixer uses **pay-per-event** pricing, so you only pay for work done:

| Event | What it means |
|---|---|
| **Link checked** | One unique link checked (healthy or not) |
| **Archive replacement found** | Charged only when a usable Wayback Machine copy is returned for a dead link |

Current prices are shown on the **Pricing** tab. Set **Max links to check** and your run's **maximum cost** to cap spending; the Actor stops cleanly when your limit is reached. Archive lookups that fail or are rate-limited are never charged.

### Input

See the **Input** tab for every option. The ones that matter most:

- **Start URLs**: your site or pages. In *URL list* mode, each URL is itself checked as a link.
- **Max pages to crawl** / **Max links to check**: hard caps for cost control.
- **Preferred archive date**: `YYYY`, `YYYYMM` or `YYYYMMDD`. The archived copy closest to that date is returned.
- **Output only links that need attention**: switch off to get a full link inventory.

Example input:

```json
{
  "startUrls": [{ "url": "https://example.com/blog/" }],
  "mode": "crawlSite",
  "maxPages": 100,
  "findArchivedCopies": true,
  "archiveTargetDate": "2019"
}
```

### Output

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

```json
[
  {
    "linkUrl": "https://old-supplier.example/catalogue.html",
    "category": "broken",
    "httpStatus": 404,
    "errorCode": null,
    "foundOnPages": ["https://example.com/blog/seed-sources"],
    "foundOnPageCount": 1,
    "anchorTexts": ["seed catalogue"],
    "archiveStatus": "found",
    "archiveUrl": "https://web.archive.org/web/20190412093011/https://old-supplier.example/catalogue.html",
    "archiveTimestamp": "2019-04-12T09:30:11Z",
    "suggestedFix": "Replace with the archived copy: https://web.archive.org/web/20190412093011/https://old-supplier.example/catalogue.html"
  },
  {
    "linkUrl": "https://example.com/old-page",
    "category": "broken",
    "httpStatus": 200,
    "soft404": true,
    "archiveStatus": "not_archived",
    "suggestedFix": "Restore the page or add a 301 redirect to the closest live page."
  }
]
```

### Tips for faster, cheaper runs

- Start with **Start pages only** on your most important pages, then widen to a full crawl.
- Turn off **Check internal links** if you only care about outbound citations.
- Keep **Max concurrency** at 5 or lower for small sites; it is politer and avoids rate limits.
- The Internet Archive limits how fast anyone can query it. If it starts refusing requests, the Actor pauses, then skips further archive lookups for that run rather than failing (and does not charge for them).

### FAQ, disclaimers and support

**Does it scrape archive.org?** No. It calls the Wayback Machine's public Availability API once per dead link, spaced out to respect the Internet Archive's limits.

**Why is a link marked "unverified"?** The site refused automated access (401, 403, 429) or its robots.txt disallows the URL. We don't call it broken because a person might still reach it.

**Can it check pages that need JavaScript to show links?** Not in this version; it reads the HTML the server sends.

This Actor only reads public pages and links you point it at. It does not collect personal data. Our Actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our Actors, when used for ethical purposes by Apify users, are safe. However, you should be aware that your results could contain personal data. Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

Found a bug or want a feature? Open an issue in the **Issues** tab. For programmatic access, see the **API** tab. Not affiliated with the Internet Archive.

# Actor input Schema

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

Pages or sites to check. In 'Crawl site' mode these are starting points; in 'URL list' mode each URL is checked directly as a link.

## `mode` (type: `string`):

crawlSite: follow same-host links up to 'Max pages' and check every link found. pagesOnly: check links on the start pages only. urlList: check the start URLs themselves (no crawling).

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

Upper limit on pages read in 'Crawl site' mode.

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

Upper limit on unique links checked (each is billed as one 'link checked' event).

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

Check links that point to other websites.

## `checkInternalLinks` (type: `boolean`):

Check links that point to the same website.

## `findArchivedCopies` (type: `boolean`):

For each link that needs attention, ask the Internet Archive's official Availability API for the closest archived copy.

## `archiveTargetDate` (type: `string`):

Optional. YYYY, YYYYMM or YYYYMMDD. The archive copy closest to this date is returned (for example, the date you first published the link). Leave empty for the most recent copy.

## `onlyProblems` (type: `boolean`):

When on, healthy, redirected and access-controlled links are counted in the summary but not written to the dataset. Turn off for a full link inventory.

## `detectSoft404` (type: `boolean`):

Flag pages that return 200 OK but whose title or main heading says 'not found'.

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

Skip pages and links disallowed by the target site's robots.txt. Skipped links are reported as 'unverified', never as broken.

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

Parallel requests. Keep low to be polite to small sites.

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

How long to wait for each page or link before calling it a timeout.

## `userAgent` (type: `string`):

User-Agent header sent with requests.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "mode": "crawlSite",
  "maxPages": 50,
  "maxLinksToCheck": 500,
  "checkExternalLinks": true,
  "checkInternalLinks": true,
  "findArchivedCopies": true,
  "archiveTargetDate": "",
  "onlyProblems": true,
  "detectSoft404": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 5,
  "requestTimeoutSecs": 20,
  "userAgent": "Mozilla/5.0 (compatible; DeadLinkFixer/1.0; +https://apify.com)"
}
```

# Actor output Schema

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

No description

## `summary` (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": [
        {
            "url": "https://crawlee.dev"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("chromy_dome/dead-link-fixer").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": [{ "url": "https://crawlee.dev" }] }

# Run the Actor and wait for it to finish
run = client.actor("chromy_dome/dead-link-fixer").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": [
    {
      "url": "https://crawlee.dev"
    }
  ]
}' |
apify call chromy_dome/dead-link-fixer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,chromy_dome/dead-link-fixer"
        }
    }
}
```

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/hZGNE8D0LCnP68was/builds/x6MF4EdBK9MzMoVsZ/openapi.json
