# Affiliate Link Health & Disclosure Auditor (`kayorama/affiliate-link-health-auditor`) Actor

Audit public publisher pages for broken affiliate links, tracking redirects, missing sponsored/noopener attributes, and missing affiliate disclosures.

- **URL**: https://apify.com/kayorama/affiliate-link-health-auditor.md
- **Developed by:** [Kayorama](https://apify.com/kayorama) (community)
- **Categories:** SEO tools, Marketing, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 publisher page processing attempteds

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/platform/actors/running/actors-in-store#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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use 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

## Affiliate Link Health & Disclosure Auditor

Audit public publisher pages for affiliate-link failures, redirect risks, missing sponsored attributes, and missing disclosures. The Actor is designed for affiliate publishers, SEO agencies, and content teams that need repeatable JSON/CSV-ready findings rather than a generic broken-link crawl.

### What it checks

- Affiliate destinations that return broken or server-error responses
- Redirect chains that lose recognized tracking parameters
- HTTPS links that downgrade to HTTP
- Excessive redirect chains
- Automated checks blocked by `401`, `403`, or `429` — reported as **manual verification required**, not falsely called broken
- Known bot-sensitive affiliate redirectors — reported as **inconclusive** when an automated `404` is not reliable proof
- Affiliate links missing `rel="sponsored"`
- New-tab links missing the explicit `rel="noopener"` hardening attribute
- Pages with affiliate links but no explicit disclosure phrase in parsed HTML text
- Publisher pages that fail or return a non-HTML response

### Quick start

```json
{
  "startUrls": [{ "url": "https://publisher.example/reviews/" }],
  "maxPages": 100,
  "maxAffiliateLinks": 1000,
  "concurrency": 5,
  "requestTimeoutSecs": 20,
  "sameDomainOnly": true,
  "affiliatePatterns": ["partner.example/click"]
}
````

#### Input reference

| Field | Default | Purpose |
|---|---:|---|
| `startUrls` | required | Public HTTP(S) pages where crawling starts |
| `maxPages` | `50` | Maximum publisher pages, capped at 500 |
| `maxAffiliateLinks` | `1000` | Maximum unique destinations, capped at 5,000 |
| `concurrency` | `5` | Parallel destination checks, capped at 20 |
| `requestTimeoutSecs` | `20` | Per-request timeout, 5–60 seconds |
| `sameDomainOnly` | `true` | Keep discovered publisher pages on start hostnames |
| `affiliatePatterns` | `[]` | Up to 100 case-insensitive URL substrings for private networks |

The Actor recognizes common affiliate networks, Amazon links containing `tag`, common external affiliate query parameters, and internal `/go/`, `/out/`, or `/recommends/` redirect paths.

### Output

Every dataset row is either a finding or the final `audit_summary` row.

```json
{
  "type": "tracking_parameter_loss",
  "severity": "high",
  "pageUrl": "https://publisher.example/best-tools/",
  "affiliateUrl": "https://network.example/click?aff_id=123",
  "finalUrl": "https://merchant.example/product",
  "httpStatus": 302,
  "finalHttpStatus": 200,
  "redirectCount": 1,
  "trackingParametersLost": true
}
```

The summary contains:

- `pagesAttempted`, `pagesAnalyzed`, and `pageFetchErrors`
- `pagesScanned` (compatibility alias for successfully analyzed pages)
- `stoppedBySpendingLimit`
- `uniqueAffiliateLinksChecked`
- `affiliateLinkLimitReached`
- `totalIssues`
- `issuesBySeverity`
- `issuesByType`

Export the default dataset as JSON, CSV, Excel, XML, RSS, or connect it to Apify schedules, webhooks, and integrations.

### How to interpret results

| Finding | Meaning |
|---|---|
| `broken_affiliate_link` | Final destination returned a reliable 4xx/5xx response |
| `unreachable_affiliate_link` | DNS, connection, timeout, or URL-safety failure prevented verification |
| `automated_check_blocked` | Destination rejected automation; verify manually |
| `automated_check_inconclusive` | A bot-sensitive redirector returned a response that is not reliable proof of failure |
| `tracking_parameter_loss` | Recognized tracking parameters disappeared during redirects |
| `insecure_redirect` | An HTTPS link redirected to HTTP |
| `excessive_redirect_chain` | More than three redirects were observed |
| `missing_rel_sponsored` | At least one matching link on the page lacks `sponsored` |
| `missing_rel_noopener` | At least one matching new-tab link lacks the explicit `noopener` hardening attribute |
| `missing_affiliate_disclosure` | Affiliate links were found without an explicit phrase in parsed HTML text; rendered prominence still requires human review |

### Security and privacy

- Public HTTP(S) pages only
- Embedded URL credentials are rejected
- Localhost, private IP ranges, link-local addresses, and hostnames resolving to private addresses are blocked to reduce SSRF risk
- Redirects are bounded and revalidated
- Publisher response bodies are capped at 5 MB
- The Actor does not bypass login, CAPTCHAs, paywalls, or bot controls
- No customer credentials, cookies, or authentication headers are requested
- Input and output remain in the user's Apify run storage and follow the retention/settings of that Apify account

See [PRIVACY.md](PRIVACY.md) for the complete data-handling statement.

### Pricing

Planned launch pricing is pay per event:

- `apify-actor-start`: Apify's recommended default start price
- `page-processed`: one charge immediately before each publisher-page processing attempt, including an attempt that ends in a fetch error
- No `apify-default-dataset-item` charge, preventing double billing for findings

The Actor stops before unpaid page work when the run spending cap rejects another event.

### Limitations

- Automated checks can be blocked or receive different responses than a human browser
- Disclosure detection is heuristic and currently targets explicit English and Dutch phrases in server-rendered HTML. It does not prove rendered visibility, proximity, or legal prominence
- Tracking-loss detection covers recognized query keys; server-side attribution cannot be observed
- JavaScript-only links that are absent from server-rendered HTML are not discovered
- A clean scan is not legal advice, a guarantee of affiliate attribution, or a complete compliance audit

### Support

Email **info@kayorama.nl** with the Actor run ID, the affected public URL, and the finding type. Do not send passwords, cookies, private-page content, or API tokens.

# Actor input Schema

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

Public pages where crawling starts.

## `maxPages` (type: `integer`):

Safety cap for publisher pages crawled in one run, from 1 to 500.

## `maxAffiliateLinks` (type: `integer`):

Safety cap for unique affiliate destinations checked in one run, from 1 to 5,000.

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

Maximum number of destination links checked at the same time.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for each page or destination request before reporting it as unreachable.

## `sameDomainOnly` (type: `boolean`):

When enabled, discover pages only on the same hostname as each start URL.

## `affiliatePatterns` (type: `array`):

Case-insensitive non-empty URL substrings used to recognize custom networks.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://example.com"
    }
  ],
  "maxPages": 50,
  "maxAffiliateLinks": 1000,
  "concurrency": 5,
  "requestTimeoutSecs": 20,
  "sameDomainOnly": true,
  "affiliatePatterns": []
}
```

# 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": "https://example.com"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kayorama/affiliate-link-health-auditor").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": "https://example.com" }] }

# Run the Actor and wait for it to finish
run = client.actor("kayorama/affiliate-link-health-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": "https://example.com"
    }
  ]
}' |
apify call kayorama/affiliate-link-health-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=kayorama/affiliate-link-health-auditor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Affiliate Link Health & Disclosure Auditor",
        "description": "Audit public publisher pages for broken affiliate links, tracking redirects, missing sponsored/noopener attributes, and missing affiliate disclosures.",
        "version": "1.1",
        "x-build-id": "xziO8Rf4ne3CKkhLH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/kayorama~affiliate-link-health-auditor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-kayorama-affiliate-link-health-auditor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/kayorama~affiliate-link-health-auditor/runs": {
            "post": {
                "operationId": "runs-sync-kayorama-affiliate-link-health-auditor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/kayorama~affiliate-link-health-auditor/run-sync": {
            "post": {
                "operationId": "run-sync-kayorama-affiliate-link-health-auditor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "minItems": 1,
                        "maxItems": 50,
                        "type": "array",
                        "description": "Public pages where crawling starts.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "title": "URL",
                                    "description": "Public HTTP(S) page where crawling starts.",
                                    "type": "string"
                                }
                            },
                            "required": [
                                "url"
                            ],
                            "additionalProperties": true
                        }
                    },
                    "maxPages": {
                        "title": "Maximum pages",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Safety cap for publisher pages crawled in one run, from 1 to 500.",
                        "default": 50
                    },
                    "maxAffiliateLinks": {
                        "title": "Maximum unique affiliate links",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Safety cap for unique affiliate destinations checked in one run, from 1 to 5,000.",
                        "default": 1000
                    },
                    "concurrency": {
                        "title": "Concurrent link checks",
                        "minimum": 1,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum number of destination links checked at the same time.",
                        "default": 5
                    },
                    "requestTimeoutSecs": {
                        "title": "Request timeout (seconds)",
                        "minimum": 5,
                        "maximum": 60,
                        "type": "integer",
                        "description": "Maximum time to wait for each page or destination request before reporting it as unreachable.",
                        "default": 20
                    },
                    "sameDomainOnly": {
                        "title": "Crawl same domain only",
                        "type": "boolean",
                        "description": "When enabled, discover pages only on the same hostname as each start URL.",
                        "default": true
                    },
                    "affiliatePatterns": {
                        "title": "Additional affiliate URL patterns",
                        "maxItems": 100,
                        "type": "array",
                        "description": "Case-insensitive non-empty URL substrings used to recognize custom networks.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        },
                        "default": []
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
