# Redirect Chain Checker: Bulk URLs, Loops, Migration Mapping (`variegated_binturong/redirect-chain-checker-migration`) Actor

Check redirects for thousands of URLs at once. See every hop with its status code, the final URL, loops, long chains, temporary redirects and meta refresh, and verify an old -> new migration map in one run.

- **URL**: https://apify.com/variegated_binturong/redirect-chain-checker-migration.md
- **Developed by:** [Luigi Fiano](https://apify.com/variegated_binturong) (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

$1.00 / 1,000 url 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

## Redirect Chain Checker: Bulk URLs, Loops, Migration Mapping

Check the redirects of hundreds or thousands of URLs in one run. For every URL you get each hop with its status code, the final URL and status, and a plain list of problems: loops, long chains, temporary redirects, meta refresh, HTTPS to HTTP downgrades and broken destinations.

Moving a site? Paste your redirect map as `old -> new` lines and the Actor tells you, line by line, whether each old URL really lands on the new one.

### What it is for

- **Site migrations and redesigns**: verify the whole 301 map before and after launch.
- **SEO audits**: find chains (A > B > C) that waste crawl budget and dilute links, and 302s that should be 301s.
- **Link and ad checks**: confirm that campaign links, short links and affiliate links still end on a live page.
- **Monitoring**: schedule it daily and get only the URLs that broke (`onlyProblems`).

### Input

| Field | What it does | Default |
|---|---|---|
| `urls` | One URL per line, or `old -> expected` pairs (comma or tab also work) | required |
| `maxHops` | Stop after this many redirects | 10 |
| `followMetaRefresh` | Follow HTML meta refresh redirects too | true |
| `ignoreTrailingSlash` / `ignoreQuery` | How strict the expected-URL match is | true / false |
| `onlyProblems` | Output only URLs with an issue | false |
| `concurrency`, `timeoutSecs`, `maxRetries` | Speed and resilience | 10, 20, 2 |

Example:

```json
{
  "urls": [
    "http://apify.com",
    "https://old-shop.example.com/product-1 -> https://shop.example.com/products/1"
  ]
}
```

### Output

One row per URL. The table view shows the summary; the JSON has the full chain.

```json
{
  "inputUrl": "http://apify.com",
  "expectedUrl": null,
  "finalUrl": "https://apify.com/",
  "finalStatus": 200,
  "matchesExpected": null,
  "hops": 1,
  "statusChain": "301 > 200",
  "ok": true,
  "issues": [],
  "chain": [
    { "url": "http://apify.com/", "status": 301, "location": "https://apify.com/", "type": "http", "ms": 85 },
    { "url": "https://apify.com/", "status": 200, "location": null, "type": "final", "ms": 140 }
  ],
  "totalMs": 225,
  "checkedAt": "2026-10-26T00:00:00.000Z"
}
```

Issues the Actor can flag: `redirect loop`, `too many hops`, `redirect chain (N hops)`, `temporary redirect (302/303/307)`, `meta refresh redirect`, `https to http downgrade`, `final status 404` (or any 4xx/5xx), `final URL does not match expected URL`, `error: timeout` and other network errors.

A `SUMMARY` record in the key-value store counts checked, ok, loops, chains, broken and mismatched URLs.

### Pricing

Pay per result: **$0.001 per URL delivered** to the dataset ($1 per 1,000 URLs), plus the small Apify platform usage of the run. With `onlyProblems` on, clean URLs are not delivered and not charged.

### Notes

- It requests each URL with a normal GET and does not follow redirects automatically, so every hop is seen as the server sends it.
- It reads only the public HTTP response of the URLs you provide. No login, no cookies, no personal data.
- JavaScript redirects (window.location) are not executed.

# Actor input Schema

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

One URL per line. To verify a migration, write the old URL and the expected new URL on the same line: "https://old.example.com/page -> https://new.example.com/page" (a comma or a tab works too).

## `maxHops` (type: `integer`):

Stop following after this many redirects and flag "too many hops".

## `followMetaRefresh` (type: `boolean`):

Also follow <meta http-equiv="refresh"> redirects in HTML pages.

## `ignoreTrailingSlash` (type: `boolean`):

Treat /page and /page/ as the same URL when comparing the final URL with the expected one.

## `ignoreQuery` (type: `boolean`):

Ignore ?utm=... and other query parameters when comparing with the expected URL.

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

Skip URLs that resolve cleanly in one hop or less. You only pay for rows that are delivered.

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

How many URLs are checked at the same time.

## `timeoutSecs` (type: `integer`):

Give up on a request after this many seconds.

## `maxRetries` (type: `integer`):

How many times a request is retried after a timeout, a 429 or a 5xx response.

## `maxUrls` (type: `integer`):

Safety cap on the number of input lines processed.

## Actor input object example

```json
{
  "urls": [
    "http://apify.com",
    "https://example.com -> https://example.com/"
  ],
  "maxHops": 10,
  "followMetaRefresh": true,
  "ignoreTrailingSlash": true,
  "ignoreQuery": false,
  "onlyProblems": false,
  "concurrency": 10,
  "timeoutSecs": 20,
  "maxRetries": 2,
  "maxUrls": 10000
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `results` (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 = {
    "urls": [
        "http://apify.com",
        "https://example.com -> https://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("variegated_binturong/redirect-chain-checker-migration").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 = { "urls": [
        "http://apify.com",
        "https://example.com -> https://example.com/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("variegated_binturong/redirect-chain-checker-migration").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 '{
  "urls": [
    "http://apify.com",
    "https://example.com -> https://example.com/"
  ]
}' |
apify call variegated_binturong/redirect-chain-checker-migration --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,variegated_binturong/redirect-chain-checker-migration"
        }
    }
}
```

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/qP4UtFIjpAS42sJMg/builds/P1K4mrG0HftICKhCf/openapi.json
