# Broken Link Checker – Find 404s, Redirect Chains & Dead Links (`flets_sv/broken-link-checker`) Actor

Crawl a website and find broken links, 404 and 5xx errors, redirect chains and loops, with the source page and anchor text of each link. Fast SEO audit.

- **URL**: https://apify.com/flets_sv/broken-link-checker.md
- **Developed by:** [FlEtsv](https://apify.com/flets_sv) (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

$0.50 / 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

## Broken Link Checker – Find 404s, Redirect Chains & Dead Links

### Use cases

- SEO audits: find 404s, soft errors and long redirect chains before they cost rankings
- Pre-launch and post-migration QA of a website
- Agency reporting: schedule weekly runs and alert only on new broken links
- Clean outbound links on blogs, docs and affiliate sites

### Qué hace / What it does

**Español.** Rastrea tu sitio web y encuentra los enlaces rotos (404, 410 y otros 4xx), los errores de servidor (5xx), las redirecciones y las cadenas o bucles de redirección. Para cada problema devuelve la página donde aparece el enlace y su texto ancla, para que sea fácil corregirlo. Es una auditoría SEO rápida: lee el `sitemap.xml` para encontrar páginas, respeta las reglas `Disallow` de `robots.txt` y solo rastrea el mismo dominio que la URL de inicio. Los enlaces a otros dominios se comprueban, pero no se rastrean.

**English.** Crawls your website and finds broken links (404, 410 and other 4xx), server errors (5xx), redirects and redirect chains or loops. For each problem it returns the page where the link appears and its anchor text, so it is easy to fix. It is a fast SEO audit: it reads `sitemap.xml` to find pages, respects `Disallow` rules in `robots.txt`, and only crawls the same host as the start URL. Links to other domains are checked but not crawled.

### Input / Entrada

| Campo / Field | Tipo / Type | Por defecto / Default | Descripción / Description |
| --- | --- | --- | --- |
| `urlInicio` | string | `https://books.toscrape.com` | Sitio a rastrear. Website to crawl. |
| `maxPaginas` | integer | 100 | Páginas del sitio que se abren. Pages of your site to open. |
| `profundidad` | integer | 5 | Profundidad de enlaces desde la URL de inicio. Link depth from the start URL. |
| `comprobarExternos` | boolean | true | Comprueba también los enlaces a otros dominios. Also checks links to other domains. |
| `incluirRecursos` | boolean | false | Comprueba también imágenes, CSS y JS. Also checks images, CSS and JS. |
| `soloEstasUrls` | string\[] | `[]` | Modo lista: no rastrea, solo comprueba estas URLs. List mode: no crawling, only these URLs. |
| `usarSitemap` | boolean | true | Usa el sitemap para encontrar páginas. Seeds pages from the sitemap. |
| `soloProblemas` | boolean | true | Devuelve solo rotos, errores y cadenas de 2 o más saltos. Returns only problems. |
| `modoVigilancia` | boolean | false | Recuerda los problemas de la ejecución anterior y devuelve solo los nuevos y los arreglados. Remembers the previous run and returns only new and fixed problems. |
| `maxEnlaces` | integer | 5000 | Límite duro de enlaces comprobados por ejecución. Hard limit of links checked per run. |
| `concurrencia` | integer | 5 | Peticiones en paralelo (1 a 20). Parallel requests (1 to 20). |

Ejemplos listos para usar / Ready-to-use examples: `ejemplos/sitio-completo.json` y `ejemplos/vigilancia.json`.

### Output / Salida

Cada elemento del dataset es un enlace con problema:

- `url`, `estado` (`roto`, `error`, `redireccion`), `codigoHttp`, `urlFinal`.
- `cadenaRedirecciones` y `saltos`: el camino completo de redirecciones.
- `paginasOrigen` y `textoAncla`: dónde aparece el enlace y qué texto tiene.
- `interno` y `tipoRecurso`: si es del mismo dominio y si es un enlace, imagen, CSS o JS.

Con `modoVigilancia` activo, cada elemento incluye además `cambio`:

- `"nuevo"`: enlace con problema que no estaba en la ejecución anterior.
- `"arreglado"`: enlace que tenía problema antes y ahora está sano. Solo trae `url` y `cambio`.

### Pricing / Precios

**Español.** Se cobra por enlace comprobado, con el evento `link-checked` a 0,0005 USD por enlace único (incluida su cadena de redirecciones). Los enlaces comprobados se cobran aunque `soloProblemas` esté activo. El límite `maxEnlaces` protege tu presupuesto.

**English.** You pay per checked link, with the `link-checked` event at 0.0005 USD per unique link (including its redirect chain). All checked links are charged even when `soloProblemas` is on. The `maxEnlaces` limit protects your budget.

### Modo vigilancia / Monitor mode

**Español.** Con `modoVigilancia: true` el Actor guarda en un almacén clave-valor con nombre (`broken-link-checker-vigilancia`) las URLs con problema de la última ejecución. La clave depende de la configuración: el sitio de `urlInicio` o la lista `soloEstasUrls`. Así, cada ejecución programada solo informa de lo que ha cambiado. Limitación: un enlace que no se comprueba porque se alcanza `maxEnlaces` o `maxPaginas` se considera "arreglado" en esa ejecución, porque ya no aparece como problema. Usa la misma configuración en cada ejecución para que el estado sea válido.

**English.** With `modoVigilancia: true` the Actor stores the URLs with problems from the last run in a named key-value store (`broken-link-checker-vigilancia`). The key depends on the configuration: the `urlInicio` site or the `soloEstasUrls` list. Each scheduled run then reports only what changed. Limitation: a link that is not checked because `maxEnlaces` or `maxPaginas` was reached counts as "fixed" in that run, because it no longer shows up as a problem. Use the same configuration in every run so the state stays valid.

#### Integrations (Make, Zapier, Google Sheets)

- **Make**: add the Apify module "Run an Actor" (Actor `Flets_sv/broken-link-checker`), paste the input JSON, chain "Get Dataset Items" and map the fields to Google Sheets, Slack, Airtable or your CRM.
- **Zapier**: the Apify app offers "Run Actor" and "Fetch Dataset Items". Add a Schedule trigger and send each row to Gmail, Slack or Notion.
- **Google Sheets**: enable the official Google Sheets integration in the Actor's Integrations tab to append every run to a sheet, or call `https://api.apify.com/v2/acts/Flets_sv~broken-link-checker/run-sync-get-dataset-items?format=csv` with POST and your input from Apps Script (`UrlFetchApp`).
- **API and webhooks**: start the Actor from the REST API, use Schedules for recurring runs and add a webhook to notify your system when a run finishes.

Input to paste into Make or Zapier:

```json
{"urlInicio":"https://books.toscrape.com","maxPaginas":5,"profundidad":5,"comprobarExternos":true,"incluirRecursos":false,"usarSitemap":true,"soloProblemas":true,"modoVigilancia":false,"maxEnlaces":300,"concurrencia":5}
```

### FAQ / Preguntas

**¿Por qué sale un enlace como "arreglado" si sigue roto? / Why does a still-broken link show as "fixed"?**
Porque en esa ejecución no se comprobó (límite de páginas o de enlaces). Aumenta `maxPaginas` o `maxEnlaces`. It was not checked in that run (page or link limit). Raise `maxPaginas` or `maxEnlaces`.

**¿Respeta robots.txt? / Does it respect robots.txt?**
Sí, las reglas `Disallow` del grupo `*` se aplican al rastreo. Yes, `Disallow` rules for the `*` group apply to crawling.

**¿Qué diferencia hay entre `soloEstasUrls` y el rastreo? / What is the difference between `soloEstasUrls` and crawling?**
Con `soloEstasUrls` no se rastrea nada: solo se comprueban esas URLs. With `soloEstasUrls` nothing is crawled: only those URLs are checked.

**¿Por qué una redirección simple no aparece? / Why does a single redirect not show up?**
Por defecto se informa de cadenas de 2 o más saltos y de rotos. Usa `soloProblemas: false` para ver todo. By default only chains of 2 or more hops and broken links are reported. Use `soloProblemas: false` to see everything.

**¿Cómo lo pruebo sin gastar? / How do I test it without spending?**
Ejecuta `npm run build -w actors/broken-link-checker && node actors/broken-link-checker/scripts/en-seco.mjs`. Es un sitio de ejemplo en memoria, sin red ni token. Run the command above: it uses an in-memory sample site, with no network and no token.

#### Integraciones (Make, Zapier, Google Sheets)

- **Make**: añade el módulo de Apify «Run an Actor» (Actor `Flets_sv/broken-link-checker`), pega el input JSON y encadena «Get Dataset Items»; después mapea los campos a Google Sheets, Slack, Airtable o tu CRM.
- **Zapier**: la app de Apify ofrece «Run Actor» y «Fetch Dataset Items». Ponle un disparador de horario y envía cada fila a Gmail, Slack o Notion.
- **Google Sheets**: en la pestaña Integrations del Actor activa la integración oficial con Google Sheets para añadir cada ejecución a una hoja, o llama desde Apps Script (`UrlFetchApp`) a `https://api.apify.com/v2/acts/Flets_sv~broken-link-checker/run-sync-get-dataset-items?format=csv` con POST y tu input.
- **API y webhooks**: lanza el Actor por API REST, programa ejecuciones (Schedules) y avisa a tu sistema con un webhook al terminar.

Ejemplo de input para pegar en Make o Zapier:

```json
{"urlInicio":"https://books.toscrape.com","maxPaginas":5,"profundidad":5,"comprobarExternos":true,"incluirRecursos":false,"usarSitemap":true,"soloProblemas":true,"modoVigilancia":false,"maxEnlaces":300,"concurrencia":5}
```

### Ejemplos de uso / Usage examples

#### Example output (real run, 2026-11-05)

First rows returned by a real run of this Actor on 2026-11-05 (shortened columns, values truncated):

| url | origen | estado | codigoHttp | profundidad |
|---|---|---|---|---|
| https://books.toscrape.com/catalogue/category/books/myste... | https://books.toscrape.com/ | ok | 200 | 1 |
| https://books.toscrape.com/catalogue/category/books_1/ind... | https://books.toscrape.com/ | ok | 200 | 1 |
| https://books.toscrape.com/index.html | https://books.toscrape.com/ | ok | 200 | 1 |

#### Copy-paste inputs

**1. Audit a site and list only broken links**

```json
{
  "urlInicio": "https://books.toscrape.com",
  "maxPaginas": 50,
  "profundidad": 3,
  "soloProblemas": true,
  "maxEnlaces": 1000
}
```

**2. Weekly monitor: only new or changed problems**

```json
{
  "urlInicio": "https://example.com",
  "usarSitemap": true,
  "soloProblemas": true,
  "modoVigilancia": true
}
```

#### Call it from your code (Apify API)

```bash
curl -X POST "https://api.apify.com/v2/acts/Flets_sv~broken-link-checker/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urlInicio": "https://books.toscrape.com", "maxPaginas": 50, "profundidad": 3, "soloProblemas": true, "maxEnlaces": 1000}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("Flets_sv/broken-link-checker").call(run_input={"urlInicio": "https://books.toscrape.com", "maxPaginas": 50, "profundidad": 3, "soloProblemas": true, "maxEnlaces": 1000})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

No code? Use the Apify modules for **Make** and **Zapier** (run the Actor, then fetch dataset items), or the **Google Sheets** integration in the Actor's Integrations tab to append each run to a sheet.

# Actor input Schema

## `urlInicio` (type: `string`):

Website to crawl (same host only).

## `maxPaginas` (type: `integer`):

Pages of your site to open and extract links from.

## `profundidad` (type: `integer`):

Link depth from the start URL.

## `comprobarExternos` (type: `boolean`):

Also check links pointing to other domains (not crawled).

## `incluirRecursos` (type: `boolean`):

Also check `img`, stylesheet and script URLs.

## `soloEstasUrls` (type: `array`):

If set, no crawling: just check these URLs.

## `usarSitemap` (type: `boolean`):

Read sitemap.xml (from robots.txt or /sitemap.xml) to find pages.

## `soloProblemas` (type: `boolean`):

Output only broken links, errors and redirect chains (2+ hops). All checked links are still charged.

## `modoVigilancia` (type: `boolean`):

Remember what was seen in previous runs (key-value store) and output only new or changed broken links. Use it with a schedule for alerts.

## `maxEnlaces` (type: `integer`):

Hard limit of links checked per run. Protects your budget.

## `concurrencia` (type: `integer`):

Parallel requests. Keep it low to be polite with the source.

## Actor input object example

```json
{
  "urlInicio": "https://books.toscrape.com",
  "maxPaginas": 5,
  "profundidad": 5,
  "comprobarExternos": true,
  "incluirRecursos": false,
  "soloEstasUrls": [],
  "usarSitemap": true,
  "soloProblemas": true,
  "modoVigilancia": false,
  "maxEnlaces": 300,
  "concurrencia": 5
}
```

# Actor output Schema

## `resultados` (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 = {
    "urlInicio": "https://books.toscrape.com",
    "maxPaginas": 5,
    "maxEnlaces": 300
};

// Run the Actor and wait for it to finish
const run = await client.actor("flets_sv/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 = {
    "urlInicio": "https://books.toscrape.com",
    "maxPaginas": 5,
    "maxEnlaces": 300,
}

# Run the Actor and wait for it to finish
run = client.actor("flets_sv/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 '{
  "urlInicio": "https://books.toscrape.com",
  "maxPaginas": 5,
  "maxEnlaces": 300
}' |
apify call flets_sv/broken-link-checker --silent --output-dataset

```

## MCP server setup

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