# Redirect Checker - Bulk Redirect Chains & Migration Map (`extas_corp/redirect-checker`) Actor

Check redirect chains of thousands of URLs: every hop with status code (301, 302, 307, 308), final URL, loops, HTTPS downgrades, too-long chains. Validate a site migration redirect map (old URL -> expected new URL). No login, no browser. Pay per URL.

- **URL**: https://apify.com/extas_corp/redirect-checker.md
- **Developed by:** [Extas Corp](https://apify.com/extas_corp) (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

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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 Checker: Bulk Redirect Chains & Migration Map Validator

Paste a list of URLs and get **every hop of every redirect chain**: status codes (301, 302, 303, 307, 308), the `Location` of each hop, the final URL and its status. Or paste your **site migration redirect map** (`old URL -> expected new URL`) and see at a glance which redirects are missing, broken or point to the wrong page.

No login, no browser, no proxies: plain HTTP requests, headers only (page bodies are never downloaded), so it is fast and cheap.

- Full chain per URL, e.g. `301 > 302 > 200`, with the URL and `Location` of each hop
- SEO warnings: chains longer than 1 hop, temporary redirects (302/303/307) where a 301/308 is expected, HTTPS to HTTP downgrades, redirect loops, too many redirects
- **Migration validation**: `matchesExpected` is true only when the chain ends on your expected URL with a 200
- DNS, TLS and timeout errors are reported per URL, they never stop the run
- One `ok` column to filter on: final status < 400, no loop, and expected target matched (if given)
- Parallel checks (up to 50 at once), custom User-Agent to test bot-specific redirects
- **Pay per URL checked**, see the Pricing tab.

### Input examples

Simple list:

```json
{ "urls": ["http://example.com", "example.com/old-page", "https://bit.ly/3xyz"] }
```

Migration redirect map (paste two columns from a spreadsheet, or use `->`). The expected target can be a full URL or a path:

```json
{ "urls": [
    "https://old-shop.com/product/42 -> https://new-shop.com/p/blue-shoes",
    "https://old-shop.com/about -> /company",
    "https://old-shop.com/contact\thttps://new-shop.com/contact"
] }
```

### Example output

```json
{
  "url": "http://apify.com",
  "finalUrl": "https://apify.com/",
  "finalStatusCode": 200,
  "redirectCount": 1,
  "chain": [
    { "url": "http://apify.com", "statusCode": 301, "location": "https://apify.com/" },
    { "url": "https://apify.com/", "statusCode": 200, "location": null }
  ],
  "statusChain": "301 > 200",
  "timeMs": 281,
  "warnings": [],
  "error": null,
  "expectedUrl": "https://apify.com/",
  "matchesExpected": true,
  "ok": true
}
```

URL comparison for `matchesExpected` ignores case of scheme and host, default ports, a trailing slash and the `#fragment`; the query string must match.

### Use cases

- **Site migrations and redesigns**: validate hundreds of old -> new redirects before and after launch
- **SEO audits**: find redirect chains, 302s that should be 301s, loops and redirects to 404 pages
- **Link checking**: expand short links (bit.ly, t.co, ...) and affiliate links to their real destination
- **Monitoring**: schedule the Actor daily and alert (Make, Zapier, n8n, webhooks) when `ok` becomes false

### Integrations

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("extas_corp/redirect-checker").call(run_input={"urls": ["http://example.com"]})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["url"], item["statusChain"], item["finalUrl"])
```

Results can be exported as CSV, Excel or JSON from the dataset, or pushed to Google Sheets, Make, Zapier or n8n.

### FAQ

**Does it render JavaScript or follow meta refresh redirects?** No. It checks HTTP redirects (the `Location` header), which is what search engines treat as real redirects. JavaScript and `<meta refresh>` redirects are not followed.

**Is it a GET or a HEAD request?** GET, because many servers answer HEAD differently. Only the headers are read; the body is not downloaded.

**Can it check sites behind a login or a bot wall?** No. It sends normal anonymous requests. Sites that block bots may answer 403 or 429; this is reported as is.

**Do I need to pay to try it?** The Apify Free plan includes monthly platform credit, enough to check thousands of URLs.

# Actor input Schema

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

One URL per line. To validate a migration redirect map, write 'old-url -> expected-new-url' (or separate them with a tab, e.g. pasted from a spreadsheet). The expected target may be a path like /new-page.

## `maxRedirects` (type: `integer`):

Stop following after this many hops (1-30).

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

How many URLs are checked at the same time (1-50). Lower it to be gentle with a single site.

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

Give up on a URL hop after this many seconds.

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

Optional custom User-Agent header (e.g. to test bot-specific redirects).

## Actor input object example

```json
{
  "urls": [
    "http://github.com",
    "http://apify.com -> https://apify.com/",
    "https://httpbin.org/redirect/2"
  ],
  "maxRedirects": 10,
  "concurrency": 10,
  "timeoutSecs": 20
}
```

# 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 = {
    "urls": [
        "http://github.com",
        "http://apify.com -> https://apify.com/",
        "https://httpbin.org/redirect/2"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("extas_corp/redirect-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 = { "urls": [
        "http://github.com",
        "http://apify.com -> https://apify.com/",
        "https://httpbin.org/redirect/2",
    ] }

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

```

## MCP server setup

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