# Affiliate & Campaign Link Integrity Checker (`min.h/affiliate-campaign-link-integrity-checker`) Actor

Inspect authorized public links for HTTP redirects, required tracking parameter changes and unexpected destination domains. HTTP-only; values redacted.

- **URL**: https://apify.com/min.h/affiliate-campaign-link-integrity-checker.md
- **Developed by:** [Min. H](https://apify.com/min.h) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 41.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 completed url inspections

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

## Affiliate & Campaign Link Integrity Checker

Inspect public campaign or affiliate links that you are authorized to test. Check HTTP redirects, missing or changed query parameters, and unexpected final hostnames. Completed eligible unique URL inspections cost $0.003 each.

### What it checks

- HTTP status and 301/302/303/307/308 redirect chains.
- Case-sensitive required parameter names and decoded values; repeated values are compared as multisets, with blank values preserved.
- Required names missing from either the initial or final URL, and changed values.
- Optional exact final domain. `shop.example.com` is different from `example.com`.
- Duplicate URLs are inspected once per run (scheme/host/default-port/fragment normalization only; query order remains significant).
- JSON Dataset rows and CSV export, including explicit error, blocked, unknown and skipped states.

### Input

To try the Actor, restore the example input. It contains one public HTTP test URL reviewed by the publisher and does not follow redirects. If you change the example URLs, authorized domains, or redirect limit, verify your permission and select **I reviewed and am authorized to check the edited links and domains**. The example's prefilled confirmation cannot authorize those changes.

For API requests, use `examples/input.json` as the input structure. Set `accessAuthorized=true` only after verifying you may inspect the links under the target sites' terms. `authorizedDomains` must include **every redirect host**. Hostnames match exactly. Confirmation does not override robots or access restrictions.

Required: `urls`, `authorizedDomains`, `accessAuthorized`.
Optional: `requiredTrackingParams=[]`, `expectedFinalDomain`, `maxRedirects=5` (0–10), `maxUrls=100` (1–1000). The prefilled example adds a reference named `reviewedExample`; when using that example with edited targets or redirect limit, `customAccessAuthorized` must also be `true`.
At most 1,000 submitted URLs, 100 authorized domains and 30 required names. Expected domains contain no scheme, port or path.

**GET requests may be counted as clicks by affiliate/ad services.** Use authorized test links; the Actor does not submit forms or perform conversions. Do not use login, one-time, signed or secret-bearing URLs. Common token/signature/session/auth query names and URL userinfo are blocked before requests. Automated access permission and robots permission are separate obligations. Site terms cannot be interpreted automatically.

### Result contract

The requested fields are `inputUrl`, `finalUrl`, `statusCode`, `redirectChain`, `trackingParamsMissing`, `trackingParamsChanged`, `destinationMismatch`, `resultStatus`, `checkedAt`.

For privacy, **paths and all query values in output URLs are redacted**; hostnames and non-sensitive parameter names remain visible. These URLs are evidence labels, not replayable links. Correlate each result with the original submitted list using zero-based `inputIndex`. Keep secrets out of parameter names and hostnames too. Raw INPUT is stored by Apify in the customer's default KVS and must remain private; redaction does not sanitize that original INPUT.

Additional fields: `inspectionComplete`, `errorReason`, `evidenceScope`, `requestCount`, `billingStatus`.

- `OK`: observed terminal HTTP 2xx and the selected query/domain checks passed.
- `ERROR`: a completed 2xx inspection found a selected mismatch, or a non-success HTTP/loop error occurred. `inspectionComplete` distinguishes them.
- `BLOCKED`: unsafe URL/DNS, unauthorized host, robots denial, HTTP 401/403/429, or previously denied host.
- `UNKNOWN`: timeout, ambiguous redirects/headers, unsupported refresh, robots uncertainty, TLS/network failure or limit.
- `SKIPPED`: processing cap or event budget exhausted; no link request.
- `destinationMismatch=null`: no expected host was provided or final comparison was not completed.

`OK` does **not** verify JavaScript redirects, cookie attribution, conversions, commission credit, page content, soft 404, availability to other countries/devices, or a CAPTCHA served with HTTP 200. HTTP Refresh headers are marked UNKNOWN; body-based redirects are not detected. A query value disappearing may be intentional after a network stores a cookie: this product reports an observation, not proof of lost revenue.

### Network protection and limits

No browser, proxy, cookies, login, CAPTCHA bypass, POST/form submission, paid API or AI. Only HTTP(S), ports 80/443, public addresses. DNS answers are checked on every connection; if any answer is non-public the request is blocked. Validated numeric addresses are pinned by the connector, DNS cache and keepalive disabled, TLS verification enabled. Each redirect and robots redirect is separately checked against the authorized domains.

Robots: per-origin policy cache during the run; wildcard matching via Protego; 404/410 permits checking, 401/403/429 blocks, other failures are UNKNOWN. Unresolvable robots redirects, HTML masquerading as robots, excessive crawl delays and oversize/compressed robots are not silently treated as permission. Delay/request-rate directives are honored within time limits.

Targets: GET headers only; body is not consumed. Robots body ≤256 KiB; headers ≤32 KiB (individual line/field ≤8,190 bytes). HTTP request ≤10sec, link ≤60sec, processing ≤600sec; total run also depends on SDK initialization/final storage. Configure a platform timeout for deployment. Serial execution with ≥1sec per-host spacing, increased for robots. No network retries. Bound total requests; 429/401/403 blocks further access to the same host in the run.

### Billing policy and validation status

Event: `link-inspection-completed`. **Approved price: $0.003 per completed unique URL inspection.** No automatic start or Dataset charge events, no additional platform usage charges are intended in production. The single $0.003 event was configured by API. Publisher Console evidence previously confirmed no platform-cost pass-through. The prior 0.1.4 private integration test observed three $0.003 events and no additional events. That historical test is not a new maintenance/cloud QA test or proof of external customer billing.

A unique URL is eligible only after terminal 2xx comparison completes and its result is stored. Finding a missing/changed parameter or unexpected domain is a completed check, so it is eligible. HTTP errors (including 404/500), blocked, unknown, skipped and duplicate inputs are not eligible.

A per-Run journal records intent before storage and charge. Unknown storage/charge outcomes stop processing and are never automatically retried, even after restart. A pending record requires manual reconciliation; this favors avoiding duplicate charges over recovering every charge. No claim of atomic Dataset+PPE transaction or distributed exactly-once execution. Default results show `SEE_BILLING_AUDIT` for eligible rows; the private `BILLING-AUDIT` KVS record is authoritative after the operation. SDK `charged_count` is checked independently of accounting counters.

Cloud storage uses the official API client with retries disabled because the SDK's separate storage client otherwise retries writes. Runtime uses current Run/default resources only, checks authenticated access and anonymous denial, and supports Restricted or demonstrably restricted inherited settings. Seller policy is verified before deployment; omission/null of the optional usage-cost flag remains UNKNOWN under change control, while explicit `true` blocks. No Owner account lookup is required.

`release_policy.json` contains the approved $0.003 price but disables cloud execution. Seller verification evidence is preserved; cloudExecutionApproved=false in this local maintenance candidate. A separate deployment/run approval is required before enabling the execution copy. Real customer billing is NOT VERIFIED.

### Reproduce locally (Windows)

```powershell
.\.venv\Scripts\python.exe -m pytest -q
.\.venv\Scripts\python.exe scripts\local_demo.py --output reports\my-new-sdk-demo
```

The demo uses synthetic HTTP responses and real Apify **local** storage/charge handling. Its network sockets are blocked. Use a new output folder to preserve evidence. The fixture price `$0.005` is only a test value; the approved production price is $0.003. Apify 4.2 locally assigns $1 to unknown events, so the demo explicitly uses a zero-priced synthetic Dataset event. Those local counter entries are not production automatic-event or revenue evidence.

To inspect your authorized URLs locally without billing:

```powershell
.\.venv\Scripts\python.exe -m link_checker --input examples\your-input.json --storage reports\your-new-local-run
```

Local CLI uses no Apify credentials or remote billing. Preserve one storage folder per run; reusing a folder preserves its deduplication/uncertainty journal.

Fresh installation: Python 3.14, `python -m venv .venv`, then `.venv\Scripts\python.exe -m pip install -r requirements-dev.txt`. See `requirements-lock.txt` for the tested environment. Linux/Docker files are prepared but container execution is NOT RUN.

### Reviewed example

Apify runs marked `TEST` use bundled HTTP responses to check two redirects offline. The results show retained and missing tracking parameters, with `SYNTHETIC_FIXTURE` identifying both rows. These runs submit no charge events and never read Run INPUT. Regular runs use the existing authorization and private storage checks.

The build Schema supplies the exact `examples/maintenance-qa-input.json` as prefill: one documented GET request to the public HTTP client-testing service httpbingo.org, a synthetic tracking value, one allowed host, maxUrls=1 and maxRedirects=0. No real advertising campaign or customer data is used.

Permission basis: [official service](https://httpbingo.org/) documents the GET endpoint and query examples; its [upstream project](https://github.com/mccutchen/go-httpbin) links this hosted testing service. The publisher checked robots.txt on 2026-11-10: wildcard policy disallows /deny and permits this /get sample. The production checker rechecks robots and DNS at execution. This is a narrow public-service testing permission, not general permission for arbitrary paths, customer domains, or high-volume traffic.

# Actor input Schema

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

Public URLs you are authorized to inspect. Signed/login links are unsupported. GET may register a tracking click.

## `requiredTrackingParams` (type: `array`):

Case-sensitive names. Decoded values and repeated values are compared; values are not exported.

## `expectedFinalDomain` (type: `string`):

Optional exact hostname, without scheme, path or wildcard. Subdomains are not automatically equivalent.

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

Maximum HTTP redirects followed per URL, from 0 to 10. Default: 5. Each destination must pass authorization and network safety checks.

## `maxUrls` (type: `integer`):

Maximum unique input URLs inspected per run, from 1 to 1000. Default: 100. Duplicate URLs are inspected at most once.

## `authorizedDomains` (type: `array`):

Exact domains whose automated checks you may perform under their terms, including every redirect destination. No wildcards.

## `accessAuthorized` (type: `boolean`):

Required. Default is false. The prefilled true applies only to the unchanged, publisher-reviewed httpbingo.org example. If you edit the example URLs, authorized domains, or redirect limit, confirm permission for the edited input separately below. Does not override robots.txt or access denial.

## `reviewedExample` (type: `string`):

Identifies the reviewed example so its prefilled confirmation cannot be reused for edited targets.

## `customAccessAuthorized` (type: `boolean`):

Check only after you verify that you have permission to inspect the edited URLs and all allowed domains. Required when changing the reviewed example URLs, authorized domains, or redirect limit.

## Actor input object example

```json
{
  "urls": [
    "https://httpbingo.org/get?utm_source=actor002_example"
  ],
  "requiredTrackingParams": [
    "utm_source"
  ],
  "expectedFinalDomain": "httpbingo.org",
  "maxRedirects": 0,
  "maxUrls": 1,
  "authorizedDomains": [
    "httpbingo.org"
  ],
  "accessAuthorized": true,
  "reviewedExample": "httpbingo-get",
  "customAccessAuthorized": false
}
```

# Actor output Schema

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

No description

## `csv` (type: `string`):

No description

## `billingAudit` (type: `string`):

No description

## `summary` (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": [
        "https://httpbingo.org/get?utm_source=actor002_example"
    ],
    "requiredTrackingParams": [
        "utm_source"
    ],
    "expectedFinalDomain": "httpbingo.org",
    "maxRedirects": 0,
    "maxUrls": 1,
    "authorizedDomains": [
        "httpbingo.org"
    ],
    "accessAuthorized": true,
    "reviewedExample": "httpbingo-get"
};

// Run the Actor and wait for it to finish
const run = await client.actor("min.h/affiliate-campaign-link-integrity-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": ["https://httpbingo.org/get?utm_source=actor002_example"],
    "requiredTrackingParams": ["utm_source"],
    "expectedFinalDomain": "httpbingo.org",
    "maxRedirects": 0,
    "maxUrls": 1,
    "authorizedDomains": ["httpbingo.org"],
    "accessAuthorized": True,
    "reviewedExample": "httpbingo-get",
}

# Run the Actor and wait for it to finish
run = client.actor("min.h/affiliate-campaign-link-integrity-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": [
    "https://httpbingo.org/get?utm_source=actor002_example"
  ],
  "requiredTrackingParams": [
    "utm_source"
  ],
  "expectedFinalDomain": "httpbingo.org",
  "maxRedirects": 0,
  "maxUrls": 1,
  "authorizedDomains": [
    "httpbingo.org"
  ],
  "accessAuthorized": true,
  "reviewedExample": "httpbingo-get"
}' |
apify call min.h/affiliate-campaign-link-integrity-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,min.h/affiliate-campaign-link-integrity-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/GgUfrQpHJLuFolwce/builds/IVQwzuGmE6uR3QPWL/openapi.json
