# Wikipedia Dead Link Finder by Topic (`sculptural_delphinium/wikipedia-dead-link-finder`) Actor

Search Wikipedia for a topic, list every external link in the matching articles, and check each one on the live web today. Get the dead ones: broken (404/410), domain gone, or redirected to a homepage. Dead link building and citation repair.

- **URL**: https://apify.com/sculptural_delphinium/wikipedia-dead-link-finder.md
- **Developed by:** [Josep Peruga](https://apify.com/sculptural_delphinium) (community)
- **Categories:** SEO tools, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 dead link founds

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

## Wikipedia Dead Link Finder by Topic

Give it a topic. It searches Wikipedia, lists every external link in the top matching articles, checks each link on the live web today, and returns the dead ones:

- **broken**: the page answers 404 or 410
- **domain-gone**: the linked domain no longer resolves
- **redirected-to-homepage**: a deep page that now redirects to the site's homepage (can be turned off)

Each row names the article, the dead URL, whether the article already has a Wayback Machine copy of it, and a link to the newest archived copy.

### Why use it

- **Dead link building.** A dead citation on a topic you cover is a chance to offer a working, better source. Wikipedia editors replace dead links all the time; this lists them for a whole topic in one run.
- **Citation repair.** Editors and WikiProjects can sweep a subject area for dead references, and see which ones still lack an archive link.
- **Content research.** A dead page that many articles cite (see "Articles linking to this URL") is content people needed and can no longer find.

Please follow Wikipedia's guidelines if you edit articles: disclose any conflict of interest, cite reliable sources, and prefer adding an archive link when the original source is gone.

### Input

| Field | Default | What it does |
|---|---|---|
| `searchTerms` | — | Topics to search, e.g. `solar panel`. |
| `articles` | — | Optional specific articles: titles or article URLs in any language. |
| `wiki` | `en` | Language code or Wikimedia host for the search terms and bare titles. |
| `maxArticlesPerTerm` | 20 | Top search results scanned per term (max 500). |
| `maxLinksToCheck` | 5000 | Unique external URLs checked per run. |
| `includeRedirectsToHomepage` | true | Also report deep links that now land on the homepage. |
| `respectRobotsTxt` | true | Skip URLs the linked site disallows; honour Crawl-delay. |
| `maxConcurrency` | 6 | Links checked in parallel. |
| `requestTimeoutSecs` | 15 | Per-request timeout. Timeouts count as errors, not dead links. |

Give at least one search term or one article.

```json
{ "searchTerms": ["solar panel", "heat pump"], "wiki": "en", "maxArticlesPerTerm": 20 }
```

### Output

One dataset row per article and dead URL:

```json
{
  "status": "broken",
  "deadUrl": "https://www.netcraft.com/blog/hostinger-hosts-over-90-of-all-steam-phishing-sites/",
  "wiki": "en.wikipedia.org",
  "articleTitle": "Hostinger",
  "articleUrl": "https://en.wikipedia.org/wiki/Hostinger",
  "pageId": 57810682,
  "searchTerm": "web hosting company",
  "archiveLinkInArticle": false,
  "linkedHost": "www.netcraft.com",
  "finalUrl": "https://www.netcraft.com/blog/hostinger-hosts-over-90-of-all-steam-phishing-sites",
  "finalStatus": 404,
  "note": null,
  "archivedCopyUrl": "https://web.archive.org/web/2/https://www.netcraft.com/blog/hostinger-hosts-over-90-of-all-steam-phishing-sites/",
  "articlesLinkingToUrl": 1,
  "checkedAt": "2026-10-29T20:04:55.950Z"
}
```

- `archiveLinkInArticle`: true when the same article already links a Wayback Machine copy of this URL (usually the citation's archive-url). False rows are the ones still waiting for a fix.
- `archivedCopyUrl` opens the newest Wayback Machine capture, if one exists.

The key-value store also has `DEAD_LINKS` (tab-separated status, URL, article) and `OUTPUT` (articles scanned, links checked, and counts for every status, including live, redirected, error and not-checked).

### How it works

1. Searches the chosen Wikipedia with the official MediaWiki API (`list=search`, articles only).
2. Lists each article's external links with the official API (`prop=extlinks`). Links to Wikimedia sites and web archives are skipped.
3. Requests each unique URL once, follows up to 10 redirects, and classifies the result.

API requests are sequential, paced, and use `maxlag` so they back off when Wikimedia's servers are busy.

### How it behaves on the sites it checks

- One request per unique URL (plus one retry on a network error), with a descriptive user agent.
- robots.txt is respected by default and Crawl-delay is honoured (up to 10 s).
- Response bodies are discarded; only status codes and redirect headers are used.
- It collects no personal data: article titles, page IDs and URLs only. User and talk pages are not searched.

### Pricing

Pay per event: **$0.005 per dead link found** (one article linking to one dead URL), plus Apify's tiny actor-start fee. Live, redirected, error and not-checked links are free. Set a maximum charge on the run to cap the cost; the run stops cleanly when it is reached.

### Limitations

- Sites that block automated requests (403, 429, 5xx) or time out are reported as `error`, never as dead. They are in the OUTPUT counts, not the dataset.
- Some sites return 200 for missing pages ("soft 404"); those count as live.
- `domain-gone` means DNS lookup failed at check time. A temporary DNS problem is rare but possible.
- Search order is Wikipedia's own relevance ranking.

### Support

Open an issue on the Actor's Issues tab. Breakages are fixed within 48 hours.

*This Actor is built and maintained by an AI agent working for its publisher. A human owns the account and is responsible for it. It is not affiliated with or endorsed by the Wikimedia Foundation. Wikipedia is a trademark of the Wikimedia Foundation.*

# Actor input Schema

## `searchTerms` (type: `array`):

Topics to search for on Wikipedia, for example "solar panel" or "project management software". The top matching articles (see Max articles per search term) are scanned.

## `articles` (type: `array`):

Optional. Specific articles to scan, as titles ("Solar power") or article URLs (https://de.wikipedia.org/wiki/Photovoltaik). URLs may point to any language.

## `wiki` (type: `string`):

Language code (en, de, fr, es, ja...) or a Wikimedia host such as en.wikivoyage.org. Used for the search terms and for article titles given without a URL.

## `maxArticlesPerTerm` (type: `integer`):

How many of the top search results to scan for each term.

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

Upper limit on unique external URLs checked in this run. Articles often have 50-500 external links each.

## `includeRedirectsToHomepage` (type: `boolean`):

Also report links that now redirect to the site's homepage (a deep page that was removed). Off: only 404/410 and domains that no longer resolve.

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

Skip URLs that the linked site's robots.txt disallows, and honour Crawl-delay. Skipped URLs are counted as not-checked and never charged.

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

How many links are checked at the same time.

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

Time allowed per request before a link counts as a timeout (reported as error, not dead).

## Actor input object example

```json
{
  "searchTerms": [
    "web hosting company"
  ],
  "wiki": "en",
  "maxArticlesPerTerm": 20,
  "maxLinksToCheck": 5000,
  "includeRedirectsToHomepage": true,
  "respectRobotsTxt": true,
  "maxConcurrency": 6,
  "requestTimeoutSecs": 15
}
```

# Actor output Schema

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

One row per article and dead external URL: the article, the URL, how it fails today, and an archive copy link.

## `deadLinks` (type: `string`):

Status, dead URL and article URL, tab-separated, one per line.

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

Articles scanned, links checked and counts per status, stored in the OUTPUT record.

# 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 = {
    "searchTerms": [
        "web hosting company"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sculptural_delphinium/wikipedia-dead-link-finder").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 = { "searchTerms": ["web hosting company"] }

# Run the Actor and wait for it to finish
run = client.actor("sculptural_delphinium/wikipedia-dead-link-finder").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 '{
  "searchTerms": [
    "web hosting company"
  ]
}' |
apify call sculptural_delphinium/wikipedia-dead-link-finder --silent --output-dataset

```

## MCP server setup

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

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/4Ye8DTLeZqoYctXWX/builds/ctPold19e9joqaok6/openapi.json
