# Link Attribute Auditor (`phoenix2810/link-attribute-auditor`) Actor

Audit one public page for anchor rel attributes, sponsored/nofollow/ugc usage, unsafe target blank links, and empty anchor text. Built for SEO, affiliate disclosure, and frontend QA workflows.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## 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

## Link Attribute Auditor

Audits one public web page for anchor `rel` attributes and link hygiene. It reports unsafe `target="_blank"` links, likely sponsored or affiliate links missing `rel="sponsored"`, followed external links, empty anchor text, and summary counts for `nofollow`, `sponsored`, and `ugc`.

### Use cases

- SEO agencies checking outbound-link policy on client pages.
- Affiliate and content teams validating sponsored-link disclosure at launch.
- Frontend teams catching `target="_blank"` links without `rel="noopener"`.
- Site migration QA for templates that generate external links.
- Scheduled monitoring for editorial, marketplace, and partner pages.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `startUrl` | string | Yes | Public HTTP or HTTPS page URL to audit. Credentials and private network targets are rejected. |
| `maxLinks` | integer | No | Maximum number of HTTP/HTTPS links to parse. Default `200`, maximum `1000`. |
| `timeoutSeconds` | integer | No | Page request timeout. Default `10`, range `3` to `30`. |

### Output

The Actor pushes one dataset item per run.

| Field | Type | Description |
| --- | --- | --- |
| `inputUrl` | string | Original URL from input. |
| `normalizedInputUrl` | string | URL after defaulting to HTTPS when no scheme is provided. |
| `finalUrl` | string | Final audited URL after safe redirects. |
| `status` | integer or null | HTTP status from the audited page. |
| `ok` | boolean | True when the page fetch succeeded with a non-error HTTP status. |
| `checkedAt` | string | ISO timestamp for the audit. |
| `linkCount` | integer | Number of HTTP/HTTPS links parsed, bounded by `maxLinks`. |
| `externalLinkCount` | integer | Links whose host differs from the audited page. |
| `targetBlankCount` | integer | Links with `target="_blank"`. |
| `unsafeTargetBlankCount` | integer | `target="_blank"` links missing both `noopener` and `noreferrer`. |
| `nofollowCount` | integer | Links containing `rel="nofollow"`. |
| `sponsoredCount` | integer | Links containing `rel="sponsored"`. |
| `ugcCount` | integer | Links containing `rel="ugc"`. |
| `linkSamples` | array | Up to 50 links with detected issues, including URL, text, rel tokens, and issue codes. |
| `score` | integer | Readiness score from 0 to 100. |
| `grade` | string | Letter grade from A to F. |
| `issues` | array | Human-readable issue summary. |
| `recommendations` | array | Actionable fixes. |
| `error` | string or null | Fetch or validation error, if any. |

### Example input

```json
{
  "startUrl": "https://example.com/blog/partner-roundup",
  "maxLinks": 200,
  "timeoutSeconds": 10
}
```

### Example output

```json
{
  "inputUrl": "https://example.com/blog/partner-roundup",
  "normalizedInputUrl": "https://example.com/blog/partner-roundup",
  "finalUrl": "https://example.com/blog/partner-roundup",
  "status": 200,
  "ok": true,
  "checkedAt": "2026-08-11T00:00:00.000Z",
  "linkCount": 42,
  "externalLinkCount": 18,
  "targetBlankCount": 12,
  "unsafeTargetBlankCount": 3,
  "nofollowCount": 7,
  "sponsoredCount": 2,
  "ugcCount": 0,
  "linkSamples": [
    {
      "url": "https://partner.example/deal?utm_medium=affiliate",
      "text": "Affiliate deal",
      "external": true,
      "targetBlank": false,
      "rel": [],
      "nofollow": false,
      "sponsored": false,
      "ugc": false,
      "noopener": false,
      "noreferrer": false,
      "issues": ["likely_sponsored_without_rel_sponsored"]
    }
  ],
  "score": 75,
  "grade": "B",
  "issues": ["Likely sponsored or affiliate links missing rel=\"sponsored\": 1"],
  "recommendations": ["Mark paid, affiliate, or partner links with rel=\"sponsored\"."],
  "error": null
}
```

### Security

The Actor only fetches public HTTP and HTTPS pages. It rejects URL credentials, localhost, private IPv4 and IPv6 literals, and hostnames that resolve to private network addresses. Redirect targets are validated before following. It does not log credentials and does not fetch discovered links.

### Pricing

| Event | Suggested price |
| --- | ---: |
| Actor start | `$0.005` |
| Page audited | `$0.01` |

A normal run costs about `$0.015` and returns one structured audit result.

### FAQ

#### Does this check whether links are broken?

No. It audits anchor attributes only. Use a broken-link checker when status validation is required.

#### Does it require browser automation?

No. It fetches the page HTML and parses anchor tags, which keeps runs fast and low maintenance.

#### Does it crawl the whole site?

No. It audits one page per run. Schedule multiple runs or call it from your own workflow for page lists.

#### Can it audit affiliate links?

Yes. It flags likely affiliate or sponsored links using visible text and URL hints, then reports whether `rel="sponsored"` is present.

# Actor input Schema

## `startUrl` (type: `string`):

Public HTTP or HTTPS page URL to audit. Credentials and private network targets are rejected.

## `maxLinks` (type: `integer`):

Maximum number of HTTP/HTTPS links to parse from the page.

## `timeoutSeconds` (type: `integer`):

Request timeout for the page fetch.

## Actor input object example

```json
{
  "startUrl": "https://example.com",
  "maxLinks": 200,
  "timeoutSeconds": 10
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("phoenix2810/link-attribute-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 = { "startUrl": "https://example.com" }

# Run the Actor and wait for it to finish
run = client.actor("phoenix2810/link-attribute-auditor").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 '{
  "startUrl": "https://example.com"
}' |
apify call phoenix2810/link-attribute-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,phoenix2810/link-attribute-auditor"
        }
    }
}
```

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/IdYVs2T1X17sSl3Io/builds/uuZ9yopBBFUlQ8YVP/openapi.json
