# Redirect Tracer (`autoloom/redirect-tracer`) Actor

Follow and report the full redirect chain for a list of URLs — every hop's status code and Location, the final URL and status, the redirect count, and audit flags: http->https, redirect loops, mixed 301/302, and chains that end in a 4xx/5xx.

- **URL**: https://apify.com/autoloom/redirect-tracer.md
- **Developed by:** [Autoloom](https://apify.com/autoloom) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 results

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 Checker & Redirect Chain Tracer

**Redirect Tracer** is a bulk redirect checker. For any list of URLs it follows the **full redirect chain**, recording every hop's status code (301, 302, 307, 308) and `Location`, plus the final URL. It also **flags the problems worth fixing**: loops, mixed 301/302 chains, chains that end on a dead page, and too many hops. Use it for site migrations, 301 redirect audits, and checking that old links still land in the right place.

> **Pricing:** pay per result: $1.50 per 1,000 results ($0.15 per 100, $15.00 per 10,000), plus $0.00005 per run start. One result = one URL checked.

### What data you get (one row per URL)

| Field | What it is |
|---|---|
| `url` | The URL you gave |
| `chain` | Every hop: `{ hop, url, status, location }` |
| `finalUrl`, `finalStatus` | Where the chain ends, and that page's HTTP status |
| `redirectCount` | Number of redirects followed |
| `flags.httpToHttps` | The chain upgrades from HTTP to HTTPS |
| `flags.loop` | A redirect loop was detected (a URL repeats) |
| `flags.mixed301And302` | The chain mixes permanent (301) and temporary (302) redirects, often a mistake |
| `flags.endsIn4xx5xx` | The chain ends on an error page |
| `flags.hitMaxHops` | The chain was cut off at **Max redirects to follow** |

### How to use it

1. Paste your URLs into **URLs** (one per line, or upload a list).
2. Optionally change **Max redirects to follow** (default 20, maximum 50).
3. Click **Start**, then export to CSV or Excel, or read the results through the API.

### Input example

```json
{
  "startUrls": [
    { "url": "http://google.com" },
    { "url": "https://example.com/old-page" }
  ],
  "maxHops": 20
}
```

### Output example

A real row from a test run (14 Oct 2026):

```json
{
  "url": "http://google.com",
  "chain": [
    { "hop": 1, "url": "http://google.com", "status": 301, "location": "http://www.google.com/" },
    { "hop": 2, "url": "http://www.google.com/", "status": 302, "location": "https://www.google.com/?gws_rd=ssl" },
    { "hop": 3, "url": "https://www.google.com/?gws_rd=ssl", "status": 200, "location": null }
  ],
  "finalUrl": "https://www.google.com/?gws_rd=ssl",
  "finalStatus": 200,
  "redirectCount": 2,
  "flags": {
    "httpToHttps": true,
    "loop": false,
    "mixed301And302": true,
    "endsIn4xx5xx": false,
    "hitMaxHops": false
  }
}
```

### Pricing

| URLs checked | Cost |
|---|---|
| 100 | $0.15 |
| 1,000 | $1.50 |
| 10,000 | $15.00 |

One result per URL, plus $0.00005 per run start. Apify's free plan includes monthly platform credit you can use to try it, and free-plan users get the same features.

### Use it with the API, Make, Zapier or Google Sheets

```bash
curl -X POST "https://api.apify.com/v2/acts/autoloom~redirect-tracer/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"http://google.com"}]}'
```

Connect it to Google Sheets, Make, Zapier or n8n through Apify's integrations, or schedule it after a migration to re-check every old URL weekly.

### FAQ

**Does it follow JavaScript or meta-refresh redirects?** No. It follows HTTP redirects (3xx status codes with a `Location` header), which is what search engines treat as redirects. A page that redirects only with JavaScript shows as a 200 with no further hops.

**What request does it send?** A normal GET request for each hop, with redirects followed one at a time so every hop is recorded. Each request has a 15-second timeout and one retry.

**What counts as a loop?** Any URL that appears twice in the same chain.

**Why flag mixed 301 and 302?** A 302 says the move is temporary, so search engines may keep the old URL indexed. In a migration you usually want every hop to be a 301 (or 308).

**Is it legal?** It requests publicly available URLs, the same way a browser does. Only check sites you have the right to access.

### Related tools from autoloom

- [Broken Link Checker](https://apify.com/autoloom/broken-link-checker): finds 404s and dead links across a site
- [Sitemap & URL Extractor](https://apify.com/autoloom/sitemap-url-extractor): pulls every URL a site publishes, ready to feed into this checker
- [HTTP Security Headers Checker](https://apify.com/autoloom/http-security-headers-checker): grades each site's security headers

***

Built by **autoloom**: small, fast web-data and SEO tools.

# Actor input Schema

## `startUrls` (type: `array`):

The URLs whose redirects you want to trace.

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

Stop after this many redirects (protects against loops).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "http://google.com"
    }
  ],
  "maxHops": 20
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per URL: the full redirect chain (each hop's status + location), the final URL and status, and audit flags.

# 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 = {
    "startUrls": [
        {
            "url": "http://google.com"
        }
    ],
    "maxHops": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("autoloom/redirect-tracer").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 = {
    "startUrls": [{ "url": "http://google.com" }],
    "maxHops": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("autoloom/redirect-tracer").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 '{
  "startUrls": [
    {
      "url": "http://google.com"
    }
  ],
  "maxHops": 20
}' |
apify call autoloom/redirect-tracer --silent --output-dataset

```

## MCP server setup

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

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/LGVFe7Iu0Lw7uQEer/builds/3tuKXxL43ScVb90ZU/openapi.json
