# Redirect Checker: 301 Redirect Chains, Hop by Hop (`ucchiii/redirect-checker`) Actor

Check where your URLs redirect: every hop with its status code and Location header, the final URL and status, the number of hops, redirect loops, http to https and www changes. Only the URLs you give are checked, no crawling. Empty input runs a free demo.

- **URL**: https://apify.com/ucchiii/redirect-checker.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.21 / 1,000 checked urls

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 checker for lists of URLs: follow every redirect hop by hop and see the full chain.**

Paste URLs (or pick a dataset), press **Start**, and get one row per URL with every hop's HTTP status code and raw `Location` header, the final URL and status, the number of hops, redirect loops, and whether the chain moved from http to https or added or removed `www`. Made for **site migrations** (verify your 301 map), **SEO audits** (find chains, temporary redirects and loops) and checking short links before you publish them.

**Try it free:** leave the input empty and press **Start** — a few sample URLs are checked (not charged, rows carry `_demo: true`).

### What you get

| url | statusChain | hops | finalUrl | httpToHttps | wwwChange | loop |
|---|---|---|---|---|---|---|
| http://example.com/old | 301 > 302 > 200 | 2 | https://www.example.com/new | true | added | false |
| https://shop.example/a | 302 > 307 | 2 | https://shop.example/a | false | null | true |
| https://example.com/ | 200 | 0 | https://example.com/ | false | null | false |

Each row also has the full `chain`:

```json
[
  {"step": 1, "url": "http://example.com/old", "statusCode": 301, "redirectType": "permanent",
   "location": "https://example.com/old", "nextUrl": "https://example.com/old"},
  {"step": 2, "url": "https://example.com/old", "statusCode": 302, "redirectType": "temporary",
   "location": "https://www.example.com/new", "nextUrl": "https://www.example.com/new"},
  {"step": 3, "url": "https://www.example.com/new", "statusCode": 200, "redirectType": null,
   "location": null, "nextUrl": null}
]
```

### How to use

1. **URLs**: full URLs with `http://` or `https://`, one per line — or **a dataset** and the name of its URL field.
2. Optional: **Maximum hops** (default 10), **Request method** (HEAD then GET, or GET only), timeout, concurrency, User-Agent.

```json
{
  "urls": ["http://example.com/old-page", "https://example.com/blog/2019/post"],
  "maxRedirects": 10,
  "method": "auto"
}
```

### Output fields

- `url`, `finalUrl`, `finalStatusCode` — what you asked for and where it ended
- `hops`, `redirected`, `statusChain` (`301 > 302 > 200`) — how long the chain is
- `chain` — every hop: `step`, `url`, `statusCode`, `redirectType` (`permanent` for 301/308, `temporary` for 302/303/307), `location` (the raw header, relative or absolute) and `nextUrl` (resolved)
- `loop` — a redirect pointed back to a URL already in the chain (`error: redirect_loop`)
- `httpToHttps`, `httpsToHttp`, `wwwChange` (`added` / `removed`), `hostChanged`, `hasTemporaryRedirect`
- `responseTimeMs`, `checkedAt`, `error` (`too_many_redirects`, `invalid_redirect_url`, `redirect_to_private_address`, `timeout`, `dns_failure`, ...)
- **STATS** record: URLs checked and charged, redirected, loops, errors, counts by hops and by final status

### Limits (cannot be raised by input)

- Up to 10,000 URLs per run; at most 20 hops per URL; 60 seconds per request at most
- Only HTTP redirects (3xx with a `Location` header). JavaScript and `<meta refresh>` redirects are not followed, because page bodies are never downloaded
- Polite by design: at most 2 connections per host and at least 0.2 s between requests to the same host
- URLs that resolve to internal addresses (localhost, private ranges, 169.254.169.254) are never contacted, also when a redirect points there
- Set a maximum charge per run to cap spend: the run stops cleanly when it is reached and keeps the rows found so far

### Pricing

Pay per event: **$0.0003 per checked URL** ($0.30 per 1,000 URLs), no start fee. A URL is charged only when its chain was followed to the end, to a loop or to the hop limit. Invalid, blocked and unreachable URLs (DNS failure, timeout) and the demo are free.
Store discounts apply automatically: BRONZE −10%, SILVER −20%, GOLD −30%.
On the Apify Free plan, the $5 of monthly platform credit covers about 16,666 URLs a month.

### FAQ

**Why HEAD first?** It is the lightest request and most servers redirect HEAD the same way as GET. When a server refuses HEAD (405 or 501), the same hop is repeated with GET. Choose **GET only** if a site answers HEAD differently.

**Does it crawl my site?** No. Only the URLs you give and the redirects they answer with are requested.

**Can I check a migration map?** Yes: put the old URLs in, then compare `finalUrl` with the new URLs in a spreadsheet. `hasTemporaryRedirect` and `hops > 1` show the redirects worth fixing.

**I need status codes and response times for all pages, not just redirects.** Use the Bulk URL Status Checker from the same developer.

### More tools from the same developer

- [Bulk URL Status Checker](https://apify.com/ucchiii/url-status-checker) — bulk HTTP status and redirect-chain checker for URL lists
- [Sitemap URL Extractor](https://apify.com/ucchiii/sitemap-urls) — list every URL of a website from its sitemaps
- [Bulk HTTP Request](https://apify.com/ucchiii/bulk-http-request) — send many HTTP requests (GET/POST/...) from a list and collect status, headers and body

# Actor input Schema

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

Full URLs including http:// or https://, one per line. Only these URLs (and the redirects they answer with) are requested; nothing is crawled. Up to 10,000 URLs per run. Leave empty (and no dataset) for a free demo.

## `datasetId` (type: `string`):

Optional. Dataset whose items hold URLs, for example the output of a scraper or sitemap run. Added to the URLs above.

## `urlField` (type: `string`):

Name of the dataset field that holds the URL (default 'url').

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

Stop following after this many redirects and report too_many_redirects. 1 to 20 (default 10).

## `method` (type: `string`):

Default 'auto' sends HEAD and switches to GET when the server answers 405 or 501. Use 'GET' for servers that redirect HEAD and GET differently. Page bodies are never downloaded.

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

Timeout for each hop, 1 to 60 seconds (default 15).

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

How many URLs are checked in parallel, 1 to 20 (default 10). At most 2 connections per host, with at least 0.2 s between requests to the same host.

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

Optional custom User-Agent header. By default the requests name this Actor.

## Actor input object example

```json
{
  "urls": [
    "http://apify.com",
    "http://www.apify.com",
    "https://apify.com/store"
  ],
  "urlField": "url",
  "maxRedirects": 10,
  "method": "auto",
  "timeoutSecs": 15,
  "concurrency": 10
}
```

# Actor output Schema

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

One item per URL: every hop with status code and Location, final URL and status, hop count, loop, http to https and www changes.

## `stats` (type: `string`):

Record STATS: URLs checked and charged, redirected, loops, errors, counts by hops and by final status.

# 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",
        "http://www.apify.com",
        "https://apify.com/store"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/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://apify.com",
        "http://www.apify.com",
        "https://apify.com/store",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/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://apify.com",
    "http://www.apify.com",
    "https://apify.com/store"
  ]
}' |
apify call ucchiii/redirect-checker --silent --output-dataset

```

## MCP server setup

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