# Redirect Chain Tracer — HTTP Redirect Path & Hop Count API (`accountable_eel/redirect-chain-tracer`) Actor

Trace any URL's full HTTP redirect chain, hop by hop, to its final destination, including hop count and final status code. Useful for SEO audits, link migrations, and tracking-link verification. Billed for every URL that returns a response, including a no-redirect result.

- **URL**: https://apify.com/accountable\_eel/redirect-chain-tracer.md
- **Developed by:** [Adrian Voss](https://apify.com/accountable_eel) (community)
- **Categories:** Lead generation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 successful lookups

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Redirect Chain Tracer

Trace any URL's full HTTP redirect chain, hop by hop, to its final destination —
every intermediate URL, the total hop count, and the final HTTP status code. This
uses the same HTTP client Crawlee's crawler runs on, so the whole chain is captured
in a single request; no second fetch or manual `Location`-header following needed.

### Features

- **Full hop-by-hop chain.** Every URL in the redirect sequence, from the one you
  submitted to the final destination, in order.
- **Hop count & final status.** `hopCount` tells you how many redirects happened;
  `finalStatusCode` is the HTTP status the final URL actually returned.
- **"No redirect" is a real answer.** A URL that doesn't redirect still returns a
  useful result — a one-URL chain with `hopCount: 0`.
- **Deduped chain.** Consecutive repeated URLs in the raw redirect data are
  collapsed so the chain doesn't show the same destination twice.
- **Built for bulk.** Feed in a list of URLs; concurrency is configurable.

### How to use Redirect Chain Tracer — HTTP Redirect Path & Hop Count API

1. **In the Apify Console.** Open the actor page and click **Start** — the `items` field is already pre-filled with a working example. Results land in the run's dataset as soon as each item is found.
2. **Via the API.** Call it directly with a POST request — no Console needed once you have an API token:
   ```bash
   curl "https://api.apify.com/v2/acts/accountable_eel~redirect-chain-tracer/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
     -X POST \
     -H "Content-Type: application/json" \
     -d '{"items":["http://github.com"]}'
   ```
3. **On a schedule.** Save this actor as an Apify **Task** with the input you want, then add a **Schedule** (hourly, daily, weekly) so it runs on its own — no server of your own required.

### Input

```json
{
  "items": ["https://example.com/old-path"],
  "maxConcurrency": 5
}
```

`items` is a list of URLs to trace. A bare hostname or path without a scheme is
accepted — `https://` is prepended automatically. One dataset row is returned per
item. `maxConcurrency` controls how many requests run in parallel.

### Output

One row per URL, for example:

```json
{
  "query": "https://example.com/old-path",
  "found": true,
  "data": {
    "requestedUrl": "https://example.com/old-path",
    "finalUrl": "https://example.com/new-path",
    "hopCount": 2,
    "chain": [
      "https://example.com/old-path",
      "https://example.com/temp-redirect",
      "https://example.com/new-path"
    ],
    "finalStatusCode": 200
  },
  "scrapedAt": "2026-08-20T10:00:00.000Z"
}
```

Note the billing model here is different from most actors in this portfolio: a URL
that returns a response — including one with no redirect at all (`hopCount: 0`) — is
charged, because "this URL doesn't redirect" is a real, useful answer to the question
being asked. Only a request that fails outright (timeout, DNS failure, connection
error after retries) comes back as `"found": false` and free.

### Use cases

- **SEO redirect audits** — verify that old URLs 301-redirect to the right new
  destination after a site migration.
- **Link rot monitoring** — check a list of outbound links for broken or unexpected
  redirect chains.
- **Affiliate/tracking link verification** — confirm a shortened or tracking URL
  actually lands on the expected final destination.
- **Marketing campaign QA** — trace UTM-tagged campaign links before a launch to
  catch misconfigured redirects.
- **Site migration validation** — bulk-check that every old URL in a sitemap
  redirects correctly to its new equivalent.

### Pricing

$5 per 1,000 results, plus a $0.005 start fee. Misses (`found:false`) are never charged.

### Use it from Clay, n8n, Make, or an AI agent

This actor runs synchronously over plain HTTP — call it directly from a script, a workflow tool, or an AI agent, no Apify Console needed once you have an API token.

```bash
curl "https://api.apify.com/v2/acts/accountable_eel~redirect-chain-tracer/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"items":["http://github.com"]}'
```

**n8n.** Add an HTTP Request node: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~redirect-chain-tracer/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body Content Type `JSON`, JSON Body `{"items":["http://github.com"]}` (swap in an expression from an earlier node for a real value).

**Clay.** Add an "HTTP API" column: Method `POST`, URL `https://api.apify.com/v2/acts/accountable_eel~redirect-chain-tracer/run-sync-get-dataset-items?token=<YOUR_TOKEN>`, Body `{"items":["{{value}}"]}`, mapping the row's value into the `items` array.

**MCP.** In Claude, Cursor, or any MCP client with the Apify MCP server, ask for "Redirect Chain Tracer | Apify" — the agent will find and run this actor.

### FAQ

**Does a URL with no redirect cost anything?**
Yes — unlike most actors in this portfolio, "no redirect" is a valid, charged
result (`hopCount: 0`), because you got exactly the answer you asked for.

**What counts as a free miss, then?**
Only a request that fails outright after retries — a timeout, DNS failure, or
connection error — comes back `"found": false` and isn't charged.

**Does this follow meta-refresh or JavaScript redirects?**
No — it follows standard HTTP redirects (3xx responses with a `Location` header)
via the underlying HTTP client, not client-side redirects rendered by JavaScript or
`<meta http-equiv="refresh">` tags.

**What if I submit a bare domain without `https://`?**
It's normalized automatically — `example.com` becomes `https://example.com` before
the request is made.

**Can duplicate hops show up in the chain?**
No — consecutive repeated URLs (which can happen when the underlying redirect data
already includes the final URL) are deduplicated before being returned.

**Can I trace many URLs at once?**
Yes — pass a list of URLs and adjust `maxConcurrency` to control how many run in
parallel.

# Actor input Schema

## `items` (type: `array`):

One item per line — see the item shape and examples below. Only the items we actually find are charged — never per run, and never for a miss.

## `maxConcurrency` (type: `integer`):

Parallel requests. Keep conservative — this target has no browser fallback, so getting blocked costs more than slow-and-steady.

## `proxyConfiguration` (type: `object`):

Apify Proxy config. Residential recommended for anti-bot-sensitive targets.

## Actor input object example

```json
{
  "items": [
    "http://github.com"
  ],
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "items": [
        "http://github.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("accountable_eel/redirect-chain-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 = { "items": ["http://github.com"] }

# Run the Actor and wait for it to finish
run = client.actor("accountable_eel/redirect-chain-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 '{
  "items": [
    "http://github.com"
  ]
}' |
apify call accountable_eel/redirect-chain-tracer --silent --output-dataset

```

## MCP server setup

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